Commit Graph

1432 Commits

Author SHA1 Message Date
lukem cf9c9d4dc8 tools: revert use of <bsd.hostinit.mk>
tools/Makefile.host revision 1.35 changed from
  setting various NOxxx variables and .include <bsd.own.mk>
to
  .include <bsd.hostinit.mk>
which sets the same NOxxx variables, .include <bsd.init.mk>
which optionally .include ../Makefile.inc before .include <bsd.own.mk>.

This chnage caused build failures with HAVE_LLVM=yes, so revert rev 1.35.
(Maybe to do with the .include ../Makefile.inc. The tools/llvm* build is
tricky, and it's easier to revert this change than debug.)
2023-06-04 16:53:59 +00:00
lukem 333a9a00e1 tools: use <bsd.hostinit.mk> where appropriate
bsd.hostinit.mk sets a bunch of NOxxx variables before
including bsd.init.mk (which includes bsd.own.mk),
so simplify instead of replicating the NOxxx setup
for host tools.
2023-06-04 10:00:20 +00:00
lukem 869cdbbd1c regen 2023-06-03 09:18:14 +00:00
lukem 97766c5b60 tools/compat: support all bsd.own.mk disabled warnings
Check the host CC support for all the warnings now in <bsd.own.mk>
and override appropriately in defs.mk.

In general there's a 1:1 mapping, with the special case
CC_WNO_ADDRESS_OF_PACKED_MEMBER which is set from both
@CC_WNO_ADDRESS_OF_PACKED_MEMBER@ (gcc) and
@CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER@ (clang).
2023-06-03 09:10:13 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
lukem a25022c648 tools: use NONLS= not MKNLS=no 2023-06-02 20:47:27 +00:00
hgutch d9afbe107f Fix LLVM build with host gcc 13
Building LLVM with a host gcc 13 fails and suggests including <cstdint>
in external/apache2/llvm/dist/llvm/include/llvm/Support/Signals.h .
Instead of this, joerg@ suggested not modifying the llvm vendor branch
but instead working around this in our LLVM build infrastructure.
2023-05-30 19:05:04 +00:00
lukem 39d234c9f0 tools/compat: regen 2023-05-30 19:04:42 +00:00
lukem 8d651401a4 tools/compat: disable host CC warnings
Determine if the host CC supports flags to disable various
warnings similar to <bsd.own.mk> GCC_*, CLANG_*, and CC_*,
and override the <bsd.own.mk> equivalents in defs.mk.

Silences "warning: unknown warning option '...'" from our source.
External source (e.g., binutils and gcc) need their own fixes
to enhance their detection of supported clang compiler flags.
2023-05-30 18:54:21 +00:00
lukem 2356d03a18 tools/compat: detect supported host compiler flags
Define NB_CC_FLAG(FLAG) to use AX_CHECK_COMPILE_FLAG
to determine if the host compiler supports FLAG
and define and AC_SUBST CC_FLAG if so.

Use workarounds to force clang to hard-fail on unknown -Wwarning,
and gcc to use -WWARN to check unknown -Wno-WARN because the
latter doesn't cause an error in gcc.

In the future we could use NB_CC_FLAG([-fcommon]) for
older NetBSD release branches compiled with host gcc 10+.

Rework Darwin -no-cpp-precomp check to use NB_CC_FLAG().
Note: this flag probably hasn't been required on macOS (Darwin)
for a long time, but serves as a good example on how to use this.

Display varaibles at the end of configure to show what was detected.
2023-05-30 18:39:19 +00:00
lukem 69c1db2ad0 tools/compat: import AX_CHECK_COMPILE_FLAG
Import AX_CHECK_COMPILE_FLAG serial 6 from autoconf-archive
  https://github.com/autoconf-archive/autoconf-archive.git
as at commit 5b5ce7f on 2023-05-01.
2023-05-30 18:35:16 +00:00
lukem c578bb77d2 tools/compat: don't expose HAVE_PTHREAD_H to make
Non of the tools Makefiles needs HAVE_PTHREAD_H, so don't
AC_SUBST it or provide in defs.mk.
2023-05-30 18:31:55 +00:00
lukem f7d6f1b13f tools/compat: use autoreconf, support MAKEVERBOSE
Use autoreconf instead of autoconf + autoheader;
we'll need aclocal in the near future.

If MAKEVERBOSE >= 2, add -v to autoreconf.
2023-05-30 18:27:04 +00:00
lukem e6c216806f tools/compat: regen 2023-05-29 21:34:57 +00:00
lukem 2ec2a2d759 tools/compat/configure.ac: style tweaks
Use "NB_" prefix not "AC_" for our macros ("AC_" is for autoconf).
Fail is NB_ macro isn't defined.
Use AC_DEFUN() instead of define().
Consistently use () in zero argument macro calls.
2023-05-29 21:30:42 +00:00
lukem 0589c2d76d tools/compat: regen for dispatch_semaphore_create 2023-05-23 20:22:11 +00:00
lukem 55152776e1 tools/compat: MAKEVERBOSE support in regen 2023-05-23 20:20:54 +00:00
lukem 6eddcd88c5 ctfmerge: fix macOS semaphore implementation
Use dispatch_semaphore_create() if present instead of sem_init().

macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).
This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().

Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103.
2023-05-23 19:53:24 +00:00
lukem cf4db277d4 Fix passing -j NNN to gmake
Use a more restrictive pattern to extract -j NNN from MAKEFLAGS
into GMAKE_J_ARGS, to avoid false positives when the source directory
has "-j" in the path (e.g "amd64-job-000012" or "src-j9999").
Previously this could pass either -"-j" or "-j BIGNUM" to gmake
and result in "vfork: Resource temporarily unavailable" failures.

