Commit Graph

3406 Commits

Author SHA1 Message Date
Dimitry Andric
7b5814e175 Work around two -Werror warning issues in googletest, which have been
solved upstream in the mean time.

The first issue is because one of googletest's generated headers contain
classes with a user-declared copy assignment operator, but rely on the
generation by the compiler of an implicit copy constructor, which is now
deprecated:

/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-param-util-generated.h:5284:8: error: definition of implicit copy constructor for 'CartesianProductHolder3<testing::internal::ParamGenerator<bool>, testing::internal::ValueArray3<int, int, int>, testing::internal::ValueArray4<cache_mode, cache_mode, cache_mode, cache_mode> >' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  void operator=(const CartesianProductHolder3& other);
       ^
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/gtest-param-test.h:1277:10: note: in implicit copy constructor for 'testing::internal::CartesianProductHolder3<testing::internal::ParamGenerator<bool>, testing::internal::ValueArray3<int, int, int>, testing::internal::ValueArray4<cache_mode, cache_mode, cache_mode, cache_mode> >' first required here
  return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
         ^
/usr/src/tests/sys/fs/fusefs/io.cc:534:2: note: in instantiation of function template specialization 'testing::Combine<testing::internal::ParamGenerator<bool>, testing::internal::ValueArray3<int, int, int>, testing::internal::ValueArray4<cache_mode, cache_mode, cache_mode, cache_mode> >' requested here
        Combine(Bool(),                                 /* async read */
        ^

For now, silence the warning using -Wno-deprecated-copy.

The second issue is because one of the googlemock test programs attempts
to use "unsigned wchar_t" and "signed wchar_t", which are non-standard
and at best, hazily defined:

contrib/googletest/googlemock/test/gmock-actions_test.cc:111:37: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar]
  EXPECT_EQ(0U, BuiltInDefaultValue<unsigned wchar_t>::Get());
                                    ^
contrib/googletest/googlemock/test/gmock-actions_test.cc:112:36: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar]
  EXPECT_EQ(0, BuiltInDefaultValue<signed wchar_t>::Get());
                                   ^

For now, silence the warning using -Wno-signed-unsigned-wchar.

MFC after:	3 days
2020-01-31 18:26:23 +00:00
Alex Richardson
d2c32def56 Build hard-float lib32 for mips64hf/mips64elhf
This should fix linker errors when building with clang+lld.
After this change the lib32 compat libraries are now buildt with
-mhard-float instead of -msoft-float

Reviewed By:	brooks, jhb
Differential Revision: https://reviews.freebsd.org/D23229
2020-01-27 12:02:47 +00:00
Ed Maste
9d0e1b8a20 src.opts.mk: default BINUTILS_BOOTSTRAP to NO except for x86 and powerpc
x86 needs bootstrap GNU as for assembling a few files, and powerpc needs
GNU ld.bfd for linking 32-bit objects.  All other targets either fully
use in-tree Clang and lld, or rely on external toolchain.

Sponsored by:	The FreeBSD Foundation
2020-01-19 19:56:05 +00:00
Ed Maste
df502acc73 src.opts.mk: force DMAGENT off under WITHOUT_OPENSSL
dma(8) depends on OpenSSL unconditionally.

Reported by:	Michael Dexter's Build Options Survey run
MFC after:	1 weeks
Sponsored by:	The FreeBSD Foundation
2020-01-17 17:53:13 +00:00
Bryan Drewery
844939d743 META_MODE: Allow 'make all install' to work with filemon.
Filemon will add the ability to ignore the cookie if the installed file is
missing. Without filemon that's not possible though so if the cookie is present
an the command unchanged then the install wouldn't run.

Sponsored by:	DellEMC
MFC after:	2 weeks
2020-01-17 14:29:27 +00:00
Ed Maste
f112a185b1 pkgbase: move profiling _p.a libs into -development packages
Profiling library archives are part of the development environment; they
don't need to be in separate -profile packages.

(In fact we can probably just eliminate the _p.a archives assuming that
profiling will be done using hwpmc etc., but that is a change for later.)

