Commit Graph

1490 Commits

Author SHA1 Message Date
tsutsui 09b5dada8b Build mkhybrid as a build tool. 2024-05-31 20:52:58 +00:00
gutteridge 462b46f8ec Add mkubootimage to riscv tools 2024-05-23 02:50:47 +00:00
tsutsui 173d80ed84 Install cd9660 related system headers for tools installboot(8) builds. 2024-05-19 15:43:24 +00:00
riastradh ad49149131 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.
2024-04-01 18:33:22 +00:00
christos a7487e8acc hook gzip to the build so that we can test it in other OS's. Not used yet. 2024-04-01 02:22:38 +00:00
christos 7ba93f1a9b Start for a TOOL_GZIP 2024-04-01 02:19:41 +00:00
christos 878fdbc71b revert previous, riastradh fixed it correctly and this is not needed. 2024-04-01 02:18:30 +00:00
christos 97a4ef4394 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.
2024-03-31 03:20:38 +00:00
riastradh 3b71f8e333 tools/elftoolchain: Build with BUILTIN_ELF_HEADERS again.
The header file dependency that motivated disabling this should be
resolved now.
2024-03-30 22:39:53 +00:00
riastradh faabfc3e13 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.
2024-03-30 22:38:02 +00:00
christos d40876c8a3 Add ${_MKTARGET_CREATE} 2024-03-27 21:55:08 +00:00
christos 1546e871c7 Remove dependency to elfdefinitions.h, this is a mess, since it needs
${TOOL_M4} which might not be available yet.
2024-03-27 21:54:43 +00:00
rillig 16198ed8df tools/Makefile: clean up TOOLDIR validation
At the point where tools/Makefile is loaded, TOOLDIR doesn't have to
exist yet, it will be created later.  Remove the redundant quotes from
the .error messages.
2024-03-27 05:43:38 +00:00
christos cc85530f41 don't install headers as executable. 2024-03-26 16:52:03 +00:00
christos 1a67493085 - 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.
2024-03-26 16:48:34 +00:00
christos 345cf9fb81 changes for r4037 2024-03-03 17:37:58 +00:00
mrg 6989fe4bb2 version our GCC 12 as "nb2 20240221" now. 2024-02-25 02:24:19 +00:00
mrg 439ff855d8 build isl tool for GCC 12. 2024-02-23 05:34:41 +00:00
mrg e73c8d2f22 enable isl support for GCC 12. 2024-02-22 02:47:26 +00:00
mrg 73f1b4907e Include the local NetBSD GCC version so that bumps to it trigger rebuilds
unfortunately, this will cause one rebuild to get the new name.
2024-02-22 02:40:21 +00:00
mrg f03cf991b8 fetch G_CPP20_SOURCES. 2024-02-21 08:24:46 +00:00
thorpej fab69c5eb0 Add virt68k headers.
(Why on earth is this a manual step!@#??)
2024-01-03 03:18:31 +00:00
rin b931da273c tools/Makefile: Correct inverted comment. NFC 2023-11-30 06:29:33 +00:00
rin 6673897143 tools/binutils: Add support to mknative for binutils.old 2023-11-25 12:11:27 +00:00
mrg 917ce79018 bump the netbsd gcc 10 version to "nb3 20231008" for all the vax updates.
XXX: check if mknative needed?
XXX: pullup-10
2023-10-08 21:52:34 +00:00
rin f718e16112 tools/gcc: Sprinkle NB_FIX_VAX_BACKEND for vax to enable gcc.old MI fixes
PR port-vax/57646: Import major vax toolchain fix by Kalvis Duckmanton
2023-10-07 12:12:58 +00:00
palle 6042d5e3e5 Update build instructions for Solaris 10 hosts 2023-09-02 18:45:48 +00:00
palle ce4c8804b1 Update build instructions for Solaris 11.3 hosts 2023-08-24 19:30:48 +00:00
palle 8ff2783e9b Update build instructions for Solaris 11.3 hosts 2023-08-23 19:09:53 +00:00
rin f97ac75017 gdb/mknative: Preset yes to rename(2) checks
It must be better to have this workaround here, rather than in external.
(Thanks uwe@ for suggestion!)

Confirmed that the same files generated as before.
2023-08-20 02:30:58 +00:00
rin 4ff1013c35 tools/gdb: Drop working dir for mknative from generated files
Migrate -I${.OBJDIR}/.native/include from CPPFLAGS to CCADDFLAGS for
this purpose.

No binary changes for native binaries as far as I can see.
2023-08-17 07:54:10 +00:00
rin ab9092b155 tools/gdb: Sprinkle --enable-obsolete for ia64 :( 2023-08-17 05:35:09 +00:00
christos 95f204a973 override the override 2023-08-15 19:56:07 +00:00
palle deca08f38b Update build instructions for Solaris 10 and Solaris 11.3 hosts 2023-08-15 19:13:12 +00:00
christos 37060aa12c backout previous; cross build needs native gmp 2023-08-14 22:41:34 +00:00
palle c25779f438 Update build instructions for Solaris 11.4 (CBE) hosts 2023-08-14 18:49:45 +00:00
christos 982170f0be fix cross-gdb 2023-08-14 16:45:26 +00:00
christos c7cb6a1257 jump through hoops to make the native build find gmp for gdb. 2023-08-09 18:57:04 +00:00
christos 9eceabbe08 mknative support for gdb-13.2 2023-07-31 17:09:59 +00:00
mrg e374a119f0 updates for GCC 12 (relatively tiny).
- gcov-iov.h is now called version.h and we build it directly.
- need to explicitly ask for bversion.h gtyp-input.list to be built.
2023-07-31 01:48:37 +00:00
palle 2c5ae00c27 Update build instruction for Solaris 11.4 (CBE) hosts 2023-07-30 19:03:50 +00:00
mrg e791292b6c mark our GCC 12 as "nb1 20230729". 2023-07-30 06:36:21 +00:00
mrg 0e63a0ec09 gcc 10 is now in gcc.old, make mknative-gcc.old gcc-10 happy. 2023-07-28 08:05:29 +00:00
lukem dac4cd245f tools/compat/compat_defs.h: improve NAME_MAX compat
Move the NAME_MAX workaround to the <limits.h> section,
and don't assume that _XOPEN_NAME_MAX is available.
2023-07-21 22:05:04 +00:00
lukem 569efedda5 tools/compat: regen 2023-07-20 16:22:30 +00:00
lukem 4815827f69 tools: binstall can use posix_spawn() instead of vfork() 2023-07-20 16:21:23 +00:00
lukem 307596b164 tools/make: regen 2023-07-20 15:20:00 +00:00
lukem a08c7a13b0 tools/compat: regen 2023-07-20 15:18:34 +00:00
lukem 54f2e3827e tools/make: build with -Wno-deprecated-declarations
Use NB_CHECK_CC_FLAG() from ../tools/compat to determine
if the compiler supports -Wno-deprecated-declarations.
Avoids sooking about vfork() on macOS.
2023-07-20 15:16:44 +00:00
lukem 27a8da3b8e tools/compat: provide nb_check_cc_flag.m4
Implement m4 macro NB_CHECK_CC_FLAG(FLAG, [VAR=FLAG_DERIVED])
	Determine if the C compiler supports FLAG,
	and sets output variable VAR to FLAG if FLAG is supported.

	If VAR is not provided, default to FLAG_DERIVED, which is
	FLAG converted to upper-case and all special characters
	replaced with "_", and the result prepended with "CC_".
	FLAG_DERIVED is appended to the m4 macro NB_CHECK_CC_FLAG_VARS.
	E.g., if FLAG is "-Wexample=yes", FLAG_DERIVED is "CC_WEXAMPLE_YES".

This is implemented in separate buildaux/nb_check_cc_flag.m4,
based on configure's NB_CC_FLAG(), but supports VAR override.

Adapt configure from internal NB_CC_FLAG() to NB_CHECK_CC_FLAG().

(Note: AX_CHECK_COMPILE_FLAG() from autoconf-archive could be enhanced
to support the clang and gcc workarounds I've implemented here.)
2023-07-20 15:15:23 +00:00