Commit Graph

2984 Commits

Author SHA1 Message Date
maxv 65ee926c5a Make kMSan compatible with KCOV. With kMSan we are forced to stay with the
fsanitize flag on subr_kcov.c, which means that kMSan will instrument KCOV.
We add a bunch of __nomsan attributes to reduce this instrumentation, but
it does not remove it completely. That's fine.
2019-11-15 09:44:44 +00:00
joerg 3cdbfa93d9 Restore pax-as-tar. 2019-11-13 22:32:16 +00:00
maxv b7edd3d132 Add Kernel Concurrency Sanitizer (kCSan) support. This sanitizer allows us
to detect race conditions at runtime. It is a variation of TSan that is
easy to implement and more suited to kernel internals, albeit theoretically
less precise than TSan's happens-before.

We do basically two things:

 - On every KCSAN_NACCESSES (=2000) memory accesses, we create a cell
   describing the access, and delay the calling CPU (10ms).

 - On all memory accesses, we verify if the memory we're reading/writing
   is referenced in a cell already.

The combination of the two means that, if for example cpu0 does a read that
is selected and cpu1 does a write at the same address, kCSan will fire,
because cpu1's write collides with cpu0's read cell.

The coverage of the instrumentation is the same as that of kASan. Also, the
code is organized in a way similar to kASan, so it is easy to add support
for more architectures than amd64. kCSan is compatible with KCOV.

Reviewed by Kamil.
2019-11-05 20:19:17 +00:00
martin 66ef6a30f0 PR misc/54657: let RELEASEMACHINEDIR default to ${MACHINE}-${MACHINE_ARCH}
for evb{arm,mips,sh3}*.
2019-10-31 06:43:19 +00:00
maxv a8c6c0bf54 Add nvmmctl, with two commands for now. 2019-10-28 13:04:18 +00:00
christos 20f77b55bf 1. All Makefiles that use ARM_APCS_FLAGS add -marm unconditionally and
bsd.own.mk also adds it for gcc only (so we end up with 2 -marm for gcc).
   Just add -marm unconditionally in bsd.own.mk in ARM_APCS_FLAGS and remove
   it from everywhere else.
2. gcc-8 now warns about thumb internetwork in APCS mode. This does not make
   sense because the documentation says that this flag does not make a
   difference in apcs mode, but might produce larger code in non-APCS mode.
   So we just add it to silence the warnings.
2019-10-24 18:46:20 +00:00
christos 78be1c9f56 move a{md,arch}64 to gcc 8 2019-10-22 13:49:30 +00:00
christos 0c7a7c13c0 Allow individual lex and yacc sources to override/extend LFLAGS and YFLAGS
respectively.
2019-10-15 15:05:00 +00:00
mrg 69f74cd544 make GCC_NO_STRINGOP_OVERFLOW apply to gcc 7 too. 2019-10-13 10:12:13 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
jhigh 0090dad153 added backend support for argon2 password scheme 2019-10-09 13:13:08 +00:00
uwe 0892295b90 Don't add -Wabi to CXXFLAGS for gcc 8. It warns about differences
from the most up-to-date ABI, which in gcc 8 is used by default.
XXX: This needs a better condition.
2019-10-05 18:37:39 +00:00
mrg 4be7da17b5 gcc 7 can now be found in gcc.old. 2019-09-29 22:10:55 +00:00
bad c296e4670d Also don't add a sysroot at all if a rumpkernel build. 2019-09-15 21:17:08 +00:00
maya 4bf438acf0 Allow overriding the default man substitutions with X11EXTRAMANTRANSFORMS 2019-09-13 10:23:07 +00:00
kamil 1a5f018b01 Enhance the support of LLVM sanitizers
Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.
2019-08-27 22:48:53 +00:00
mrg 1db21b1df3 fix MKCXX=no:
- don't build GDB
- don't build sanitizers
- don't build GCC commands
- fix some set lists
2019-08-23 08:17:26 +00:00
kamil 92253c7761 Add PAXCTL_FLAG rules for MKSANITIZER
Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>
2019-08-17 00:14:48 +00:00
kamil 0e6f677375 Add SANITIZER_RENAME_CLASSES in bsd.prog.mk
This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.
2019-08-15 08:42:59 +00:00
christos a3a94da6c9 Add a script to compare the library lists so we can keep them in sync easier. 2019-08-10 12:50:36 +00:00
christos 9b5a96cd27 Make the X11 library lists consistent again. 2019-08-10 12:46:38 +00:00
christos 806cddf3f2 Don't install PIC libraries by default because they are too big since they
contain debug symbols. I supplied a patch in PR/54449 to remove the debugging
symbols but folks preferred to not install them at all.
2019-08-10 12:20:17 +00:00
roy cb24add28c MKBSDTAR now defaults to yes
Starting to see some modern archives not opening, it's time to make them
work!