Discussed with:	bapt, manu
Sponsored by:	The FreeBSD Foundation
2020-01-16 17:27:08 +00:00
Kyle Evans
4b50c45172 Revert r353140: Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around
arichardson has an actual fix for the same issue that this was working
around; given that we don't build with llvm today, go ahead and revert the
workaround in advance.
2020-01-14 17:50:13 +00:00
Ed Maste
0ce9d0af5b src.opts.mk: force KERBEROS_SUPPORT off where KERBEROS forced off
Explicitly setting WITHOUT_KERBEROS implies WITHOUT_KERBEROS_SUPPORT,
but previously other cases that forced KERBEROS off (such as
WITHOUT_CRYPT) did not also set KERBEROS_SUPPORT off.  Because the
_SUPPORT dependent options (KERBEROS/KERBEROS_SUPPORT) are processed
before other dependencies (CRYPT/KERBEROS) it's not easy to make this
happen automatically.  Instead just explicitly set KERBEROS_SUPPORT
off where we set KERBEROS off.

Reported by:	Michael Dexter's Build Option Survey run
2020-01-10 22:00:39 +00:00
Jung-uk Kim
4c8095b1d5 Catch up with Clang 9.0. 2020-01-09 20:07:38 +00:00
Warner Losh
dea247463c Add note to remind me there are three choices for arm32 floating point.
hard	use floating point hardware, pass registers to functions in
	floating point registers.
softfp	use floating point hardware, but pass registers to functions
	in integer registers.
soft	do floating point calcuations without using floating point
	hardware. Pass arguments in integer registers.

FreeBSD 11 and newer assumes hard. 10 and earlier assumed softfp.  We have no
real support, at the moment, for soft. It's untested, though, if softfp still
works.

Add a note here since this is a whack-a-doodle combination relative to all other
platforms.

softfp is likely to go away in the future because it was retained for people
using FreeBSD 10 + armv6 needing to transition more slowly from softfp -> hard
than the project. It likely is no longer needed, and may be getting in the
way of people needing 'soft' support.
2020-01-09 18:14:48 +00:00
Ed Maste
f8c319da66 Revert r356515 - add LLVM_LIBUNWIND back to sparc64 BROKEN_OPTIONS
r356552 reverted the untested build fix for LLVM libunwind on sparc64,
so mark it broken again.
2020-01-09 14:12:57 +00:00
Ed Maste
3b957e38ef src.opts.mk: Remove sparc64 LLVM_LIBUNWIND BROKEN_OPTIONS
After r356513 it should build.
2020-01-08 20:51:07 +00:00
Ed Maste
b05bd0b93b src.opts.mk: enable LLVM_UNWIND by default for all archs
Only sparc64 did not enable LLVM_LIBUNWIND. After r356513 LLVM_LIBUNWIND
should at least build on sparc64. The old DWARF unwinder will be removed
along with GCC 4.2.1 in the near future, so switch sparc64 to use LLVM's
unwinder in advance of the removal.  Someone with access to the obsolete
sparc64 hardware supported by FreeBSD will have to test, and investigate
any failures. I will gladly help, but I don't have any suitable hardware
myself.

PR:		233405
2020-01-08 20:45:18 +00:00
John Baldwin
79f5991559 Add -mno-relax to CFLAGS in bsd.prog/lib.mk instead of bsd.cpu.mk.
bsd.cpu.mk is included by bsd.init.mk before bsd.linker.mk, so it
was always setting the flag since LINKER_FEATURES wasn't defined.

Reported by:	mhorne
Reviewed by:	imp, mhorne
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23076
2020-01-08 17:49:34 +00:00
John Baldwin
e48503fffd Use clang and lld as the default toolchain for RISCV.
- Enable clang and lld as system toolchains.
- Don't use external GCC for universe by default.
- Re-enable riscv64sf since it builds fine with clang + lld.

Reviewed by:	emaste, mhorne
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23089
2020-01-08 17:25:59 +00:00
Michal Meloun
2138e99bf5 Switch 32-bit arm back to LLVM libunwind.
Actual LLVM libunwind passed all testing without issues, switch back to it.

PR:	233664
2020-01-08 07:25:37 +00:00
Kyle Evans
d679c71970 Refine fusefs test workaround for mips+llvm
This re-enables building the googletest suite by default on mips and instead
specifically doesn't build fusefs tests for mips+clang builds.  clang will
easily spent >= 1.5 hours compiling a single file due to a bug in
optimization (see LLVM PR 43263), so turn these off for now while that's
hashed out.

GCC builds are unaffected and build the fusefs tests as-is. Clang builds
only happen by early adopters attempting to hash out the remaining issues.

The comment has been updated to reflect its new position and use less strong
wording about imposing on people.

