Commit Graph

2532 Commits

Author SHA1 Message Date
Bryan Drewery
59f6130d2a Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.
Sponsored by:	EMC / Isilon Storage Division
2016-03-26 03:46:12 +00:00
Bryan Drewery
38551f8fae We don't have a CPPFLAGS, COPTS or CPUFLAGS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-26 03:46:04 +00:00
Bryan Drewery
11e49977a2 WITHOUT_TOOLCHAIN: Also exclude LLDB.
Sponsored by:	EMC / Isilon Storage Division
2016-03-25 22:36:29 +00:00
Bryan Drewery
1b337a349d Build libcompat (lib32) with a --sysroot pointing into its stage directory.
This overrides the cross-compiler's default sysroot to use the WORLD32's
sysroot for building the lib32 libraries.  Previously the cross-compiler
would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags
were used to build using the lib32 files.  This leads to multiple issues
discussed later.  Some extra headers are now needed to be staged since the
64bit WORLDTMP is not referenced at all for headers.  The 64bit WORLDTMP
is still used via PATH for build tools.  Overriding the default
target/arch is retained in the CC/CXX overrides.

This allows reverting the LDSCRIPT rewriting in installworld from r296921 and
r235122, thus allowing read-only objdirs to work for installing again.

This removes the need for _LDSCRIPTROOT.

This allows progressing the change to always use --sysroot for the build
rather than only relying on the cross-compiler's default sysroot.  The
work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER
not using a --sysroot [1].

PR:		196193 [1]
Sponsored by:	EMC / Isilon Storage Division
2016-03-25 19:12:38 +00:00
Simon J. Gerraty
3bebe7293b Update to bmake-20160315
Archive member handling works again
meta mode, treat missing reads as for writes.

Update dirdeps.mk - much improved startup time.
Update meta.stage.mk - avoid ln when chmod required.
2016-03-18 20:03:09 +00:00
Bryan Drewery
54bc9e303d Partially revert r266227 and stop stripping paths in ldscripts.
Specifically this fixes /usr/lib/libc.so stripping the paths to the
libraries.  The reason for this in r266227 was both likely because ld(1) did
not fully respect --sysroot until r291226 and because of the lib32
build.  The lib32 build does not use --sysroot into the /usr/lib32 path,
rather it only uses -L and -B into the /usr/lib32 path and --sysroot
into the normal (64bit) /usr/lib.  The _LDSCRIPTROOT was added with
the ldscript support in bsd.lib.mk so that it builds a 32-bit-sysrooted pathed
ldscript in the object directory and then installs a normal unprefixed
version in installworld.  This commit also fixes the rebuild during
install which was broken in r266227.  This commit would break DIRDEPS_BUILD
build of lib32 but it does not currently have a way to build it anyhow.

For example, before this change we had in /usr/lib/libc.so:
  GROUP ( libc.so.7 libc_nonshared.a libssp_nonshared.a )
Now it is restored to pre-r266227:
  GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a /usr/lib/libssp_nonshared.a )

The motivation for this is in testing of lld.
From emaste:
  lld does not have built-in search paths (e.g. /lib, /usr/lib) and relies on
  -L arguments passed by the caller.  As the linker is nearly always invoked
  from the clang driver this is fine other than the fact that /usr/lib/libc.so
  is an ldscript that refers to libc.so.7 which is in /lib, not /usr/lib.

PR:		207980
Reported by:	emaste
Submitted by:	emaste (based on)
Differential Revision:	https://reviews.freebsd.org/D5637
2016-03-15 22:27:29 +00:00
Bryan Drewery
2b2ab443c0 Follow-up r296700: Fix incorrectly declaring these as .MAIN.
This broke bootstrap-tools at least for DIRDEPS_BUILD.

Sponsored by:	EMC / Isilon Storage Division
2016-03-13 20:51:45 +00:00
Bryan Drewery
19f67f6910 Don't even define or append subdir targets with NO_SUBDIR.
No functional change.