OK joerg@ agc@
2019-07-24 09:28:29 +00:00
mrg 9d9d771525 add util-macros src dir. 2019-07-20 20:25:35 +00:00
wiz c4e128da50 Install the nouveau gm206 firmware as used by my graphics card.
Also add the other gm20x nouveau firmwares to the source tree
to make it easier to add them for someone who can test them.

Installed if MKNOUVEAUFIRMWARE is set to 'yes'.
This defaults to no except on amd64 and i386 (like for radeon).
2019-07-20 19:09:21 +00:00
mrg f791ec1b3a break the build if a .pc generation leaves something matching "@.*@".
this is an error in the build that doesn't trigger issues until you
try to integrate with eg, pkgsrc.
2019-07-10 21:53:35 +00:00
hannken ce2428b9c3 When building a module keep symbols if built with "MKCTF" and "COPTS=-g". 2019-07-05 08:28:16 +00:00
mrg b436459a98 turn on MKLLVMRT for aarch64 X11 builds.
with llvmpipe vs swrast, on pinebook 1080p i see 6x speed up for glxgears,
seamonkey & google maps is significantly faster, and ksudoku is workable.
2019-06-11 04:52:44 +00:00
mrg 963bac2566 minor hack fix for the previous:
MKX11 is used before it was defaulted, leading to eg:

... Malformed conditional (${MKX11} != "no" && ${HAVE_MESA_VER} == "18")

gain knowledge that it defaults to "no" immediately below.
could split this list, but seems uglier.
2019-06-02 21:29:13 +00:00
mrg 047719ee02 fix building x86 with X11 but not LLVM:
- change the defaults for MKLLVMRT and MKX11 so we don't have to
  force-override later.  this makes "build.sh -V MKLLVMRT=no"
  work to disable building the LLVM Mesa components.

- in gallium, don't BUILD_RADEON if MKLLVMRT is no.