Discussed with:	ngie, asomers
Reviewed by:	ngie
2020-01-06 18:25:58 +00:00
Ed Maste
6eb84c961a src.opts.mk: disable BINUTILS_BOOTSTRAP on all mips* and sparc64
Extend r356379 to include 32-bit mips and sparc64.  Using a decade-old
binutils linker with a contemporary compiler (either Clang or GCC) is
a combination unlikely to be used by anyone else, and it's not going
to be a good use of our time investigating and addressing any issues
that arise.  Expect that all architectures newly migrated to external
GCC will also use external binutils.
2020-01-05 18:01:15 +00:00
Ed Maste
a69473e38c src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64*
After GCC was disabled by default in r356367, mips and sparc64 started
relying external GCC.  However, the in-tree Binutils ld 2.17.50 is not
compatible with GCC for some mips64 targets, so turn off
BINUTILS_BOOTSTRAP and rely on external binutils (linker) as well.
2020-01-05 16:59:24 +00:00
Ed Maste
5a0a85974a Do not build GCC 4.2.1 by default for any CPU architecture
By default set to NO:

GCC
GCC_BOOTSTRAP
GNUCXX

As described by imp@ on the freebsd-arch mailing list Aug 13, 2019 with
Subject: Gcc 4.2.1 to be removed before FreeBSD 13, a firm timeline
https://lists.freebsd.org/pipermail/freebsd-arch/2019-August/019674.html

Reviewed by:	jhb, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23026
2020-01-05 02:47:56 +00:00
Kyle Evans
cd0d51baaa Provide libssp based on libc
For libssp.so, rebuild stack_protector.c with FORTIFY_SOURCE stubs that just
abort built into it.

For libssp_nonshared.a, steal stack_protector_compat.c from
^/lib/libc/secure and massage it to maintain that __stack_chk_fail_local
is a hidden symbol.

libssp is now built unconditionally regardless of {WITH,WITHOUT}_SSP in the
build environment, and the gcclibs version has been disconnected from the
build in favor of this one.

PR:		242950 (exp-run)
Reviewed by:	kib, emaste, pfg, Oliver Pinter (earlier version)
Also discussed with:	kan
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D22943
2020-01-04 20:19:25 +00:00
John Baldwin
64a3ba61a5 Set correct lib32 MACHINE_ARCH for mips64el*.
Use "mipsel" instead of "mips" as the 32-bit MACHINE_ARCH when
building lib32 for little-endian 64-bit MIPS targets.  This fixes an
error where some objects were compiled as LE and others compiled as BE
causing a link error for rtld32.

Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23028
2020-01-03 23:31:38 +00:00
Ed Maste
b4f20f20d5 src.opts.mk: SVNLITE requires FILE
Reported by:	Build Options Survey run by Michael Dexter
2020-01-03 18:20:03 +00:00
Ed Maste
9ed13baa5e src.opts.mk: GOOGLETEST requires CXX
Reported by:	Build Options Survey run by Michael Dexter
2020-01-03 18:11:55 +00:00
Ed Maste
78a576cbe8 src.opts.mk: switch LLD_BOOTSTRAP and LLD_IS_LD to opt-out
More MACHINE_CPUARCH/MACHINE_ARCH cases enable these options than
disable them, and several of them have work in progress to switch over.
Thus, invert the sense of the test and list cases not using LLD as the
exceptions.
2020-01-03 16:28:10 +00:00
Ed Maste
4ad9b9fa8e src.opts.mk: simplify after arm/arm retirement
There were a few special cases for arm v5, such as disabling LLDB due to
the lack of 64-bit atomic operations.  Now that arm has been retired (as
of r356263) we can simplify the options logic somewhat.
2020-01-03 16:06:41 +00:00
Ed Maste
cb9da00eb7 Switch GPL_DTC to default off
We use the BSDL devicetree compiler as long as we have a C++11 compiler.
dtc is not needed as a build tool on the platforms that are still using
GCC 4.2.1 (and it is being disabled very soon, anyhow).

Discussed with:	imp, kevans
2019-12-27 16:59:26 +00:00
Ed Maste
d3a549991a src.opts.mk: switch LLVM_LIBUNWIND to opt-out
PowerPC switched to LLVM_LIBUNWIND along with the switch to Clang/LLVM
in r356111.  This leaves only 32-bit Arm and sparc64 not using LLVM's
unwinder, so switch the sense to opt-out.