This prevents adding empty targets to the main called target which is
confusing for debugging.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:39 +00:00
Bryan Drewery
95ae492929 META_MODE: We can only use a cookie if filemon is being used.
Sponsored by:	EMC / Isilon Storage Divsion
2016-03-11 23:45:32 +00:00
Bryan Drewery
b7d28aff10 META_MODE: Simplify the META_COOKIE handling to use .USE/.USEBEFORE.
Extend it to other cases of meta mode cookies so they get the proper rm
cookie behavior when a .meta file detects it needs to rebuild and fails.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:28 +00:00
Bryan Drewery
bd08afe1c9 DIRDEPS_BUILD: Add a sure way to prohibit building 'all' during dirdeps phase.
This obsoletes the _SKIP_BUILD check but keeps it for now until it
proves to be enough.

In the dirdeps build the first 'make all' or 'make' ran would invoke
'make dirdeps' which builds dependencies and then builds the current
directory in a sub-make (when BUILD_AT_LEVEL0 is no, which for us it
is).  This behavior causes things attached to 'all:' to build in the
dirdeps phase AND the sub-make phase which creates all kinds of problems
for staging, meta file tracking, and races.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:23 +00:00
Bryan Drewery
9c7086241d DIRDEPS_BUILD: Avoid rebuilds due to changed build commands with newly staged tools.
This is a follow-up to r291561 which reworked the bootstrap tool PATH
handling.

An example of this is when building lib/clang/libclangedit.  At first
clang-tblgen will not be staged in the host tree so it will have
CLANG_TBLGEN=clang-tblgen set and exported.  During the build though it
will stage clang-tblgen and then find it via the PATH.  On the next
build it finds clang-tblgen in the stage directory and would set
CLANG_TBLGEN=<stagedir/usr/bin>/clang-tblgen thus causing the build
command to change.  In both cases the same exact tool was used though so
there is no need to rebuild.  If the tool did change the normal
meta/filemon handling would pick that up via timestamp comparisons and
rebuild.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:13 +00:00
Bryan Drewery
4d7ae5ef71 DIRDEPS_BUILD: export DESTDIR for STAGING.
An example of where this is needed is in share/examples which for
'etc-examples' runs 'make -C SRCTOP/etc etc-examples' which installs
to the default DESTDIR otherwise.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:05 +00:00
Bryan Drewery
fa3afecf97 DIRDEPS_BUILD: Extend beforeinstall: staging hack.
Most beforeinstall: usage is not adding commands but only adding
targets, such as in share/sendmail.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:02 +00:00
Bryan Drewery
55f6623d83 Remove out-of-place make(buildincludes) check.
This came in r239572 for META_MODE handling but it doesn't make sense
since the staging is always done in make(all); make(buildincludes)
is never actually ran in the META_MODE build.

Reported by:	bapt
Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:44:59 +00:00
Bryan Drewery
588f5cb86d DIRDEPS_BUILD: Remove the cookie when target is out-of-date.
The meta file may decide the target is out of date but nothing
ensures that the *next* build will build this target if it
fails this time for some reason; it is still out-of-date
until it succeeds.

Convert the include/ cookie usage to the global versions.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:44:27 +00:00
Bryan Drewery
d783b170b3 Enable FAST_DEPEND by default.
Discussed on:	arch
Sponsored by:	EMC / Isilon Storage Division
2016-03-11 16:57:41 +00:00
Bryan Drewery
e32a2cbe39 FAST_DEPEND: Use .dinclude to enable full .depend logic in bmake.
The inclusion of .MAKE.DEPENDFILE (.depend) has special logic in make
to ignore stale/missing dependencies.  bmake 20160220 added a '.dinclude'
directive that uses the special logic for .depend when including the file.

This fixes a build error when a file is moved or deleted that exists in a
.depend.OBJ file.  This happened in r292782 when sha512c.c "moved" and an
incremental build of lib/libmd would fail with:
  make: don't know how to make /usr/src/lib/libcrypt/../libmd/sha512c.c. Stop

Now this will just be seen as a stale dependency and cause a rebuild:
  make: /usr/obj/usr/src/lib/libmd/.depend.sha512c.o, 13: ignoring stale .depend for /usr/src/lib/libcrypt/../libmd/sha512c.c
  --- sha512c.o ---
  ...
This rebuild will only be done once since the .depend.sha512c.o will
be updated on the build with the -MF flags.