this stops GL from working, but basic X seems OK enough for Xvideo
to still work on modern radeon (ie, video mostly works fine, though
eg, "mpv -vo gpu" won't.  use "mpv -vo xv".)
2019-06-02 11:35:55 +00:00
mrg ac10ab4460 xorg-server 1.20.5 is now current. 2019-06-01 06:57:03 +00:00
christos 39d9abd938 Everyone is on gdb-8.3 now. 2019-05-30 21:33:57 +00:00
christos 61da06b1fb add vax to new gdb 2019-05-30 01:20:41 +00:00
christos 7bb3ca8936 move sparc* to new gdb. 2019-05-29 22:12:16 +00:00
christos a9359532ef Add i386 2019-05-29 18:19:03 +00:00
christos fb2b3c4056 amd64 switched to gdb-8.3 2019-05-29 01:57:59 +00:00
christos 70494b87c4 build gdb from gdb.old 2019-05-26 20:26:43 +00:00
kamil 7d75527c60 Allow to use KCOV + kASan together
Stop instrumenting KCOV files with kASan and the other way around.
This fixes booting of the setup of using them together.

In theory the checks could be more fine grained, however there is no good
reason (except extra DIAGNISTIC) for running a kernel sanitizer without
kernel coverage.

Patch by <R3x>
2019-05-22 08:31:25 +00:00
nakayama 43b52312c6 Use ${_TOOL_PREFIX} instead of hardcoding "nb" for consistency. 2019-05-17 13:51:36 +00:00
nakayama 0015932b89 Revert previous.
The binaries created are different, but according to joerg@ there
is no difference in functionality.
2019-05-17 13:44:55 +00:00
nakayama 95541573e2 Rename nb{clang,llvm}-tblgen to ${MACHINE_GNU_PLATFORM}-{clang,llvm}-tblgen
since they contain the default target (e.g. x86_64--netbsd).
2019-05-16 20:00:49 +00:00
christos 3dedd71659 Everyone is using gcc-7 now. 2019-05-11 02:40:31 +00:00
mrg 324b4eb87f add an entry to find upcoming intel-2014 driver. 2019-05-10 06:19:54 +00:00
maya e5523bd00e G/C unused code.
gcc -combine is no longer a thing, so this entire block isn't usable.
2019-05-09 23:34:51 +00:00
kamil 55506a14cd Fix typo cost -> host 2019-04-19 22:06:03 +00:00
mrg 660c4904e1 switch ia64 to GCC 7. scole@ commited a workaround for the one new problem.
this leaves ppc64 as the only GCC 6 port left.
2019-04-19 21:34:26 +00:00
mrg 6c9d474098 turn on MKCOMPAT for riscv64. 2019-04-18 20:11:57 +00:00
mrg 1ce78da3f1 enable EGL and glamor. partly from maya@.
for x86 and evbarm:
- install headers and libEGL
- install xorg-server glamoregl component
- link xorg drivers against gbm/egl

bonus fix:
- fix some wrongly marked compatx11file files


build tested on shark, sgimips, evbarm64-el, amd64 and i386.
run tested on radeon, intel and nvidia on amd64, including
'modesetting' driver on amd64.  however, my systems disable
it due to llvmpipe so i'm not sure what is happening.
2019-04-16 21:20:50 +00:00
maya 226aa51e27 Don't build compat libraries for riscv, for now. 2019-04-15 15:56:40 +00:00
christos ac84be3749 Add -r so that we get the location of redefinitions 2019-04-07 19:32:24 +00:00
maya 45fb16f000 Switch everyone to mesa 18. 2019-04-05 15:58:17 +00:00
maya a63f4c9283 Limit MKLLVMRT being enabled with MKX11 to x86. 2019-04-05 15:22:35 +00:00
maya a891433074 Frantically revert previous because of missing stuff 2019-04-05 15:11:31 +00:00
maya 6103ba0427 switch everyone to mesa 18. 2019-04-05 15:07:39 +00:00
mrg 36f30ad7ad switch hppa to GCC 7.
note vax atf fails same as GCC 6.  hppa mostly works but has an
atf issue also unrelated to the compiler version

note ia64 mostly builds, but the kernel fails earlier than GCC 6.
2019-04-04 21:31:28 +00:00
christos 5e8867daf8 vax "cough" works, with gcc-7 2019-04-03 21:41:21 +00:00
joerg b90b6db247 Use and enable MKLLVMRT for HAVE_MESA_VER=18. 2019-04-03 15:26:34 +00:00
joerg cf000f1761 Provide a default value of no for MKLLVMRT. 2019-04-03 15:23:29 +00:00
joerg 8e36148e18 Document MKLLVM. 2019-04-03 15:17:23 +00:00
joerg da48f03c8a Revert MKLLVMCMDS changes. 2019-04-03 15:12:44 +00:00
christos 9c552bddf4 re-enable jemalloc. 2019-03-28 15:45:23 +00:00
christos e11d722853 disable jemalloc again until we can figure out what to do with the bloat
for installer media.
2019-03-28 08:41:50 +00:00
christos 49cb7eb256 back to jemalloc for the masses 2019-03-27 18:41:18 +00:00
christos 8be7033514 undo previous, too much breaks. 2019-03-27 11:15:55 +00:00
christos a0f2b6a215 jemalloc for everyone! 2019-03-27 02:51:41 +00:00
martin ea3b107eb2 Switch sparc64 over to newer jemalloc. 2019-03-21 11:14:16 +00:00
mrg 18e2edb50a split MKLLVM into MKLLVM and MKLLVMCMDS, like MKGCC and MKGCCCMDS:
- only build clang or clang-tblgen if MKLLVMCMDS != "no"
- move HAVE_MESA_VER earlier so we can detect mesa 18 and enable
  MKLLVM on platforms that need it
- move the clang commands and headers into llvmcmds group
- only build the clang specific LLVM libraries if MKLLVMCMDS != "no"

much of this work came from maya@'s github commit
f90685c11d4460d3098fa35f48b58d1893e974e0, reworked for HAVE_MESA_VER
and llvmcmds vs MKCLANG.


build tested on several platforms and on amd64 and i386 with several
different build options (clang build, gcc build, gcc build with llvm
libs).
2019-03-20 22:51:37 +00:00
mrg d8f51e97eb install transset. 2019-03-11 09:20:13 +00:00
mrg 45a98ae559 fix a bunch of man page transforms.
XXX X11MANCPP=yes has only one use left, maybe it can go away!
2019-03-11 06:25:55 +00:00
mrg 47a40b7ad1 export HAVE_MESA_VER for use in makefiles and set lists. 2019-03-10 11:02:46 +00:00
mrg e3ecb7100d move mesa10 build into .old scheme:
- add ${X11SRCDIR.MesaLib.old} and introduce ${X11SRCDIR.Mesa} as an
  alias for either the former or the non old.  this allows many of
  the makefiles to simply use ${X11SRCDIR.Mesa} (but does not really
  enable much sharing of makefiles, but reduces their diffs.)

- use mesa-which.mk to define ${OLD_PREFIX} to either "" or ".old",
  and to know if to build 'dri7' (.old only.)  ${OLD_PREFIX} is used
  by other code (eg, LIBDPLIBS) to pick the right subdir.
2019-03-10 02:29:52 +00:00
christos 1d3883b194 Switch i386 and aarch64 to jemalloc (really I could switch everyone at this
point).
2019-03-09 17:59:28 +00:00
christos 6f80f650ef Back to using jemalloc for x86_64; all problems have been resolved. 2019-03-08 20:35:10 +00:00
christos dce236fdab Switch back amd64 to the old jemalloc. We have some pthread unit-tests
failing.
2019-03-04 21:19:58 +00:00
christos 78fb378311 switch amd64 to jemalloc-5.1.0 2019-03-04 17:32:46 +00:00
mrg 4e3bdd6e1c switch 32 bit arm, m68* and sh3 to GCC 7.
reverse the polarity now that few ports remain: hppa, vax, ia64 and ppc64
2019-03-04 01:14:31 +00:00
mrg 8fc8a45971 xorg-server 1.20.4 is now current. 2019-03-03 22:02:49 +00:00
kamil 0fe7e51662 Add KCOV - kernel code coverage tracing device
The KCOV driver implements collection of code coverage inside the kernel.
It can be enabled on a per process basis from userland, allowing the kernel
program counter to be collected during syscalls triggered by the same
process.

The device is oriented towards kernel fuzzers, in particular syzkaller.

Currently the only supported coverage type is -fsanitize-coverage=trace-pc.

The KCOV driver was initially developed in Linux. A driver based on the
same concept was then implemented in FreeBSD and OpenBSD.

Documentation is borrowed from OpenBSD and ATF tests from FreeBSD.

This patch has been prepared by Siddharth Muralee, improved by <maxv>
and polished by myself before importing into the mainline tree.

All ATF tests pass.
2019-02-23 03:10:05 +00:00
maya 53ba185d70 Use GCC 7 on riscv, it is not supported on 6. 2019-02-09 21:05:48 +00:00
mrg fccd79354b switch ppc64 back to gcc7, it was an accident. 2019-02-09 00:59:30 +00:00
mrg b4f3db3927 switch aarch64, alpha, i386, mips, powerpc, sparc, sparc64,
and x86_64 to GCC 7.
2019-02-08 09:35:00 +00:00
mrg 6c19d726c3 move OBJECT_FMTS setting after MKCOMPAT default, so it works.
should fix mips64 builds.
2019-02-06 11:05:30 +00:00
mrg 3deb71eabd re-do version 1.1098 properly:
- fix OBJECT_FMTS if mips64 and !MKCOMPAT
2019-02-05 04:47:59 +00:00
mrg d70ad97c73 revert previous for now. 2019-02-04 00:34:12 +00:00
mrg 82dcfee30d don't add elf64 to OBJECT_FMTS if !MKCOMPAT and mips64. 2019-02-04 00:06:14 +00:00
scole 9943d7ba24 don't disable MKRUMP by default for ia64 as it can at least build now 2019-01-30 22:51:33 +00:00
scole fff7694413 remove "MKLINT.ia64=no" as default is no anyway, and should compile on 64 bit host now 2019-01-29 19:40:42 +00:00
christos 0a4f449bbb Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.
2019-01-21 21:11:54 +00:00
mrg 0b4f44e237 obsolete gcc 5 support.
add gcc 7 support.  call it "nb1 20190119"
2019-01-19 12:58:37 +00:00
mrg c2d7307e84 add vboxvideo. 2019-01-09 23:52:29 +00:00
christos 9d350ea742 Since g++ uses stdc++_p when building with -pg make this PIC on the
platforms where PIC is available, so that linking shared objects with
-pg works, without needing to create a shared library version of the
profiled libraries.
2019-01-06 17:02:32 +00:00
mrg bf3711ce19 move some defines from xorg-server dix-config.h back into makefiles,
so that Xx68k can build.
2019-01-03 23:25:52 +00:00
christos e3d6da9917 Move x68k to the old xserver. It does not build with the new one (yet). 2019-01-03 17:41:26 +00:00
christos 136369eaff un-86'ed the ELF2AOUT variable. 2019-01-02 16:08:53 +00:00
christos b89d30df28 document the elf2foo tools.
The bsd.sys.mk tools are un-prefixed, since the "right" version is installed
for the platform, as opposed to the tools ones which should be able to
co-exist.
2019-01-01 19:06:38 +00:00
christos 454e070868 - prefix elf conversion tools with their platform to avoid conflicts
- add arm-elf2aout
2018-12-31 13:31:25 +00:00
mrg 9e0c936fbc updates for xorg-server 1.20. 2018-12-31 12:45:19 +00:00
mrg 66ee4e221d updates for xorg-server 1.20. don't define stuff here for it. 2018-12-31 11:19:58 +00:00
christos b652f9ee3b binutils 2.31 for everyone! 2018-12-30 17:32:43 +00:00
christos 0e4d8abb47 Back to 2.31 for x86! Hooray :-) 2018-12-27 16:27:29 +00:00
christos 5850b2d2cf Remove extra -c. -c has been the default behavior since 2003, and
the comment why it is needed was introduced in 2001. We don't want
to duplicate -c which is set in ${COPY} because someone might want
to override that.
2018-12-26 22:57:22 +00:00
christos 71a3521168 back to binutils 227: constructors in ifconfig are broken. 2018-12-25 00:35:26 +00:00
christos 12da137914 Switch x86 to binutils 2.31.1 2018-12-24 21:51:57 +00:00
christos 427a8eb2ae Head is binutils 2.31 2018-12-03 19:15:35 +00:00
maxv e5fadd7f81 Introduce KLEAK, a new feature that can detect kernel information leaks.
It works by tainting memory sources with marker values, letting the data
travel through the kernel, and scanning the kernel<->user frontier for
these marker values. Combined with compiler instrumentation and rotation
of the markers, it is able to yield relevant results with little effort.

