Commit Graph

3043 Commits

Author SHA1 Message Date
Mariusz Zaborski
7b4fce76cc Introduce syslog service for Casper.
syslog in libc secretly reconnects to the daemon.
Another issue is that we don't have any information from openlog(3) if we
succeeded to open log or not so we don't know if we are ready
to enter cabability mode.
Because all of that we decided we need a syslog service for Caspser.

Reviewed by:	bapt@
Differential Revision:	https://reviews.freebsd.org/D12824
2017-11-12 08:34:25 +00:00
Bryan Drewery
de2b0e0318 DIRDEPS_BUILD: Fix after r325417.
DIRDEPS_BUILD works just fine without defining __objdir or dealing with any of
this logic.  It handles its own TARGET_SPEC in local.meta.sys.mk as well.  Just
let it do its own thing.

Sponsored by:	Dell EMC Isilon
2017-11-11 01:11:00 +00:00
Bryan Drewery
5edf5dc29f Don't work out of a TARGET. directory if TARGET_ARCH is not defined.
This fixes 'TARGET=<target> make universe_kernels' creating an empty TARGET.
directory and showing it in SIGINFO.

Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:55 +00:00
Bryan Drewery
f82493cc3a Handle MAKEOBJDIRPREFIX when already inside of .OBJDIR.
This can happen in obscure cases with things like the kernel build.

Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:41 +00:00
Warner Losh
4728f534ff Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI
Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI
in the boot loaders. Add HAVE_GELI so components can flag they need
support (since it's too large to include everywhere). Add temporary
warnings for the old forms to ease transition.

Also, update test script to build without GELI on x86.

Sponsored by: Netflix
2017-11-10 23:54:48 +00:00
Warner Losh
a179cd9114 Replace LOADER_FIREWIRE_SUPPORT variable
Rename LOADER_FIREWIRE_SUPPORT to MK_LOADER_FIREWIRE. Only build
libfirewire when this is "yes". Add note to updating. Fix build script
to build this for x86 so the option doesn't decay. sparc64 supports
ZFS, so also build it MK_ZFS=no.

Sponsored by: Netflix
2017-11-10 23:54:41 +00:00
Bryan Drewery
42b16bca0c AUTO_OBJ: Don't create .OBJDIR with 'make -n'.
Sponsored by:	Dell EMC Isilon
2017-11-10 20:10:05 +00:00
Bryan Drewery
068306e969 Allow consuming Makefiles to add to DEPENDFILES.
Sponsored by:	Dell EMC Isilon
2017-11-10 20:09:11 +00:00
Bryan Drewery
4a398ab3dc No need to run 'make depend' with FAST_DEPEND logic in-tree.
Sponsored by:	Dell EMC Isilon
2017-11-10 19:53:17 +00:00
Bryan Drewery
4120775275 AUTO_OBJ: No need to tree-walk with 'make obj' here.
Sponsored by:	Dell EMC Isilon
2017-11-10 19:53:14 +00:00
Bryan Drewery
f633c2fcda Pass down any PROG-specific buildopts for forwarded targets.
This currently has no impact.

Sponsored by:	Dell EMC Isilon
2017-11-10 19:53:11 +00:00
Bryan Drewery
2f1b940805 Don't append TARGET.TARGET_ARCH if OBJTOP is already set.
This avoids flipping the expected TARGET.TARGET_ARCH suffix / OBJTOP when it is
already set by a parent make which wants to control it more such as in
something like 'make native-xtools'.

Sponsored by:	Dell EMC Isilon
2017-11-10 19:52:31 +00:00
Bryan Drewery
a2f16e5356 Add some missed OBJS_SRCS_FILTER from r323637.
Sponsored by:	Dell EMC Isilon
2017-11-10 08:00:09 +00:00
Bryan Drewery
ff87c77cac Add support for CRUNCH_LIBS_ for specifying a lib only for 1 prog.
Sponsored by:	Dell EMC Isilon
2017-11-10 07:52:46 +00:00
Bryan Drewery
fa65e3a53d Handle some .OBJDIR == .CURDIR cases.
- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH.  This
  only happens at the top-level, and for sub-directories when the
  user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
  determines which .OBJDIR the user gets;  If they cannot write to an
  existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
  libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by:	Dell EMC Isilon
2017-11-10 02:09:33 +00:00
Bryan Drewery
13ea077996 Mark targets .PHONY.
This avoids the obvious of not running the target when expected, but
also avoids META_MODE from showing 'Building'.  This is mostly only
a problem when directly including bsd.obj.mk as many of these targets
were already .PHONY via bsd.sys.mk.

Sponsored by:	Dell EMC Isilon
2017-11-09 22:08:07 +00:00
Bryan Drewery
2a8176cb61 META_MODE: Bmake 20171028 in r325340 simplifies the meta filename.
Now if the meta file is in the objdir, the objdir is stripped away
from the meta filename.

Sponsored by:	Dell EMC Isilon
2017-11-08 18:02:01 +00:00
Bryan Drewery
e1b7ce1fa0 AUTO_OBJ: Hide 'creating dirs' output with 'make -s'.
Reported by:	garga
Sponsored by:	Dell EMC Isilon
2017-11-08 16:03:58 +00:00
Bryan Drewery
502304ef16 Reenable AUTO_OBJ by default.
The problem with it was a bogus .OBJDIR in some cases where creation of
object directories were purposely not attempted, such as for 'make cleandir'
and in etc/ sub-directories.  In these cases bmake would start with a
bogus .OBJDIR like etc/ due to MAKEOBJDIR being a dynamic value based on
.CURDIR, SRCTOP, and OBJTOP.  OBJTOP would not yet be defined but is
during early src.sys.obj.mk.  That file and auto.obj.mk both were not
modifying .OBJDIR unless they expected to create the objdir.  Thus in
these cases the .OBJDIR was left as etc/* rather than fixed to the
proper .CURDIR.

The issues were fixed in r325404 and r325416.  An assertion to avoid the
bad .OBJDIR was added in r325405.

Sponsored by:	Dell EMC Isilon
2017-11-07 18:20:08 +00:00
Bryan Drewery
2f445a5314 Reapply r295227: Stop hiding link install commands.
This was lost in the release-pkg merge in r298107.

Sponsored by:	Dell EMC Isilon
2017-11-06 19:33:50 +00:00
Enji Cooper
c9c9774c70 Revert r325443
Despite the fact that it's a working solution, it doesn't follow the design
philosophy of only doing TARGET_* in Makefile.inc1 and special locations in
the source tree.

PR:		222925
Requested by:	imp
2017-11-05 20:01:00 +00:00
Enji Cooper
571e134eea Fix paths for cross-built versions of lib/libclang_rt and hardfloat arm variants
- Define TARGET_CPUARCH and use in libclang_rt as the basis for CRTARCH

  When cross-compiling, the wrong architecture was being embedded in the
  libclang_rt binary filenames. It should be based on TARGET_ARCH (target), not
  MACHINE_ARCH (host).

  If TARGET_ARCH isn't defined (host-builds), fallback to MACHINE_ARCH.

- Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to arm/armv[67]

  TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, which
  affects the clang lookup path per `getArchNameForCompilerRTLib(..)` in
  contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp, so chase clang and
  Linux's assumed naming convention for hard-float arm architectures.

  CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the
  TARGET*-relevant values when building the `libraries` target, so test
  those variables instead.

- Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH == arm/armv[67]. This
  impacts only arm/armv6 and arm/armv7.

PR:	222925
2017-11-05 19:38:51 +00:00
Bryan Drewery
c6d98d62e2 Follow-up r325405: Fix assertion still for kernel module builds.
Apparently they have SRCTOP set, but won't have RELDIR set since they are
not in-tree.

Pointyhat to:	bdrewery
Reported by:	O. Hartmann <ohartmann@walstatt.org>, dhw
Tested by:	dhw
Sponsored by:	Dell EMC Isilon
2017-11-05 16:28:05 +00:00
Enji Cooper
cc5f0ba05b .S.ppico should omit ${_COV_FLAG}, not .S.pico 2017-11-05 05:08:16 +00:00
Enji Cooper
8e7d6bc8e3 Omit _COV_FLAG from PO_C(XX)FLAGS and from .S.ppico static targets 2017-11-05 04:28:05 +00:00
Enji Cooper
254d2760ce MFhead@r325422 2017-11-05 04:08:00 +00:00
Bryan Drewery
b91ed584d4 Avoid trying to remove a fullpath directory in CLEANDIRS.
Let CLEANDIRS work relative since make is already in .OBJDIR.

MFC after:	2 weeks
X-MFC-With:	r322511
Sponsored by:	Dell EMC Isilon
2017-11-05 00:26:28 +00:00
Bryan Drewery
b284f32266 AUTO_OBJ: Allow 'make cleandir obj all' combinations.
The cleanobj target will not really remove the OBJDIR in this case,
it will only remove the OBJDIR if only clean targets are ran.

Sponsored by:	Dell EMC Isilon
2017-11-05 00:12:12 +00:00
Bryan Drewery
3407406588 Set the expected __objdir for auto.obj.mk to try.
This avoids some future discrepency that might cause auto.obj.mk to use the
wrong OBJDIR.

Sponsored by:	Dell EMC Isilon
2017-11-05 00:12:09 +00:00
Bryan Drewery
00428a515c Always try to set .OBJDIR, even if AUTO_OBJ is enabled, and fallback to .CURDIR.
When AUTO_OBJ is enabled this change becomes redundant with the auto.obj.mk
check added in r325404.  However, it is possible that new code is added
at some point between src.sys.obj.mk and auto.obj.mk that disables AUTO_OBJ.
That could leave make with a bogus and unsafe .OBJDIR in some cases.

Sponsored by:	Dell EMC Isilon
2017-11-05 00:12:05 +00:00
Bryan Drewery
dea21cf465 Validate MAKEOBJDIR after the MAKEOBJDIRPREFIX override.
Sponsored by:	Dell EMC Isilon
2017-11-05 00:12:02 +00:00
Bryan Drewery
aba77ddd8a AUTO_OBJ: Set .OBJDIR=.CURDIR earlier for NO_OBJ Makefiles.
auto.obj.mk is loaded before the Makefile which may have NO_OBJ set inside of
it.  In that case we can't avoid creating the OBJDIR but we do need to avoid
using it.  Fixing .OBJDIR in bsd.init.mk at least fixes all of the build .mk
files to have a proper .OBJDIR.  It does not fix the Makefile itself but
usually if they have NO_OBJ set they are not inspecting ${.OBJDIR} anyhow.

It is ideal to only have this in bsd.init.mk and to remove it from bsd.obj.mk,
but then bsd.obj.mk would need to include bsd.init.mk.  Doing something like
that would require more testing.  It has been proposed that bsd.obj.mk not be
included directly but it has been possible for too long to do so to change it
at this point.

Note too that it may make sense to fix .OBJDIR even when AUTO_OBJ is not
enabled but the historical behavior has always been that NO_OBJ just avoids
running 'make obj', so .OBJDIR should already be .CURDIR.

Also while NO_OBJ seems like it should be removed at this point, it is not
always possible to fix Makefiles to properly use an .OBJDIR.  The cost of
keeping NO_OBJ support is minimal.

Sponsored by:	Dell EMC Isilon
2017-11-05 00:11:58 +00:00
Bryan Drewery
d949e92a9c Follow-up r325405: Only enable assertion for in-tree src builds.
Pointyhat to:	bdrewery
Reported by:	O. Hartmann <ohartmann@walstatt.org>
Sponsored by:	Dell EMC Isilon
2017-11-04 21:59:54 +00:00
Bryan Drewery
914a5ffcbd AUTO_OBJ: Revert r325351 now that the fix is in auto.obj.mk in r325404.
Forcing MK_AUTO_OBJ to no is not really needed since bsd.obj.mk is protected
against 'rm -rf ${.CURDIR}' already.  It was also flawed as if MK_AUTO_OBJ=yes
was in the .MAKEOVERRIDES already then it just remained on.

Sponsored by:	Dell EMC Isilon
2017-11-04 21:06:39 +00:00
Bryan Drewery
968be8a7a0 Add an assertion to avoid the 'rm -rf /etc' case from cleanobj fixed in r325404.
Sponsored by:	Dell EMC Isilon
2017-11-04 21:05:03 +00:00
Simon J. Gerraty
5abdb50e57 Ensure .OBJDIR has known value
If for any reason we cannot set .OBJDIR==_objdir as desired
use .CURDIR so that at least the classic
.if ${.OBJDIR} != ${.CURDIR}
works and dangerous misstakes can be avoided.

Reviewed by: bdrewery
2017-11-04 21:02:26 +00:00
Enji Cooper
f6e116eea9 MFhead@r325383 2017-11-04 07:05:21 +00:00
Bryan Drewery
40a54c51c9 AUTO_OBJ: If the wanted .OBJDIR was not used then disable the feature.
This is to prevent downstream checks from assuming they can trust .OBJDIR when
MK_AUTO_OBJ is yes, such as the bsd.obj.mk checks.

Pointyhat to:	bdrewery
Sponsored by:	Dell EMC Isilon
2017-11-03 01:09:35 +00:00
Bryan Drewery
5fecb1f1d6 AUTO_OBJ is unsafe at the moment as it is for some reason removing /etc with _cleanobj. 2017-11-02 23:00:04 +00:00
Bryan Drewery
89bd07e927 DIRDEPS_BUILD: Cleanup leftover WORLDTMP files.
This will force any existing objects to rebuild if their .meta
files reference files from WORLDTMP.  This is a problem after
the UNIFIED_OBJDIR effort caused buildworld and DIRDEPS_BUILD
to share an OBJDIR.  Without cleaning these files the
Makefile.depend files end up with odd tmp/legacy/... entries
since some bootstrap-tools linger from there and otherwise
don't rebuild.  Removing the files causes anything having
used WORLDTMP to rebuild.

Sponsored by:	Dell EMC Isilon
2017-11-02 20:45:04 +00:00
Bryan Drewery
615a1e70b0 Enable AUTO_OBJ by default if the OBJDIR is writable, only for in-tree builds.
This can be disabled by putting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf, not
/etc/src.conf, or passing it in the environment.

The purpose of this rather than simply flipping the default of AUTO_OBJ to yes
is to avoid hassling users with auto.obj.mk failures if the wanted OBJDIR is
not writable. It will fallback to writing to the source directory like it does
today if MAKEOBJDIRPREFIX is not writable.

The act of enabling MK_AUTO_OBJ disables all 'make obj' treewalks since
previous work has made those not run if MK_AUTO_OBJ==yes in Makefile.inc1.

Relnotes:	yes
Reviewed by:	sjg
Discussed at:	https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12841
2017-11-02 18:09:07 +00:00
Bryan Drewery
fbb74b0ee7 Don't propagate MAKEOBJDIRPREFIX changes to environment.
A makefile may use this variable later for its own reasons,
don't infect sub-makes with that value.

Sponsored by:	Dell EMC Isilon
2017-11-02 04:05:03 +00:00
Bryan Drewery
718edb1577 META_MODE: Respect make -s.
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-11-01 21:22:19 +00:00
Bryan Drewery
f8b15066f2 make obj: Skip treewalk if AUTO_OBJ is enabled.
Sponsored by:	Dell EMC Isilon
2017-11-01 21:22:16 +00:00
Bryan Drewery
dfa099890c Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.
This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>.  This
new format is used regardless of cross or native build.  It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.

Relnotes:	yes (don't note UNIFIED_OBJDIR option since it will be removed)
Prior work:	D3711 D874
Reviewed by:	gjb, sjg
Discussed at:	https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Discussed with:	emaste
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12840
2017-11-01 21:22:05 +00:00
Enji Cooper
b9a2bf88a3 Checkpoint work to integrate coverage and make check together 2017-10-31 07:16:18 +00:00
Enji Cooper
7c008e4270 Add MK_MAKE_CHECK_WITH_COVERAGE, reliant on MK_COVERAGE and MK_MAKE_CHECK_USE_SANDBOX 2017-10-31 06:16:40 +00:00
Enji Cooper
75aaeb57f6 Don't override MK_COVERAGE from bsd.opts.mk in the CLANG_IS_CC case 2017-10-31 03:14:35 +00:00
Enji Cooper
1633af78ab Shuffle MK_COVERAGE conditionals around 2017-10-31 02:52:59 +00:00
Enji Cooper
076777cc29 MFhead@r325199 2017-10-31 02:46:36 +00:00