PR misc/54456
2023-05-19 10:42:34 +00:00
lukem c2a5a723f0 tools: if MAKEVERBOSE >=2, noisy automake builds
Explicitly build with V=1 for MAKEVERBOSE >= 2
so that Makefile.gnuhost (automake) consumers
are more consistent with native builds.

(If the upstream is using AM_SILENT_RULES(yes)
then the default is V=0).
2023-05-15 21:24:56 +00:00
skrll baf487ef7a Set ac_cv_func_sigprocmask=yes as the symbol renaming confuses the
configure script on architectures that don't provide a compatibilty
symbol, e.g. RISC-V
2023-05-08 09:47:20 +00:00
christos 6135670d36 remap arm directory names, the same way the source does. 2023-02-07 20:37:30 +00:00
christos 342a25befd Disable enabling executable stack when the gnu stack note is missing.
Merge common configure arguments.
2023-01-18 12:52:55 +00:00
mrg 41d5ee3235 fix the binutils build with read-only source trees
don't play with m68k-parse.c in tools/binutils/Makefile but disable
the rules that rebuild it so we always use the upstream version,
using the standard "NetBSD_DISABLED" method.

this was necessary to build on linux in 2014 (which may or may not
still ne necessary), but it also avoids triggering rebuild rules
based upon the timestamps on .y vs .c.

