DragonFlyBSD/src 669d88fcontrib/awk README.DRAGONFLY README.DELETED

contrib/awk: Update README.DRAGONFLY and README.DELETED
DeltaFile
+7-3contrib/awk/README.DRAGONFLY
+2-1contrib/awk/README.DELETED
+9-42 files

DragonFlyBSD/src cae19fdcontrib/awk FIXES.1e FIXES

Merge branch 'vendor/AWK'

Upgrade AWK from 20240122 to 20260426.
DeltaFile
+0-1,429contrib/awk/FIXES.1e
+0-108contrib/awk/FIXES
+60-35contrib/awk/b.c
+34-14contrib/awk/main.c
+24-16contrib/awk/run.c
+12-10contrib/awk/tran.c
+130-1,6125 files not shown
+138-1,63011 files

DragonFlyBSD/src b56f30cusr.bin/awk/awk Makefile, usr.bin/awk/maketab Makefile

awk(1): Clean up makefiles
DeltaFile
+0-5usr.bin/awk/maketab/Makefile
+1-1usr.bin/awk/awk/Makefile
+1-62 files

DragonFlyBSD/src b1be7b9contrib/awk FIXES.1e FIXES

vendor/awk: Upgrade from 20240122 to 20260426
DeltaFile
+0-1,429contrib/awk/FIXES.1e
+0-108contrib/awk/FIXES
+60-35contrib/awk/b.c
+34-14contrib/awk/main.c
+24-16contrib/awk/run.c
+12-10contrib/awk/tran.c
+130-1,6125 files not shown
+138-1,63011 files

DragonFlyBSD/src 1e057a0usr.bin/awk/awk Makefile

awk(1): Override FOPEN_MAX to handle 64 open files instead of 20

Awk uses a fixed array of size FOPEN_MAX to track the open files, so it
could only open max 20 files as the default FOPEN_MAX is defined to be
20 in <stdio.h>.  Override FOPEN_MAX to 64 to support more open files.

Obtained-from: FreeBSD (commit d97cdd33492f5afe2150e1fced657c9a31911c67)
DeltaFile
+1-1usr.bin/awk/awk/Makefile
+1-11 files

DragonFlyBSD/src 56f761dinitrd/rescue Makefile, initrd/rescue.libcrypto Makefile

bsd.crunchgen.mk: Include <bsd.init.mk>

This will include "../Makefile.inc" where CRUNCH_* are defined.
DeltaFile
+0-3initrd/rescue/Makefile
+0-3initrd/rescue.libcrypto/Makefile
+1-1share/mk/bsd.crunchgen.mk
+1-73 files

DragonFlyBSD/src b1c60d0initrd/rescue Makefile, initrd/rescue.libcrypto Makefile

bsd.crunchgen.mk: Pass CFLAGS to "make exe" to enable WARNS

The "make exe" phase builds the stub objects and the final crunched
executable.  Because the crunchgen(1) generated makefile does not
include any makefile from the system, the ${CFLAGS} was empty and the
${WARNS} tunable was ineffective.

By explicitly passing the ${CFLAGS} to the "make exe" phase, the ${WARNS}
is correctly accounted in the main Makefile (that includes
<bsd.crunchgen.mk>) and works as expected.

The "make objs" that builds the objects of each individual tool to be
crunched is not affected.  Those objects are already built with their
corresponding ${WARNS} and ${CFLAGS}.

As we're explicitly setting the ${CFLAGS}, filter the LTO flags in
<bsd.crunchgen.mk> and thus revert the previous commit
a3f29142615c9b60b7f2d6c4eecbf55e595d778b.


    [6 lines not shown]
DeltaFile
+0-5usr.bin/crunch/crunchgen/crunchgen.c
+4-0initrd/rescue.libcrypto/Makefile
+4-0initrd/rescue/Makefile
+1-0share/mk/bsd.crunchgen.mk
+9-54 files

DragonFlyBSD/src 9d10863usr.bin/crunch/crunchgen crunchgen.c

crunchgen(1): Remove the hardcoded 'strip' command

The binary will be stripped by install(1) during the installation phase.
DeltaFile
+0-1usr.bin/crunch/crunchgen/crunchgen.c
+0-11 files

DragonFlyBSD/src 73dce94usr.bin/crunch/crunchgen crunched_main.c

crunchgen(1): Fix compilation warnings (prepare for future update)

Fix the following compilation warnings when we enable WARNS for
initrd/{rescue,rescue.libcrypto} build in the future:

```
rescue.c: In function 'cmpstringp':
rescue.c:88:20: error: cast discards 'const' qualifier from pointer target type [-Werror=cast-qual]
  const char *s1 = *(const char **)p1;
                    ^
rescue.c:89:20: error: cast discards 'const' qualifier from pointer target type [-Werror=cast-qual]
  const char *s2 = *(const char **)p2;
                    ^
rescue.c: In function 'crunched_usage':
rescue.c:96:1: error: old-style function definition [-Werror=old-style-definition]
 crunched_usage()
 ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

    [2 lines not shown]
DeltaFile
+3-4usr.bin/crunch/crunchgen/crunched_main.c
+3-41 files

DragonFlyBSD/src b38721cusr.bin/uname uname.c uname.1

uname(1): Add '-b' flag to show the kernel's build-ID

The kernel's build-ID has been exposed via the "kern.build_id" sysctl
MIB.  Add a '-b' flag to uname(1) to report it.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D20511)
DeltaFile
+14-2usr.bin/uname/uname.c
+4-3usr.bin/uname/uname.1
+18-52 files

DragonFlyBSD/src f188159sys/conf kern.pre.mk

kern.pre.mk: Introduce ${ELDFLAGS} to help customize linker flags

Similar to the case in kmod.mk, introduce the ${ELDFLAGS} variable to
collect the linker flags and makes it easier to customize them.

While there, clean up a bit.
DeltaFile
+14-18sys/conf/kern.pre.mk
+14-181 files

DragonFlyBSD/src 1c40f14sys/platform/pc64/conf ldscript.x86_64, sys/platform/vkernel64/conf ldscript.x86_64

platform: Remove obsolete '.exception_ranges' from linker scripts

As the comment says, it was generate by the Sun/Oracle C++ compiler,
so does not apply to us.  Just remove it as FreeBSD did.

See also: FreeBSD
DeltaFile
+1-6sys/platform/pc64/conf/ldscript.x86_64
+1-6sys/platform/vkernel64/conf/ldscript.x86_64
+2-122 files

DragonFlyBSD/src 30fd908stand/boot/common load_elf.c

stand: Fix compilation error with ELF_VERBOSE in load_elf.c
DeltaFile
+1-1stand/boot/common/load_elf.c
+1-11 files

DragonFlyBSD/src 5b50f07usr.bin/uname uname.c

uname(1): Improve sysctl()/sysctlbyname() error report

Report the sysctl MIB name/path when it fails.

Meanwhile, clean up the style a bit.
DeltaFile
+28-31usr.bin/uname/uname.c
+28-311 files

DragonFlyBSD/src 4e67623sys/kern kern_mib.c, sys/platform/pc64/conf ldscript.x86_64

kernel: Expose the build-ID via "kern.build_id" sysctl

Update the linker scripts to expose the start and end of the
linker-generated build-ID, and add the "kern.build_id" sysctl handler to
fetch the information.

A subsequent commit will update uname(1) to report it as well.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D20326)
DeltaFile
+44-0sys/kern/kern_mib.c
+5-1sys/platform/vkernel64/conf/ldscript.x86_64
+5-1sys/platform/pc64/conf/ldscript.x86_64
+54-23 files

DragonFlyBSD/src 6597598stand/boot/common load_elf.c load_elf_obj.c

stand: Replace the cumbersome "x" __XSTRING() "y" with '__func__'
DeltaFile
+15-17stand/boot/common/load_elf.c
+9-17stand/boot/common/load_elf_obj.c
+24-342 files

DragonFlyBSD/src 8f67eb8sys/conf kmod.mk

kmod.mk: Style cleanups
DeltaFile
+21-23sys/conf/kmod.mk
+21-231 files

DragonFlyBSD/src e83617asys/platform/pc64/conf ldscript.x86_64, sys/platform/vkernel64/conf ldscript.x86_64

platform: Use INT3 instead of NOP for x86 binary padding

We should never end up executing the inter-function padding, so we
are better off faulting than silently carrying on to whatever function
happens to be next.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D10047)
DeltaFile
+3-3sys/platform/vkernel64/conf/ldscript.x86_64
+3-3sys/platform/pc64/conf/ldscript.x86_64
+6-62 files

DragonFlyBSD/src 11da405stand/boot/common reloc_elf.c load_elf.c

stand: Remove obsolete 'FREEBSD_ELF' define

The last use of it was removed from <link.h> back in 2002 in FreeBSD, so
it never affected DragonFly.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D42964)
DeltaFile
+0-3stand/boot/common/reloc_elf.c
+0-1stand/boot/common/load_elf.c
+0-1stand/boot/common/load_elf_obj.c
+0-53 files

DragonFlyBSD/src c487de2sys/conf kern.pre.mk kmod.mk

kernel: Enable --build-id=sha1 for kernel and module link

See also: FreeBSD (https://reviews.freebsd.org/D11314)
DeltaFile
+2-0sys/conf/kern.pre.mk
+2-0sys/conf/kmod.mk
+4-02 files

DragonFlyBSD/src ffa7f09sys/conf debuginfo.ldscript kern.pre.mk, sys/platform/pc64/conf ldscript.x86_64

platform: Move debug sections to a common linker script

In addition, sync the debug sections with FreeBSD's to add DWARF 4 and 5.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D44071)
DeltaFile
+41-0sys/conf/debuginfo.ldscript
+4-36sys/platform/pc64/conf/ldscript.x86_64
+4-36sys/platform/vkernel64/conf/ldscript.x86_64
+1-1sys/conf/kern.pre.mk
+50-734 files

DragonFlyBSD/src aec7479sys/platform/pc64/conf ldscript.x86_64, sys/platform/vkernel64/conf ldscript.x86_64

platform: Remove .ldata/.lrodata/.lbss sections from ldscript

The kernel is compiled with '-mcmodel=kernel', so the compiler never
emits the large model sections (e.g., .ldata/.lrodata/.lbss).  Therefore,
remove such sections from the kernel linker scripts.

This change has another major benefit: the '.bss' section now correctly
lies at the end, so the linker does not need to allocate real file space
to store the BSS section.  As a result, the kernel file size is reduced
by 14MB (e.g., stripped kernel reduces from 29MB to 15MB)!  Meanwhile,
the following gold linker warning is also fixed:
```
/usr/libexec/binutils234/elf/ld.gold: warning: script places BSS section in the middle of a LOAD segment; space will be allocated in the file
```

See also: FreeBSD (https://reviews.freebsd.org/D21859)
DeltaFile
+0-20sys/platform/pc64/conf/ldscript.x86_64
+0-20sys/platform/vkernel64/conf/ldscript.x86_64
+0-402 files

DragonFlyBSD/src 8a3c573sys/platform/pc64/conf ldscript.x86_64, sys/platform/vkernel64/conf ldscript.x86_64

platform: Remove wrong comment from ldscript

The comment 'default linker script' was copied from the GNU ld's default
linker script, and is obviously wrong for the kernel, so just remove it.
DeltaFile
+1-3sys/platform/pc64/conf/ldscript.x86_64
+1-3sys/platform/vkernel64/conf/ldscript.x86_64
+2-62 files

DragonFlyBSD/src 4414dacsys/conf kern.post.mk

kern.post.mk: Early fail the build in case of any duplicate objs

Since all the kernel objects are built and placed in the same directory,
a conflict is quite possible when two modules have a file with the same
name.  Another conflict possibility is that the source is specified
twice in conf/files.

In order to avoid running into mysterious/unexpected issues caused by
duplicate objects, simply abort the build when such a duplicate is
found.

Of course, a better solution is to refactor the build framework to
eliminate such a limitation, so that a module may choose whatever
filename it likes.
DeltaFile
+7-0sys/conf/kern.post.mk
+7-01 files

DragonFlyBSD/src 80c6dc3sys/conf bsd.kern.mk, sys/platform/pc64/conf kern.mk

bsd.kern.mk: Remove -finline-limit and related compiler parameters

These compiler flags/parameter were inherited from FreeBSD.  They
basically meant to ALWAYS inline the functions mark with the 'inline'
keyword.  Since modern GCC provides with the 'always_inline' attribute,
it's better to use '__always_inline' annotation for those functions that
must be inlined.  As a result, remove the '-finline-limit' and related
parameters to achieve better inlining results; e.g., it avoids
unnecessary over-inlining.
DeltaFile
+1-7sys/conf/bsd.kern.mk
+0-2sys/platform/vkernel64/conf/kern.mk
+0-2sys/platform/pc64/conf/kern.mk
+1-113 files

DragonFlyBSD/src ddf0679sys/kern vfs_cache.c kern_timeout.c, sys/sys spinlock2.h

kernel: Adjust inlining annotations for better results

We will be removing the '-finline-limit=8000 ...' compiler flags, which
can change the inlining results.  By adjusting the inlining annoations
with proper '__always_inline' annotations, the inlining results become
better and more deterministic.

In the meantime, a few unnecessary '__inline' annotations are removed.

Discussed-with: dillon
DeltaFile
+13-13sys/kern/vfs_cache.c
+4-4sys/sys/spinlock2.h
+3-3sys/kern/kern_timeout.c
+20-203 files

DragonFlyBSD/src 4c9946bsys/conf kern.pre.mk

kern.pre.mk: Remove 'gcc2_compiled.' symbol stripping

This was inherited from FreeBSD and has long been obsolete since GCC 3.

See also: FreeBSD (https://reviews.freebsd.org/D38764)
DeltaFile
+1-2sys/conf/kern.pre.mk
+1-21 files

DragonFlyBSD/src 0655fabsys/ddb db_command.c

ddb - Try AcpiReset() when invoking DDB's reset command.

- This allows some modern notebooks to successfully reset from DDB, where
  the classic outb(0x64, 0xFE) method no longer works. For some notebooks,
  we'll also need to support EFI Reset here, but that will require further
  work.
DeltaFile
+20-0sys/ddb/db_command.c
+20-01 files

DragonFlyBSD/src 2a63744sys/platform/pc64/x86_64 efirt.c

efirt - Register EFI Reset with the shutdown_final EVENTHANDLER.

- This adds a safeguard to efi_enter() to fail gracefully when called from
  a kernel thread, where curthread->td_lwp is NULL.
- Further work is needed to allow EFI Reset to work more simply without
  messing with the current LWP's vmspace.
DeltaFile
+22-0sys/platform/pc64/x86_64/efirt.c
+22-01 files

DragonFlyBSD/src 61db8c7sys/conf kern.pre.mk

kern.pre.mk: Remove unused and duplicate NORMAL_C_C

The 'NORMAL_C_C' macro is identical to 'NORMAL_C' and is unused, so just
remove it.
DeltaFile
+0-1sys/conf/kern.pre.mk
+0-11 files