Commit Graph

2720 Commits

Author SHA1 Message Date
christos 4cc871c9e6 add what {PROG,LIB}DPLIBS are useful for 2018-09-16 13:14:12 +00:00
christos f111c8bc02 document PROGDPLIBS 2018-09-16 13:11:48 +00:00
mrg 51f05bcba3 flip all ports to gcc.old GCC 6.4. 2018-09-05 06:54:29 +00:00
christos d2abb1c68b remove random seed debugging 2018-08-13 13:07:04 +00:00
maya 2ae43603e5 Try the more likely gfortran instead of g77.
g77 has likely not shipped as a binary in a long time.

No change for netbsd src as it has no fortran code, no change for pkgsrc
because it passes ${FC} for fortran packages.
2018-08-12 18:36:27 +00:00
christos 9b2c7d6541 fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)
2018-08-12 11:50:51 +00:00
christos c041076daa use the tools version of grep 2018-08-11 19:45:13 +00:00
kamil fba8a24fab Allow to overwrite sanitizer flags for userland
Always define -fsanitize=${USE_SANITIZER} and
-fsanitize=${USE_LIBCSANITIZER} before other flags defined with
SANITIZERFLAGS and LIBCSANITIZERFLAGS.

This allows to overwrite rules that are parsed from left to right.
With the current approach it wasn't possible to disable some checks, as
they were reenabled again by the "-fsanitize=" argument.
2018-08-03 02:34:31 +00:00
kamil 031cfa7ff2 Introduce MKLIBCSANITIZER in the share/mk rules
Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.
2018-07-25 23:34:25 +00:00
kamil 1627bb37cd Document MKLIBCSANITIZER in bsd.README
It's a special kind of a sanitizer inside libc.
2018-07-25 23:30:22 +00:00
kamil 7ceb5bef90 Document the default value of MKSANITIZER in bsd.README
This value is set to "no".
2018-07-25 19:15:19 +00:00
christos d3592465e7 Remove special-casing of aarch64 now that gcc works (switch aarch64 to gcc) 2018-07-18 02:18:45 +00:00
christos 8a7979c6af Let's build gdb for aarch64. 2018-07-17 18:04:57 +00:00
christos 5d801a95bf Everyone has gcc-6 now. 2018-07-16 14:14:37 +00:00
maya 03cb1cb41c Update comment to match what the below text does
(This logic needs to go into gcc config files, but removing it
requires mknative)
2018-07-14 22:57:47 +00:00
joerg 264e1c0dc8 Update MKSTATICPIE entry to actually do something. 2018-07-12 21:41:25 +00:00
maxv 62c8988166 Remove the kernel PMC code. Sent yesterday on tech-kern@.
This change:

 * Removes "options PERFCTRS", the associated includes, and the associated
   ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
   good.

 * Removes the PMC code of ARM XSCALE.

 * Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

 * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
   definitions are put in sysarch.h.

 * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
   and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
   netbsd32 and rump.

 * Removes the pmc_evid_t and pmc_ctr_t types.

 * Removes all the associated man pages. The sets are marked as obsolete.
2018-07-12 10:46:40 +00:00
maxv 18f65af8ea Retire libpmc. It uses the legacy PMC interface in the kernel, which has
support for only one ARM CPU. It used to have x86 support, but it was broken
and I removed it. The legacy PMC interface will be removed from the kernel
too. Sent on tech-kern@ yesterday, thorpej was fine.
2018-07-12 06:52:48 +00:00
christos 8e0030187e Back to always using just the list of sources for the hash. Hopefully this
is reproducible now.
2018-07-10 23:25:27 +00:00
christos 305c0f0c67 Build seed fixes:
- use MKREPRO_TIMESTAMP as the seed if available.
    - skip relative paths that cannot be normalized if it is not
XXX: pullup-8
2018-07-10 16:53:16 +00:00
martin 6f60556b4a Debug hack: print out full random-seed for C++ compile/link. 2018-07-09 09:22:55 +00:00
kamil eb682ff828 Add a framework for renaming symbols in libc&co for MKSANITIZER
A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>
2018-06-25 17:58:36 +00:00
kamil ef7aae126a Rephrase the documentation of MKSANITIZER
Based on the feedback from <f8l> and <pgoyette>.
2018-06-25 09:38:46 +00:00
kamil 7d11bff33f Enhance the documentation of MKSANITIZER in bsd.README
Note that the list of sanitizer features is just a selection, not a
complete list. Include there LSan and Scudo. Missing: hwmsan, esan,
ubsan_minimal etc.

Explain that USE_SANITIZER is an argument passed to -fsanitize= and it can
contain multiple options.

Mention SANITIZERFLAGS to pass even more sanitizer arguments.

Stop tracking in this file what compiler compiles what features. Just note
that the selection of supported features depends on a compiler version and
target CPU architecture.
2018-06-24 20:40:58 +00:00
kamil 07c0d23991 Reset SANITIZERFLAGS when specified NOSANITIZER / MKSANITIZER=no
This allows passing additional sanitizer specifig flags from the ./build.sh
level, like: -V SANITIZERFLAGS="-fsanitize-memory-track-origins" for MSan.
2018-06-24 19:35:12 +00:00
christos bb417bce75 - Fix groff reproducibility:
- specify mdoc and font paths
    - clear encoding
    - specify pagesize on the command line