tested with amiga, amd64, and i386 "build.sh tools" builds.
2022-12-31 05:44:25 +00:00
christos 8b0a0c21a2 Handle both places where m68k-parse can be found (for 2.34 and 2.39) 2022-12-25 17:25:22 +00:00
christos 7aa193d2ef Adjust for binutils-2.39 2022-12-24 20:17:46 +00:00
christos b74001cc4e don't require gettext 2022-10-29 13:53:35 +00:00
mrg 7f2f931bcb bump the netbsd version GCC to yesterday's date. 2022-07-23 19:01:18 +00:00
mrg 7e76252b1d don't rename codecvt.cc here, do it in a Makefile when consumed.
since the Makefiles already need updates for these, it's easier
if all of the changes are there.
2022-07-22 06:50:26 +00:00
andvar 2a76d4a970 s/hidding/hiding/ 2022-05-28 22:00:55 +00:00
jkoshy 242fdcb1b6 Prepare the ground for <elfdefinitions.h> to be used by the 'tools'
build of 'libctf'.
2022-05-03 10:50:42 +00:00
jkoshy b5818589d8 Bug fix: use the correct target path in a dependency. 2022-05-02 18:28:38 +00:00
jkoshy f56b29a750 Make the generated <sys/elfdefinitions.h> file visible when compiling
libdwarf.
2022-05-01 17:25:19 +00:00
jkoshy 8d566712d0 Remove the 'tools/lib{elf,dwarf}' directories.
These have been moved to under 'tools/elftoolchain'.
2022-04-22 15:47:03 +00:00
jkoshy b47ec9f9c1 Disconnect 'tools/lib{elf,dwarf}' from the build.
These libraries are now built by 'tools/elftoolchain/lib{elf,dwarf}'
respectively.
2022-04-18 19:46:35 +00:00
jkoshy 6969f6c52d Update 'tools/ctf{merge,convert}' to use the new build locations for
'libelf' and 'libdwarf'.
2022-04-18 19:40:06 +00:00
jkoshy 2718af68c3 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.
2022-04-18 14:11:43 +00:00
jkoshy 9577c37ab9 Add a Makefile missed out in a previous commit. 2022-04-13 17:54:05 +00:00
jkoshy 42c1249ebe 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.
2022-04-13 17:52:56 +00:00
rillig c153636995 tools: allow tools to use C99
The previous requirement was that tools should only use C89 features.
Several tools did not follow this rule for years.  Since nobody
complained about not being able to build NetBSD in a C89 environment,
drop that rule, now requiring C99.

https://mail-index.netbsd.org/tech-toolchain/2022/01/30/msg004091.html
2022-02-03 20:32:38 +00:00
skrll 36f4db587e Make dtc on riscv 2021-11-14 15:48:02 +00:00
christos a043955316 Patch the build script and toolchain to allow passing through
HOST_CPPFLAGS, HOST_CXXFLAGS, but not LIBRARY_PATH because it breaks
the build. These variables are necessary to support building NetBSD
from a GNU Guix or NixOS host, where /usr/include, /lib, and all
but /bin/sh do not exist.  In many cases, support for HOST_CPPFLAGS
was incomplete. From Ryan Sundberg
2021-09-18 01:47:07 +00:00
rillig 4c66371fdc tools: in non-verbose mode, build the tools silently 2021-08-29 08:36:00 +00:00
mrg 5399f8db9c fetch experimental_headers, experimental_bits_headers, and ext_host_headers
to install install experimental/* and ext/opt_random.h.
2021-08-16 06:25:45 +00:00
cjep ce74361f40 Final note on OpenBSD cross-buildling. Remaining issues were due to
default limits on the build host.
2021-07-11 06:15:42 +00:00
cjep 0534019bd5 LLVM RT library will actually cross-build from OpenBSD provided sufficient
limits are in place for the build user.
2021-07-04 12:57:48 +00:00
cjep 47c30ebc16 Note OpenBSD cross-build progress 2021-06-29 10:02:34 +00:00
cjep c1a451e849 avoid triggering conflict indicator warnings 2021-06-28 07:18:01 +00:00
cjep a09ab67fff note on Darwin/Mac 2021-06-28 07:16:46 +00:00
cjep 63399de5f3 PR port-amiga/56188
Include a prototype for __nbcompat_heapsort. The tools for amiga now
build on Darwin where one Amiga specific tool uses heapsort.

Despite being a one-liner, ./build.sh -m amiga tools was tested on
NetBSD, Darwin, FreeBSD & Linux with the change.

Discussed various options with jdc & thorpej. Perhaps in the future
we could look at using qsort instead of heapsort as qsort is
standardised and more likely to be available. We could then remove
heapsort from the compatibility library.
2021-05-30 10:39:41 +00:00