Commit Graph

1487 Commits

Author SHA1 Message Date
mrg 1b78493458 bump gcc 10 version. 2023-07-11 18:13:27 +00:00
rin 701412968e host-mkdep(1): Add support for -iquote.
Not used yet, but may eventually replace deprecated -I-, both for
GCC and clang.
2023-07-10 08:55:44 +00:00
palle 4fb0058c93 Add support for missing NAME_MAX when building on Solaris hosts 2023-07-08 19:10:00 +00:00
palle fcbcc39cb9 Update build instruction for Solaris 11.4 hosts 2023-07-05 16:26:29 +00:00
christos 53d5df7bf7 PR/57500: Palle Lyckegaard: include missing tools/compat/regex.h for
__{BEGIN,END}_DECLS.
2023-07-03 18:50:42 +00:00
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
joerg 53d1339bf7 Update LLVM build system for 249b40b558955afe5ac2b549edcf2d7f859c8cc9
This enables the use of modules for a significant build performance gain
when building with clang as host compiler or when using HAVE_LLVM=yes.
Switch libc++ to using the copy from the mono-repo.
2021-05-30 01:56:44 +00:00
cjep 778a2675ae If we are building date earlier, we need to use an uninstalled copy
of host-mkdep and libnbcompat otherwise the build process looks for
tools that might not be there yet (e.g. fresh build).
Reviewed by martin.
2021-05-27 08:41:35 +00:00
christos f5c6b13fa0 Add a date tool 2021-05-26 20:19:15 +00:00
uwe fbfae67d9f Fix typo in pathname in a comment. 2021-05-24 23:07:40 +00:00
cjep ac6ba04d2d Add macOS High Sierra to the list of verified build platforms 2021-05-12 06:39:28 +00:00
christos cc3abd3a65 Disable again initfini; breaks some archs and not worth dealing with when
we have both gcc's active in the tree.
2021-05-08 19:36:28 +00:00
christos 6bf278a2a9 enable initfini-array since all platforms support it. 2021-05-07 23:00:04 +00:00
cjep 72496168ad More test notes from using build.sh against non NetBSD platforms. 2021-05-07 14:52:59 +00:00
rin 735b9693ea PR port-mvme68k/56146
Build wrtvid as tools.
2021-05-06 13:23:36 +00:00
cjep b84b6c59df Update with information from recent testing of different Linux variants
on AWS. Also FreeBSD 13.
2021-05-06 07:32:15 +00:00
christos 433776ffe2 Make mips-elf2ecoff available for all mips 2021-04-25 15:11:28 +00:00
mrg c30145c84d add a netbsd version for GCC 10. properly generate omp-device-properties.h. 2021-04-11 23:55:47 +00:00
mrg 8aa3f3d2d3 fetch omp-device-properties.h and don't try to fetch sanitizer
stuff automatically yet.
2021-04-11 07:35:45 +00:00
mrg d369354e2d make mknative-gcc.old for GCC 9. begin to update mknative-gcc for GCC 10. 2021-04-11 01:44:14 +00:00
christos 142620627d Add reallocarray; this is used by the new regex code and we don't want to
convert it to reallocarr so the code is kept similar with the original from
FreeBSD.
2021-02-25 13:41:58 +00:00
rin 1fb63bb836 Fix copy-paste error for heapsort(3), so that it is declared appropriately. 2021-02-23 16:03:00 +00:00
dbj e1f6b977ca tools: allow MKCROSSGDB to work when not building gcc 2021-02-06 16:14:55 +00:00
rillig c5b23e2249 lint: make path to lint data configurable
This is needed for strict bool mode, to make the custom header stdbool.h
available when lint is run as part of build.sh.
2021-01-24 16:55:09 +00:00
rillig 568ebf3743 lint: fix path to installed stdbool.h for strict bool mode 2021-01-24 16:22:55 +00:00
christos e2e1ee60e1 Install lint's custom stdbool.h and make lint search for it in the right place. 2021-01-24 15:43:09 +00:00
christos 575adc5486 Don't bother with gdbserver for archs that don't build it. 2020-12-05 21:27:31 +00:00
rin 6053aa6ca7 Correct target directory; src/external/gpl3/gdb.old not gdb. 2020-10-09 23:48:42 +00:00
rin 547879b380 Nowadays, mknative-gdb puts files into external/gpl3/gdb/lib,
instead of external/gpl3/gdb/bin/gdb.

