| History log of /src/tools/elftoolchain |
| Revision | Date | Author | Comments |
| 1.3 | 30-Mar-2024 |
riastradh | tools/elftoolchain: Handle dependencies properly.
This should properly resolve the problem christos was trying to address by a bogus make includes hack and #ifdefs in elftoolchain.
|
| 1.2 | 18-Apr-2022 |
jkoshy | Build 'libelf' and 'libdwarf' under 'tools/elftoolchain', after 'tools/elftoolchain/common' has been built.
This change aligns the 'tools' build with the regular build.
Subsequent commits will change 'tools/libctf' and 'tools/cft{merge,convert}' to use the new build paths.
|
| 1.1 | 13-Apr-2022 |
jkoshy | When building tools use a dedicated subdirectory for compiling Elftoolchain code.
Build and install <sys/elfdefinitions.h> in ${TOOLDIR}/include.
This change prepares the ground for upgrading libelf and libdwarf to their current Elftoolchain versions.
|
| 1.3 | 26-Mar-2024 |
christos | don't install headers as executable.
|
| 1.2 | 02-May-2022 |
jkoshy | Bug fix: use the correct target path in a dependency.
|
| 1.1 | 13-Apr-2022 |
jkoshy | Add a Makefile missed out in a previous commit.
|
| 1.5 | 01-Apr-2024 |
christos | revert previous, riastradh fixed it correctly and this is not needed.
|
| 1.4 | 31-Mar-2024 |
christos | Restore the minimum build to install elfdefinitions.h. Provide a pre-built copy, since we don't have m4 available. Use pax to install it because using the Makefile needs more stuff available (nbsed) which we have not built yet.
|
| 1.3 | 27-Mar-2024 |
christos | Add ${_MKTARGET_CREATE}
|
| 1.2 | 26-Mar-2024 |
christos | don't install headers as executable.
|
| 1.1 | 13-Apr-2022 |
jkoshy | When building tools use a dedicated subdirectory for compiling Elftoolchain code.
Build and install <sys/elfdefinitions.h> in ${TOOLDIR}/include.
This change prepares the ground for upgrading libelf and libdwarf to their current Elftoolchain versions.
|
| 1.2 | 01-Apr-2024 |
christos | revert previous, riastradh fixed it correctly and this is not needed.
|
| 1.1 | 31-Mar-2024 |
christos | Restore the minimum build to install elfdefinitions.h. Provide a pre-built copy, since we don't have m4 available. Use pax to install it because using the Makefile needs more stuff available (nbsed) which we have not built yet.
|
| 1.7 | 01-Apr-2024 |
riastradh | 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.
|
| 1.6 | 30-Mar-2024 |
riastradh | tools/elftoolchain: Build with BUILTIN_ELF_HEADERS again.
The header file dependency that motivated disabling this should be resolved now.
|
| 1.5 | 27-Mar-2024 |
christos | Remove dependency to elfdefinitions.h, this is a mess, since it needs ${TOOL_M4} which might not be available yet.
|
| 1.4 | 26-Mar-2024 |
christos | - fix nbincludes so that it can be included from any level - add elftoolchain/common to the list of headers to be build before depend - make libdwarf build the includes since it needs <sys/elfdefinitions.h> which does not exist on non-netbsd systems.
|
| 1.3 | 03-Mar-2024 |
christos | changes for r4037
|
| 1.2 | 01-May-2022 |
jkoshy | Make the generated <sys/elfdefinitions.h> file visible when compiling libdwarf.
|
| 1.1 | 18-Apr-2022 |
jkoshy | Build 'libelf' and 'libdwarf' under 'tools/elftoolchain', after 'tools/elftoolchain/common' has been built.
This change aligns the 'tools' build with the regular build.
Subsequent commits will change 'tools/libctf' and 'tools/cft{merge,convert}' to use the new build paths.
|
| 1.3 | 01-Apr-2024 |
riastradh | 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.
|
| 1.2 | 03-Mar-2024 |
christos | changes for r4037
|
| 1.1 | 18-Apr-2022 |
jkoshy | Build 'libelf' and 'libdwarf' under 'tools/elftoolchain', after 'tools/elftoolchain/common' has been built.
This change aligns the 'tools' build with the regular build.
Subsequent commits will change 'tools/libctf' and 'tools/cft{merge,convert}' to use the new build paths.
|