We taint the pools and the stack, and scan copyout/copyoutstr. KLEAK is
supported on amd64 only for now, but it is not complicated to add more
architectures (just a matter of having the address of .text, and a stack
unwinder).

A userland tool is provided, that allows to execute a command in rounds
and monitor the leaks generated all the while.

KLEAK already detected directly 12 kernel info leaks, and prompted changes
that in total fixed 25+ leaks.

Based on an idea developed jointly with Thomas Barabosch (of Fraunhofer
FKIE).
2018-12-02 21:00:13 +00:00
aymeric 531981e6f3 Prepend ${_TOOL_PREFIX} to xz, too. 2018-11-19 20:00:28 +00:00
martin 34ccfcc91f Explicitly document the incompatibility between USE_PIGZGZIP
and USE_XZ_SETS. Disable the latter if the former is enabled.
2018-11-15 09:23:50 +00:00
christos 362645e71a disorder police 2018-11-11 18:02:23 +00:00
maya 259f19b882 Provide a fallback dtc if USE_TOOLS isn't in use.
From Daniel Loffgren in PR kern/53720.
2018-11-11 08:28:35 +00:00
maya 59ba550a49 Revert part of 1.1079. MKSOFTFLOAT?=yes for mips64*.
That is most likely an accidental commit.

