--- - branch: MAIN date: Mon Apr 1 18:33:24 UTC 2024 files: - new: '1.7' old: '1.6' path: src/external/bsd/elftoolchain/dist/libelf/_libelf_config.h pathrev: src/external/bsd/elftoolchain/dist/libelf/_libelf_config.h@1.7 type: modified - new: '1.7' old: '1.6' path: src/external/bsd/elftoolchain/dist/libelf/libelf.h pathrev: src/external/bsd/elftoolchain/dist/libelf/libelf.h@1.7 type: modified - new: '1.6' old: '1.5' path: src/external/bsd/elftoolchain/lib/libdwarf/Makefile pathrev: src/external/bsd/elftoolchain/lib/libdwarf/Makefile@1.6 type: modified - new: '1.9' old: '1.8' path: src/external/cddl/osnet/dist/lib/libdtrace/common/drti.c pathrev: src/external/cddl/osnet/dist/lib/libdtrace/common/drti.c@1.9 type: modified - new: '1.19' old: '1.18' path: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c pathrev: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c@1.19 type: modified - new: '1.2' old: '1.1' path: src/external/cddl/osnet/sys/elf.h pathrev: src/external/cddl/osnet/sys/elf.h@1.2 type: modified - new: '1.7' old: '1.6' path: src/external/cddl/osnet/sys/sys/elf.h pathrev: src/external/cddl/osnet/sys/sys/elf.h@1.7 type: modified - new: '1.192' old: '1.191' path: src/tests/lib/libc/sys/t_ptrace_wait.c pathrev: src/tests/lib/libc/sys/t_ptrace_wait.c@1.192 type: modified - new: '1.11' old: '1.10' path: src/tools/ctfconvert/Makefile pathrev: src/tools/ctfconvert/Makefile@1.11 type: modified - new: '1.12' old: '1.11' path: src/tools/ctfmerge/Makefile pathrev: src/tools/ctfmerge/Makefile@1.12 type: modified - new: '1.7' old: '1.6' path: src/tools/elftoolchain/libdwarf/Makefile pathrev: src/tools/elftoolchain/libdwarf/Makefile@1.7 type: modified - new: '1.3' old: '1.2' path: src/tools/elftoolchain/libelf/Makefile pathrev: src/tools/elftoolchain/libelf/Makefile@1.3 type: modified - new: '1.10' old: '1.9' path: src/tools/libctf/Makefile pathrev: src/tools/libctf/Makefile@1.10 type: modified - new: '1.40' old: '1.39' path: src/usr.bin/kdump/Makefile.ioctl-c pathrev: src/usr.bin/kdump/Makefile.ioctl-c@1.40 type: modified - new: '1.3' old: '1.2' path: src/usr.sbin/tprof/ksyms.c pathrev: src/usr.sbin/tprof/ksyms.c@1.3 type: modified id: 20240401T183324Z.956c14fd6934652772df87c6afb69c0942a8fd91 log: | elftoolchain: Be consistent about which ELF header files we use. 1. For tools that use elftoolchain: always use elftoolchain's elfdefinitions.h. Don't even think about looking at the host's sys/exec_elf.h, which makes no sense and should never happen. (ELF tools that don't use elftoolchain, like m68k-elf2coff, continue to use nbincludes/sys/exec_elf.h. But no more nbincludes hacks in elftoolchain.) 2. For kernel components (solaris, zfs, dtrace): always use sys/exec_elf.h, even in Solaris components via sys/elf.h. elfdefinitions.h is not wired up in the kernel build at all. 3. For most userland components that involve libelf: use elfdefinitions.h via libelf header files (libelf.h, gelf.h). libdtrace in particular requires _all_ R_* reloc type definitions, but sys/exec_elf.h brings in only the _current machine's_ R_* reloc type definitions. (While here: Use uintptr_t instead of Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and provided only by sys/exec_elf.h, not by elfdefinitions.h.) And most userland components using libelf don't rely on any properties of the current machine from sys/exec_elf.h, so they can use libelf's elfdefinition.h. Exceptions: - dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h, but it also relies on sys/dtrace.h -> sys/elf.h -> elfdefinitions.h like other userland components using sys/elf.h. - kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h -> sys/elf.h -> elfdefinitions like other userland components using sys/elf.h. - t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse core files, but relies on sys/exec_elf.h for struct netbsd_elfcore_procinfo. None of these exceptions needs all R_* reloc type definitions, so as a workaround, we can just suppress libelf's elfdefinitions.h by defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these exceptions. And undo the whole BUILTIN_ELF_HEADERS mistake. This was: - half bogus workarounds for missing build_install dependencies in tools/Makefile, which are no longer missing now, and - half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in tools involving libelf instead of libelf's elfdefinitions.h, which collides. Longer-term, we may wish to unify sys/exec_elf.h and libelf's elfdefinitions.h, so we don't have to play these games. But at least now the games are limited to three .c files (one of which is generated by Makefile.ioctl-c), rather than haphazardly applied tree-wide by monstrous kludges in widely used .h files with broken hackarounds to get the tools build lurching to completion. module: src subject: 'CVS commit: src' unixtime: '1711996404' user: riastradh