This also removes -MP being passed for the .depend.OBJ generation (which
would create fake targets for system headers) since the logic is no
longer needed to protect from missing files.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 04:09:56 +00:00
Simon J. Gerraty
be19d90b61 Merge bmake-20160307 2016-03-11 01:35:39 +00:00
Bryan Drewery
17e75d1cd2 These group names may be used as a cookie, so replace any non-fs-safe characters.
One example is in cddl/usr.sbin/dtrace/tests/common/aggs.  It could be
fixed but other uses of this would break, especially in the
DIRDEPS_BUILD which uses the group names for stage cookies.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:45:00 +00:00
Bryan Drewery
9593179053 DIRDEPS_BUILD: Let PROGS bootstrapping work.
- Support (DP|LIB)ADD_${PROG}.
- Support SRCS[._]${PROG}.
- Don't bootstrap DIRDEPS while recursing.

Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:44:48 +00:00
Bryan Drewery
d424483b4b Follow-up r295827: Don't enable meta stats when recursing PROGS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 03:22:23 +00:00
Bryan Drewery
3cf3d03900 DIRDEPS_BUILD+PROGS: Fix staging not respecting (BINDIR|PROGNAME)[._]${PROG}.
Observed in tests/sys/kern.

Sponsored by:	EMC / Isilon Storage Division
2016-03-09 03:22:20 +00:00
Bryan Drewery
f68f6b3dd6 Remove things set already by bsd.progs.mk.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 03:22:17 +00:00
Bryan Drewery
3655b04367 PROGS: Track child meta files.
This will allow Makefile.depend to properly capture all dependencies.
It is not 100% optimal but works.  Other options would be to use *.meta
here which would include too much or to keep a Makefile.depend per PROG
and include it from the main Makefile.depend which would not be
straight forward.

Sponsored by:	EMC / Isilon Storage Division
2016-03-09 03:22:08 +00:00
Bryan Drewery
c12b4204c6 Follow-up r296324: Fix STATICOBJS dependency guesses conditions.
Reported by:	antoine
Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2016-03-08 16:12:55 +00:00
Dimitry Andric
a36b180a7f Merge ^/head r296369 through r296409. 2016-03-05 15:34:54 +00:00
Bryan Drewery
49e6689098 DIRDEPS_BUILD: For bootstrapping always install all headers.
There is no good way to guess if any of these will be needed but
they commonly are and add no extra overhead so just stage them.

Sponsored by:	EMC / Isilon Storage Division
2016-03-04 22:37:21 +00:00
Bryan Drewery
400b94bbeb Fix over/under-linking in contrib/ofed.
Sponsored by:	EMC / Isilon Storage Division
2016-03-04 22:37:09 +00:00
Bryan Drewery
ee05c0f1b8 Allow adding to SOLINKOPTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-04 22:37:00 +00:00
Dimitry Andric
82aa34e6fa Merge ^/head r296007 through r296368. 2016-03-03 23:15:46 +00:00
Bryan Drewery
a324b0f04c DEBUG_FILES: Create the DEBUGFILEDIR if it doesn't exist on install.
Currently the base.txz distribution does not get the BSD.debug.dist mtree
extracted into it.  So if you start from that and then try to build a 3rd-party
application outside of buildworld it will by-default try installing the
debug files into a missing directory if they are being installed into /usr/lib.

Check for the existence before forcing the directory to be created rather than
the older way of running a shell command with test -d || mkdir -p always.