PR port-mips/53719
2018-11-10 22:19:33 +00:00
macallan 32b6930bcb more Xorg on iyonix building goop 2018-11-10 01:40:46 +00:00
martin fed74b7300 Remove duplicate conditional assignment in previous - pointed out by wiz@ 2018-10-06 18:52:59 +00:00
martin 8775572996 Switch amd64, sparc64 and alpha to .tar.xz sets 2018-10-06 18:47:29 +00:00
martin 0249e79129 Add defaults and documentation for USE_XZ_SETS - a new variable
controlling whether an architecture will use .tgz or tar.xz
sets.
2018-09-29 06:48:22 +00:00
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
joerg fcd11b5060 Don't assume that EXTERNAL_TOOLCHAIN is gcc. HAVE_GCC can and should be
defined appropiately if it is an external GCC.
2018-05-09 21:26:59 +00:00
joerg 301645f026 Always provide --sysroot arguments, even for EXTERNAL_TOOLCHAIN. 2018-05-09 13:19:27 +00:00
joerg cb77297a09 Drop checks for EXTERNAL_TOOLCHAIN for crt*.o. We've been using our own
versions for a long time and haven't relied on external files as such.
2018-05-09 13:18:53 +00:00
nisimura fbd74c24e3 remove duplicated cobalt in MACHINES.mips= line. 2018-05-04 20:25:04 +00:00
christos ee08ce7d85 include bsd.hostinit.mk instead of bsd.init.mk 2018-05-04 14:50:40 +00:00
christos bf7113376a Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
2018-05-01 19:59:42 +00:00
christos c063173b65 PR/53209: David Shao: lang/llvm BFD (NetBSD Binutils nb1) 2.30 assertion fail elflink.c:2824
switch x86 back to old binutils until it is fixed.
(also non pie binaries have broken relocs)
2018-04-24 23:29:13 +00:00
christos 92bd81c604 switch x86 to binutils-2.30 2018-04-15 20:08:13 +00:00
christos d55a1f07c7 switch everyone to binutils.old 2018-04-14 23:14:12 +00:00
mrg 1b91b9705d switch vax to GCC 6. thanks to Krister and Maya for the fixes.
it now appears as disfunctional as GCC 5 for vax.  ok ragge@.