I elected to list the individual arm MACHINE_ARCHs so future changes
are more clear if LLVM_LIBUNWIND is enabled for one or two but not all
32-bit Arm targets (see PR 233664).
2019-12-27 16:28:43 +00:00
Ed Maste
897dc64400 src.opts.mk: switch LLVM toolchain to opt-out
After PowerPC switched in r356111, the list of targets using LLVM as the
default toolchain is much longer than those not using it.  Switch the
sense of the test to exclude those not using LLVM.

Targets not using LLVM is currently mips, riscv5, and sparc64; work is
in progress to migrate the first two to LLVM.
2019-12-27 15:47:32 +00:00
Justin Hibbits
678da4a274 Use LLVM as default toolchain for all PowerPC targets
This enables LLVM as the default compiler for powerpc, powerpc64, and
powerpcspe, as well as LLD as the default linker for powerpc64.

LLD is not yet ready for prime time for powerpc and powerpcspe, but work is
continuing on it.

Submitted by:	alfredo.junior_eldorado.org.br
Relnotes:	YES
Differential Revision:	https://reviews.freebsd.org/D20378
2019-12-27 03:54:27 +00:00
Justin Hibbits
b451cd4544 [PowerPC64] Use ld.bfd to build LIB32 and STAND - when using llvm
Summary:
This patch is to support ongoing work for replacing "GCC/BFD" by "CLANG/LLD" on
target PowerPC64 [1], by proposing a way to specify and/or locate a secondary
ld.bfd linker.
This is necessary as LLD currently doesn't support PowerPC 32 bits, so we keep
using BFD for the 32 bit stuff on PowePC64(LIB32 compatibility and
STAND/slof/loader.)

- creates LD_BFD variable pointing to ld.bfd
- use LD_BFD as linker for LIB32/compat
- Default behavior for other platforms aren't changed.

[1] https://wiki.freebsd.org/powerpc/llvm-elfv2

Submitted by:	alfredo.junior_eldorado.org.br
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D20261
2019-12-24 16:03:33 +00:00
Ryan Libby
fc41af14c8 gcc9: quiet Waddress-of-packed-member for user build
Disable the warning for WARNS <= 3.  This is lame, but it's what we
already do for the clang build.

Reviewed by:	dim
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D22889
2019-12-21 02:43:49 +00:00
Ed Maste
37516d3b1b add LDNS build knob dependency on OPENSSL
Reported by:	Michael Dexter's run of the Build Options Survey
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-12-20 20:23:59 +00:00
Dimitry Andric
0b57cec536 Move all sources from the llvm project into contrib/llvm-project.
This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo".  That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.
2019-12-20 19:53:05 +00:00
Simon J. Gerraty
b114e8fcd7 Tweaks for DIRDEPS_BUILD
libmagic only depend on mkmagic if not DIRDEPS_BUILD

libpmc fix -I for libpmcstat

local.dirdeps.mk be even more careful about adding gnu/lib/csu to DIRDEPS

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D22872
2019-12-19 02:40:04 +00:00
Conrad Meyer
5fa85bcd67 Revert r354348
Switch ARM32 default libunwind back to old GPL2 libgcc version.  Reportedly,
the llvm-libunwind code is nonfunctional.

Requested by:	mmel
2019-12-12 04:47:02 +00:00
Simon J. Gerraty
312809fe7f Update dirdeps.mk and gendirdeps.mk
The env space consumed by exporting all libc's .meta files
left little room for command line,
so unexport when done.

Update dirdeps.mk to latest and add
dirdeps-targets.mk to simplify/update targets/Makefile

Makefile changes to go with Makefile.depend changes in D22494

Reviewed by:	 bdrewery
MFC after:	1 week
Sponsored by:   Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22495
2019-12-11 17:38:15 +00:00
Bryan Drewery
96aaefdf55 Fix WITHOUT_CLANG build.
This decouples MK_LLVM_TARGET_ALL from MK_CLANG. It is fine if
LLVM_TARGET_* are set even if MK_CLANG is disabled. It never
made sense to depend MK_LLVM_TARGET_* to MK_CLANG (which I did
in r335706).

PR:	        240507
Reported by:	kevans, swills
MFC after:	2 weeks
2019-12-10 18:50:50 +00:00
Alex Richardson
2719bb7ebb Use ${.ALLSRC:Ninstalldirs-*} instead of assuming order of .ALLSRC
This is a follow-up to https://reviews.freebsd.org/D22382