Reported by:	HardenedBSD (https://github.com/HardenedBSD/secadm/issues/23)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5411
2016-03-03 18:08:58 +00:00
Bryan Drewery
271d6c44ba Add missing atf dirs.
Sponsored by:	EMC / Isilon Storage Division
2016-03-03 06:37:17 +00:00
Bryan Drewery
d750b64121 Move casper library entries to proper places.
Sponsored by:	EMC / Isilon Storage Division
2016-03-03 06:22:51 +00:00
Bryan Drewery
88fe1f7ab3 Add guessed dependencies to OBJS after bsd.dep.mk in case of it adding to SRCS.
This was a regression in r295985.

bsd.dep.mk adds to SRCS for dtrace probes, yacc grammars and some
others.

The code that is moving is planned to be removed once FAST_DEPEND is
default (and the only option) though since FAST_DEPEND doesn't use this.

Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2016-03-02 21:03:42 +00:00
Bryan Drewery
210ee5ceea Fix meta2deps.sh tracking of dependencies inside .CURDIR.
An example of this is in share/i18n/csmapper.

Reviewed by:	sjg
Sponsored by:	EMC / Isilon Storage Division
2016-03-02 20:06:24 +00:00
Bryan Drewery
2eed38a070 CCACHE_BUILD+META_MODE: Lookup and canonicalize the default CCACHE_DIR.
This is done to prevent not having CCACHE_DIR causing meta mode with filemon to
see stat changes in the ccache dir and cause rebuilds.

Sponsored by:	EMC / Isilon Storage Division
2016-03-01 22:25:54 +00:00
Bryan Drewery
e9508dc293 FAST_DEPEND: Prefer .OBJDIR depend files.
Sponsored by:	EMC / Isilon Storage Division
2016-02-29 21:10:47 +00:00
Ed Maste
a304b6d089 Enable NO_ make variable deprecation warning
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D5495
2016-02-29 17:57:11 +00:00
Bryan Drewery
aae63957af Import bsd.clang-analyze.mk based on NetBSD's version.
This allows 'make analyze' or 'make OBJ.clang-analyzer' to run the
Clang static analyzer and present results on stdout.

Obtained from:	NetBSD (CVS Rev. 1.3)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5449
2016-02-26 22:14:00 +00:00
Bryan Drewery
b29980a63f META_MODE: Default to the silent build.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:56 +00:00
Bryan Drewery
342863e712 Move PROGS logic to proper place and remove redundant and unneeded logic.
- bsd.progs.mk is safe to include regardless of PROGS/PROGS_CXX/SCRIPTS
  being set.
- bsd.progs.mk includes bsd.prog.mk always and will bring in
  bsd.files.mk and bsd.obj.mk.
- DIRDEPS_BUILD: There's no need for _SKIP_BUILD or _SKIP_STAGING as the
  PROGS were implicitly being built by the staging dependency anyway.  This
  was also preventing other objects from building if they were not part of
  the staging sets.
- DIRDEPS_BUILD: This fixes PROGS without bsd.test.mk not staging.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:52 +00:00
Bryan Drewery
db74470bff DIRDEPS_BUILD: Fix some things building in MAKELEVEL0.
For PROGS this was recursing twice since MAKELEVEL0 is for 'dirdeps'
which then really builds in a sub-make.

Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:48 +00:00
Bryan Drewery
180a8487ee Track .meta files for .sh but don't preserve timestamp.
See r291320 for more information.

Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:42 +00:00
Bryan Drewery
64923b1128 Allow configuring .MAKE.MODE via META_MODE as meta.sys.mk does.
meta.sys.mk is only used for the DIRDEPS_BUILD.

Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:38 +00:00
Bryan Drewery
4e47b95cc9 Remove more references to targets we've never had.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:35 +00:00
Bryan Drewery
f1702f873d Remove _manpages and _maninstall targets as they are no longer needed.
r96164 added them to avoid recursing twice with _SUBDIR.  That issue was
fixed in bsd.subdir.mk in r291635 for all targets.

Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:31 +00:00
Ed Maste
ca8b902aa5 Install elftoolchain elfcopy(1) as objcopy(1) by default
As of r295661 elfcopy supports PE format for EFI boot binaries and is a
viable objcopy implementation for the base system and ports.

The (temporary) src.conf knob WITHOUT_ELFCOPY_AS_OBJCOPY knob may be set
to obtain the GNU version if necessary.

PR:		207091 [exp-run]
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2016-02-26 15:46:14 +00:00
Bryan Drewery
caf1fb322e Let CLEANDEPENDFILES actually be set before bsd.dep.mk.
This fixes 'cleandepend' for kmods after r295983.

Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 01:52:33 +00:00
Bryan Drewery
57b5a84431 Slightly lessen the amount of job target output for SUBDIR_PARALLEL.
Sponsored by:	EMC / Isilon Storage Division
2016-02-25 21:04:52 +00:00