this was the final GCC 5 platform in -current.  hooray!
2018-04-07 21:38:30 +00:00
mrg ffba61a5f0 switch m68000 and m68k to GCC 6. ok mlelstv. 2018-04-05 22:38:58 +00:00
ryo fe33aa2786 Add initial support for ARMv8 (AARCH64) (by nisimura@ and ryo@)
- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@, jmcneill@)
2018-04-01 04:35:01 +00:00
kamil 9ad30f3b4d Drop the USE_LIBTRE build option
libtre cannot be used any more as a replacement for regex(3).
Tt does not build and the library development is stalled in upstream.

Proposed on mailing list.

Sponsored by <The NetBSD Foundation>
2018-03-31 14:24:54 +00:00
christos 21dde3b595 Don't barf if the ctf tools are not installed.
[perhaps warn?]
2018-03-15 13:44:45 +00:00
mrg 5ae6500fa6 complete the switch to xorgproto over *proto split packages
- remove old package makefiles
- update makekeys for Xfuncproto.h being a real file now
- clean up deleted package X11SRCDIR.pkg settings

this should be functionally equivalent.
2018-03-14 23:41:05 +00:00
mrg 7e4cdcfd86 add xorgproto srcdir. 2018-03-14 07:35:56 +00:00
mrg 12fffe5478 define LIBXFONT2. 2018-03-11 09:56:44 +00:00
mrg 6e5b391377 stop building libXfontcache as it is obsolete for a decade. 2018-03-11 07:18:49 +00:00
christos 3b0596539e everyone switched to openssl-1.1 2018-03-09 12:58:59 +00:00
christos 7d278c3d47 switch everyone but vax to OpenSSL1.1. 2018-03-05 21:14:34 +00:00
mrg 589a0b0fde switch sh3 to GCC 6. tested on landisk in emul and hardware.
actually do this by reversing the check to look for m68* and vax
to choose GCC 5, and otherwise default to GCC 6.
2018-03-05 09:17:42 +00:00
mrg 5b6553d1f0 switch arm ports to GCC 6.
this is the last GCC that will support these ports:
- epoc32
- netwinder
- shark
- acorn32
- cats
- most hpcarm systems (only NETBOOKPRO and WZERO3 remain)
2018-03-05 08:08:06 +00:00
mrg ae1f25356d swtich ia64 to GCC 6. 2018-03-05 07:03:27 +00:00
christos edf420ad0b switch ppc to OpenSSL-1.1, use MACHINE_CPU consistently. 2018-03-05 00:24:01 +00:00
christos be5fb36d0b last I checked powerpc64 was 64 bits, so it needs _XSERVER64.. 2018-03-04 23:47:55 +00:00
mrg 53585d3968 switch powerpc, mips and arm ports to GCC 6.
all kernels that build with gcc 5 still build.
several platforms tested in emulators and real hardware.
2018-03-04 22:47:49 +00:00
christos 004b7cf33b switch sh3 to openssl-1.1 2018-03-04 00:17:05 +00:00
christos 5566d6284a switch arm to openssl-1.1 2018-03-03 00:22:04 +00:00
snj 28c97c06b5 remove mention of /usr/X11R6 2018-03-01 06:34:23 +00:00
martin a253d8fa7f Switch sparc over to openssl 1.1 again - thanks to christos for fixing it! 2018-02-26 12:26:24 +00:00
chs 3084abc1e1 add DTRACE_OPTS and HOST_DTRACE_OPTS to allow disabling various optimizations
that interfere with using dtrace.  use them when MKDTRACE=yes.
2018-02-25 18:53:23 +00:00
mrg 2e19323388 add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk.  use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.
2018-02-25 00:16:48 +00:00
skrll 366599d113 Switch hppa to gcc 6.4 2018-02-23 21:16:01 +00:00
martin 32bba72871 Switch sparc back to old openssl - needs more work and testing. 2018-02-20 12:49:40 +00:00
christos 01b941a695 switch sparc to openssl-1.1 2018-02-19 20:52:09 +00:00
mrg 9e8cffe5e6 switch i386, sparc and sparc64 to GCC 6. 2018-02-17 21:46:15 +00:00