XXX: pullup-8
2018-06-22 17:31:24 +00:00
maya 538feb9de7 Add comment describing why we remove -Wsystem-headers, requested by mrg. 2018-06-22 11:25:03 +00:00
kamil 64a497de12 Refactor MKSANITIZER flags in mk rules
Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.
2018-06-21 11:24:38 +00:00
maya c017cf6e31 Strip -Wsystem-headers from CXXFLAGS.
GCC's C++ headers are not clean (yet). They are trying, but haven't got there
yet.

Necessary for including <atf-c++.hpp> which uses <sstream>.
2018-06-20 02:15:13 +00:00
christos d8a64f1e46 The compat build plays games with MAKEOBJDIR and unsets MAKEOBJDIRPREFIX.
Keep using our standard NETBSDOBJDIR if it was set.
2018-06-17 23:37:22 +00:00
mrg 86fb244de3 check MK{FOO} defaults for $MACHINE as well as $MACHINE_ARCH.
should restore firmware files for some platforms that were
missing them.
2018-06-16 19:05:17 +00:00
christos 15a5ffcf6f Create NETBSDOBJDIR to handle MAKEOBJDIRPREFIX, since that prepends the
prefix to the whole path.
Mention that we cannot handle MAKEOBJDIR
2018-06-13 15:46:26 +00:00
christos d58777d134 Handle more objdir variations for MKREPRO (untested) 2018-06-11 01:34:03 +00:00
christos 2357fc5dd5 use SUBDIR.roff suggested by uwe@ 2018-06-10 17:55:11 +00:00
kamil e153ab384c Fix the MKGROFF=no MKCXX=yes build
Allow to disable building groff. This is a build tool written in C++.

This option is useful with an external toolchain configured for building the
distribution rather than building tools (e.g. C++ lookup paths may differ).

Looks ok by <christos>

Sponsored by <The NetBSD Foundation>
2018-06-10 17:17:46 +00:00
christos 56e6b77faa Elide -nostdinc from LINK.c when linking object files since clang complains
about unused argument. Note that we can't remove CPPFLAGS from LINK.c because
it is used in the "shuttle rules" (from .c to executable).
2018-06-05 15:37:52 +00:00
christos 4cb6d5fb56 Add rules for building relocatable objects to avoid having random Makefiles
use ${LD} ${LDFLAGS} -r which does not work if we specify MKRELRO since
LDFLAGS is supposed to be passed to LINK.c not LD directly (although some
of the flags work).
2018-06-05 00:56:51 +00:00
wiz 75813253f0 Fix MKFIRMWARE description. 2018-06-03 04:41:04 +00:00
wiz c6684071f4 Fix MKSANITIZER default in description. 2018-06-03 04:38:12 +00:00
christos d0972049fa Sanitizers don't support static linking. 2018-06-02 15:19:45 +00:00
christos 2ca450f684 Add NORELRO 2018-06-02 14:30:35 +00:00
christos 622b8981a7 Move the RELRO and the SANITIZER stuff outside of the WARNS conditional! 2018-06-02 03:02:30 +00:00
christos 0b98ca727d Add build glue to build all the code with sanitizers: MKSANITIZE. 2018-06-02 01:41:49 +00:00
mrg a37025c593 introduce MKFIRMWARE that controls where (most) of the contents
of /libdata/firmware and /usr/libdata/firmware are not installed
if set to "no".  from the bsd.README:

MKFIRMWARE      If "no", install the /libdata/firmware directory,
		which is necessary for several drivers: athn(4), bwfm(4),
		ipw(4), iwi(4), iwm(4), iwn(4), otus(4), rtwn(4), urtwn(4),
		wpi(4), ral(4), rum(4), run(4), zyd(4), bcm43xx(4), and
		the Tegra 124 SoC.
		Default: yes on amd64, cobalt, evbarm evbmips, evbppc, hpcarm,
		hppa, i386, mac68k, macppc, sandpoint, and sparc64, no elsewhere.

convert MKRADEONFIRMWARE and MKTEGRAFIRMWARE into FOO.arch lists,
and move their defaults above the general defaults setting.

saves about 12MB in a normal installation for other platforms.
2018-05-31 05:27:45 +00:00
christos 1320cca746 install bsd.hostinit.mk 2018-05-28 13:21:50 +00:00
christos 5729151aad Be more selective about remapping object directories otherwise we pick
objdump and objcopy with the regex.

XXX: pullup-8
2018-05-24 02:06:31 +00:00
christos 0ff9c30a3a Also substitute ${X11SRCDIR} for the random seed for reproducible builds so
that the random seed is consistent.
XXX: pullup-8
2018-05-20 14:39:53 +00:00
christos 69e74e4309 Need to delete ${DESTDIR} for lint
XXX: pullup-8
2018-05-19 17:44:44 +00:00
christos 144dde66b8 Prevent 'make obj' creating an objdir inside an objdir. This happens the
second time we call 'make obj' in /usr/src/rescue with MAKEOBJDIR set.
XXX: pullup-8
2018-05-19 14:11:30 +00:00
joerg dd4097f61f Document that EXTERNAL_TOOLCHAIN should be used together with HAVE_GCC
or HAVE_LLVM.
2018-05-09 22:24:01 +00:00