Suggested By:	sjg
2019-12-10 12:12:48 +00:00
John Baldwin
0869dceb9d Add a new "riscv-relaxations" linker feature.
When the linker doesn't have this feature, add -mno-relax to CFLAGS
on RISC-V.

Define the feature for ld.bfd, but not lld.  If lld gains relaxation
support in a newer version, we can enable it for those versions of lld
in bsd.linker.mk.

Reviewed by:	mhorne
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D22659
2019-12-05 19:37:30 +00:00
Ed Maste
678898a2b6 update comment (about llvm target config) to match r355095 2019-11-25 18:27:02 +00:00
Ed Maste
d5b068fcea remove armv6 LLVM workaround introduced in r341812
r341812 enabled only arm target support in LLVM on arm and armv6,
because ld.bfd 2.17.50 lacked support for range extensions required for
linking such large binaries/libraries.  r341812 indicated that the
workaround should be removed once the userland can be linked by lld.

r354289 switched armv6 to use lld by default, so remove the workaround
on armv6.  The workaround remains in place for arm (v5), and will
presumably be removed when arm is retired.

Sponsored by:	The FreeBSD Foundation
2019-11-25 18:18:28 +00:00
Brooks Davis
edb0ec001e Revert r354909: Make the warning for deprecated NO_ variables an error.
An unexpectidly large number of ports define NO_MAN (and sometimes the
long-dead NOMAN).  I'll fix ports and then re-commit.
2019-11-22 18:41:09 +00:00
Warner Losh
c3bd3d1cc7 Install bsd.sysdir.mk.
Submitted by: Jung-uk Kim
2019-11-21 19:54:10 +00:00
John Baldwin
9ab286b7c1 Add a kmod.opts.mk.
This Makefile sets KERN_OPTS.  This permits kernel module Makefiles to
use KERN_OPTS to control the value of variables such as SRCS that are
used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT
options for standalone builds.
2019-11-21 18:14:26 +00:00
Warner Losh
3cc5d6a470 Introduce bsd.sysdir.mk to consolidate looking for the kernel.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D22144
2019-11-21 15:59:33 +00:00
Warner Losh
599d032a6d Standardize EFI's ESP mount point.
Mount the UEFI ESP on /boot/efi. No current system uses this by default, but
there are many ad-hoc schemes that do this in /efi or /esp or /uefi and adding a
new directory at the top-level would have a much higher likelihood of
collision. Document this in /etc/mtree/BSD.root.mtree and create EFIDIR and
related variables in bsd.own.mk.

Differential Revision: https://reviews.freebsd.org/D21344
2019-11-20 21:06:29 +00:00
Brooks Davis
303d2dd8f1 Make the warning for deprecated NO_ variables an error.
Support for NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB, NO_MAN, NO_PROFILE,
and NO_WARNS as deprecated in 2014 with a warning added for each one
found. Turn these into error in preperation for removal of compatability
support before FreeBSD 13.

Reviewed by:	imp
Relnotes:	yes
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22448
2019-11-20 18:36:58 +00:00
Ed Maste
5882cf7159 disable amd(8) by default
As of FreeBSD 10.1 the autofs(5) is available for automounting, and the
amd man page has indicated that the in-tree copy of amd is obsolete.
Disable it by default for now, with the expectation that it will be
removed before FreeBSD 13.0.

Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D22460
2019-11-20 17:37:45 +00:00
Kyle Evans
506f364029 Add flua to the base system, install to /usr/libexec
FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever
extensions we need for base system operations. We currently support a subset
of lfs and lposix that are used in the rewrite of makesyscall.sh into lua,
added in r354786.

flua is intentionally written such that one can install standard lua and
some set of lua modules from ports and achieve the same effect.

linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added
in. This is similar to what we do in stand/. linit.c has been renamed to
make it clear that this has flua-specific bits.

luaconf has been slightly obfuscated to make extensions more difficult. Part
of the problem is that flua is already hard enough to use as a bootstrap
tool because it's not in PATH- attempting to do extension loading would
require a special bootstrap version of flua with paths changed to protect
the innocent.

src.lua.mk has been added to make it easy for in-tree stuff to find flua,
whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1.

Reviewed by:	brooks, emaste (both earlier version), imp
Differential Revision:	https://reviews.freebsd.org/D21893
2019-11-18 23:21:13 +00:00