Also, we need to nbmake-MACHINE in external/gpl3/gdb in order to
build dependent libraries correctly.
2020-10-09 23:44:46 +00:00
mrg 4dfd2f9831 initial working version of native-gmp support.
does not use mknative.common yet, so always updates files and does
not mark them with NetBSD rcsid.  (not a regression from the manual
version at least.)
2020-09-26 20:56:53 +00:00
christos 254454c5af grab the gdbserver version 2020-09-24 14:53:17 +00:00
christos 833251feb8 Add gdbserver 2020-09-23 23:21:29 +00:00
christos cfd59bbc53 put gnulib stuff under gnulib/ because things import "gnulib/config.h" 2020-09-17 16:54:31 +00:00
christos 6b8c077795 remove obsolete 2020-09-17 16:07:39 +00:00
christos 576200d14e refine 2020-09-17 16:05:34 +00:00
christos d377601318 Save the mknative-gdb for 8.3 and prepare the mknative-gdb for 10.x 2020-09-17 02:14:48 +00:00
mrg d875c5372c more consolidation and properly condition all variables like previously. 2020-09-09 07:12:04 +00:00
mrg ca7ab82162 consolidate a bunch of libstdc++ variable collection. 2020-09-09 04:52:32 +00:00
mrg d841008ee6 oops, pull out the value of pstl_headers. 2020-09-08 19:17:24 +00:00
mrg 006c30bace mark GCC 9 as (so far) netbsd 20200907 version. this should fix the
compiler saying it is "gcc version 9.3.0 ()".

(needs mknative redo.)
2020-09-06 21:59:33 +00:00
mrg 6e26327fd8 pass down earm* not earmv5* to mknative-gcc. 2020-09-06 02:24:38 +00:00
mrg ecb0fdec1f disable fetching stuff from libsanitizer for now. it needs libstdc++
to build in mknative using gcc makefiles, and our locale changes break
the "normal" build of this.

make sure MKNATIVE_TARGET is always set.  since mknative-gcc doesn't
care about the version any more (we keep two versions for gcc/gcc.old)
simply set it to "gcc".
2020-09-05 10:58:08 +00:00
mrg ef2e34874f pull out a few more things for GCC 9. 2020-09-05 09:49:32 +00:00
mrg 6df74746d4 port to GCC 9.3. 2020-09-05 09:16:46 +00:00
mrg d1531a5681 set MODULE to ${EXTERNAL_GCC_SUBDIR} so this actually works.. 2020-08-13 10:57:53 +00:00
mrg 802242f985 set _OUTDIRBASE depending on $0, and then set _OUTDIR based on this.
now you can copy mknative-gcc to mknative-gcc.old without edit.
2020-08-13 01:52:37 +00:00
mrg 5e4a6425f4 mknative-gcc is for GCC 8.4.
mknative-gcc.old is supposed to be for GCC 7, but is the GCC 6
version.  update it and mark it for GCC 7.5.
2020-08-12 08:53:20 +00:00
mrg 1956332deb update GCC 7 version to nb4 20200810, and fix the unknown GCC version
error assignment from "=?" to "?=" so it works as designed.
2020-08-11 09:51:57 +00:00
uwe dff8694dea Build mkubootimage for evbsh3 too. 2020-07-28 21:38:15 +00:00
rillig ff40d26ffb make(1): remove references to the removed lst.lib 2020-07-26 09:17:24 +00:00
uwe 3ed307aae1 Regen: Add AC_MSG_RESULT yes/no to the uio checks. 2020-06-24 14:44:44 +00:00