Commit Graph

1532 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
e4a41be544 Replace libldns's bootstrap dependency on libcrypto with one on libssl
(which in turn has a bootstrap dependency on libcrypto).

Submitted by:	jkim
Approved by:	re (gjb)
2018-10-12 13:01:17 +00:00
Dag-Erling Smørgrav
d97bf51914 Move libssl up in the bootstrap order.
Submitted by:	jkim
Approved by:	re (gjb)
2018-10-12 05:42:38 +00:00
Ed Maste
539a27e105 Switch ntp's embedded libevent to 2.1.18
For OpenSSL 1.1.1 compatibility.

In Makefile.inc1 add (to the existing similar cases) a hack to handle
dependencies across the migration.

Reviewed by:	jhb
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation.
Differential Revision:	https://reviews.freebsd.org/D17481
2018-10-09 18:35:45 +00:00
John Baldwin
0c0c965a8f Re-enable kernel modules for the MALTA64EL kernel configuration.
Update the BOOTSTRAPPING check for libelf to require the fix for
mips64el object files committed in r338478 and re-enable kernel
modules in the MALTA64EL config file.

Reviewed by:	emaste
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D17054
2018-09-06 19:21:31 +00:00
Li-Wen Hsu
26ffc1ab46 Fix 'install: symlink usr/src/sys -> /sys: File exists' in distributeworld
Follow r334617, specify ${DISTDIR} (by ${INSTALL_DDIR}), '/base' and add
${INSTALLFLAGS} while installing the '/sys' symbolic link.

Reviewed by:	bapt (earlier version), markj
Approved by:	re (gjb), markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D16877
2018-08-28 23:56:52 +00:00
Alex Richardson
c97e51679b Only bootstrap localedef if ${MK_LOCALES} != "no"
During the build it is only used by share/ctypedef and share/colldef
which will not be built if ${MK_LOCALE} == "no". This saves a tiny bit
of time when building without locales.

Approved By:	jhb (mentor)
2018-08-23 18:19:21 +00:00
Alex Richardson
4acc8a67ba Don't create directories in ${WORLDTMP}/legacy with mtree
This has two advantages:
1) We no longer create lots of empty directories that are not needed
2) This is a requirement for building on non-FreeBSD hosts since mtree will
only exist after the bootstrap-tools phase there.

Aproved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16773
2018-08-20 10:39:53 +00:00
Kyle Evans
7920ad944b libbe(3): Move build goop back out of cddl/
Some background: in the GSoC project, libbe/Makefile lived in lib/libbe. I
created projects/bectl branch, maintained the above for all of five
minutes before I misread Makefile.inc1 and decided that it couldn't possibly
build outside of cddl/, so I kicked the Makefile out into the cddl/ build
and all was good. The misreading was of the bit where .WAIT is added to
SUBDIR after lib, libexec but prior to building bin and cddl *only during
the install targets*, which is the critical part.

Fast forward- buildworld was still broken in my branch unbeknownst to me
because I didn't nuke my OBJDIR. Combing through Makefile.inc1 eventually
revealed the necessary magic to make sure that libbe's dependencies are
specified well enough, and it becomes clear what needs done to make a
non-cddl/ build work. This is an interesting prospect, because the build
split is kind of annoying to work with.

IGNORE_PRAGMA is added to avoid dropping WARNS by one more. This was
previously pulled in via cddl/Makefile.inc.
2018-08-18 03:20:59 +00:00
Bjoern A. Zeeb
49f1692a3b METALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG
In the create-world-packages target we manually piece this together (unless
it is undefined), without the DISTDIR.  Normally DISTDIR is empty (unset) and
no one notices.  Now DISTDIR is a well known long-standing PORTS environment
variable and if that is set in the local environment the path to METALOG
is wrong as it no longer is ${DESTDIR}/METALOG.

Long-term we should start to avoid "publicly well known" names for global
variables, for now just piece ${DISTDIR} in as well.  This allows
create-world-packages to continue if DISTDIR is set in the env.
2018-08-17 21:19:18 +00:00
Roger Pau Monné
2502c66bbd build: skip the database check when generating install media
There are several scripts and targets solely used to generate install
media, make sure DB_FROM_SRC is used in that case in order to prevent
checking the host database, which is irrelevant when generating
install binaries.

Sponsored by:		Citrix Systems R&D
PR:			230459
Reviewed by:		gjb
Differential revision:	https://reviews.freebsd.org/D16638
2018-08-17 07:27:15 +00:00
Kyle Evans
35d2028fb8 libbe(3)/bectl(8): More SYSROOT/GCC build fixes
- Missing include path
- Fully specify libzfs's dependencies (except for deps pulled in by other
  deps) in Makefile.inc1
- Drop WARNS back down to 2 for libbe(3). I do this with much hesitation,
  but the libzfs headers are apparently a hot warning-filled mess as far as
  GCC 4.2 is concerned.
2018-08-11 22:45:39 +00:00
Kyle Evans
f335e41b17 Add libzfs to prebuild_libs, libbe dependency on libzfs 2018-08-11 20:32:50 +00:00
Kyle Evans
2b720021aa Makefile.inc1: Add libl to -legacy as well
libl is needed for config(8), which is a bootstrap-tool. It is possible to
build a system WITHOUT_TOOLCHAIN to exclude lex and thus, libl. We still
need to support building from this kind of host, though.

While here, group the config(8) dependencies together and add a small
explanation. These can likely both be scoped more clearly, but this will
need some further investigation.

Reported by:	rgrimes (not WITHOUT_TOOLCHAIN, but provoked investigation)
MFC after:	immediately
2018-08-10 00:10:57 +00:00
Roger Pau Monné
d0f408fab9 build: skip the database check for the distributeworld target
distributeworld is used to generate install media, so it makes no
sense to check the host database since the install media can be
generated from any box, regardless of the version of FreeBSD it's
running.

Sponsored by:		Citrix Systems R&D
Reviewed by:		ian, gjb
Differential revision:	https://reviews.freebsd.org/D16507
2018-08-08 07:58:29 +00:00
Ian Lepore
9898e6dff2 Alpha-sort the list of user/group IDs to check at install time. 2018-07-22 16:51:11 +00:00
Ian Lepore
fd46d8a8c6 Remove the .if ${MK_FOO} wrappers around the user/group ID checks. These
names are referenced in mtree files without any conditional logic, so the
users/groups must exist even if the corresponding tool(s) are disabled.
2018-07-22 16:42:22 +00:00
Ian Lepore
07b9533326 Add ntpd to the list of users/groups to check before installing. 2018-07-20 00:44:04 +00:00
Warner Losh
8b6b96c93d As discussed several times on freebsd-arch, start to decommission armeb.
Remove armeb/arm from KNOWN_ARCHS.
Remove armeb from arm universe targets.

Differential Revision:	https://reviews.freebsd.org/D16257
2018-07-17 23:23:34 +00:00
Kyle Evans
44a83ae3ae Unconditionally build libnv in legacy
Rather than using a config(8) built from new tree linking libnv built on
host.
2018-07-16 13:14:53 +00:00
Bryan Drewery
0d26206d04 Fix parsing of create-kernel-packages
MFC after:	3 days
Reported by:	rene
2018-07-10 21:20:49 +00:00
Kyle Evans
88171893e2 config(8): De-dupe hint/env vars within a single file
r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

libnv has been added to -legacy for the time being to support the build of
config(8) with the new cnvlist API.

Tested with:	universe (11 host & 12 host)
MFC after:	1 month
2018-07-06 01:11:06 +00:00
Kyle Evans
417d105fae Revert r336011,r336012 until I can competently test 2018-07-05 18:55:42 +00:00
Kyle Evans
f1e0a986a8 Fix build after r336011
Add libnv to bootstrap-tools, use ${SRCTOP}/sys headers.
2018-07-05 18:39:02 +00:00
Wolfram Schneider
d0338de5ca `make installworld' should display "completed" message if done
PR:             225159
Reviewed by:    bdrewery
Approved by:    cem (mentor)
Differential Revision:  https://reviews.freebsd.org/D14057
2018-07-01 10:05:45 +00:00
Bryan Drewery
2e90942fa6 META_MODE: Fix clang-tblgen flip-flop building after r335707.
The build of this would have MK_LLVM_TARGET_ALL=yes for bootstrap-tools
but MK_LLVM_TARGET_ALL=no for cross-tools and thus would rebuild between
the two.

MFC after:	2 weeks
X-MFC-with:	r335707
Sponsored by:	Dell EMC
2018-06-30 19:36:02 +00:00
Alex Richardson
55a5b46aff Don't change directory owner to root when building with -DNO_ROOT
Currently the mtree calls in Makefile.inc1 all change the directory owner
to match the spec file. However, we should not be doing this during
distributeworld if -DNO_ROOT is passed. Additionally, when creating the
WORLDTMP directory hierachy there is no need to change the owner to root so
we now always pass the -W flag when populating WORLDTMP.

This is also required for building FreeBSD on Linux/Mac since the required
groups/users will not exist there which is how I discovered this issue.

Reviewed By:	emaste, bdrewery, imp
Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D14185
2018-06-29 21:15:26 +00:00
Bryan Drewery
8706983ff6 Fix unknown target check after r335450.
X-MFC-with:	r335450
Pointyhat to:	bdrewery
Sponsored by:	Dell EMC
2018-06-28 22:24:16 +00:00
John Baldwin
151578dc5f Remove the various build flag hacks for GCC cross-compile.
The xtoolchain GCC packages have not required these flags since ports
commits r465416 and r466701.  The in-tree GCC 4.2.1 has also been patched
in r335716 and r335717 to correctly honor --sysroot when looking for
includes and libraries.

Reviewed by:	bdrewery
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D16055
2018-06-28 21:26:14 +00:00
Bryan Drewery
52b7824bde SYSTEM_COMPILER/LINKER: Fix cross-build support after r335706.
X-MFC-With:	r335706
MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-28 19:01:53 +00:00
Brad Davis
f59e535254 Simplify using bsd.endian.mk and have it provide CAP_MKDB_ENDIAN, since it is
the most common usage.

Approved by:	bapt (mentor)
2018-06-28 13:48:59 +00:00
Brad Davis
7c3f17c5d5 Chase the pwd_mkdb endian changes.
Approved by:	bapt (mentor)
2018-06-27 19:10:32 +00:00
Bryan Drewery
01f124b46f tinderbox: Only build clang/lld once if needed.
Need to handle LLD_BOOTSTRAP separately (for archs like i386).
This would be much better off with an off-by-default option like
SHARED_TOOLCHAIN that universe force-enabled.  Then a normal buildworld
would store the toolchain there if enabled and otherwise in WORLDTMP
with only the 1 arch selected.

MFC after:	3 weeks
Sponsored by:	Dell EMC
2018-06-27 16:58:10 +00:00
Bryan Drewery
eed6d55d26 Clang: Only build needed target for bootstrap compiler.
This will disable the new LLVM_TARGET_ALL option which will only
enable the required target.

This only impacts the bootstrap compiler in WORLDTMP, not the target compiler
that will be installed.

MFC after:	2 weeks
Reviewed by:	sbruno, dim (earlier version)
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D16021
2018-06-27 16:57:56 +00:00
Bryan Drewery
631e709f2b Add LLVM_TARGET_ALL option.
LLVM_TARGET_* will auto be set based on LLVM_TARGET_ALL and MK_CLANG.

If LLVM_TARGET_ALL is disabled, during a cross-build, then SYSTEM_COMPILER
and SYSTEM_LINKER are auto disabled.

This option should be used by users rather than the per-arch LLVM_TARGET
options as it is simpler to maintain for them should the supported
target list change.

MFC after:	2 weeks
Reviewed by:	sbruno, dim
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D16020
2018-06-27 16:57:51 +00:00
Brooks Davis
e4b0a90e77 Normalize the g(eom,cache,part,...) build.
Rather then combining hardlink creation for the geom(8) binary with
shared library build, move libraries to src/lib/geom so they are
built and installed normally.  Create a common Makefile.classes
which is included by both lib/geom/Makefile and sbin/geom/Makefile
so the symlink and libraries stay in sync.

The relocation of libraries allows libraries to be build for 32-bit
compat.  This also reduces the number of non-standard builds in
the system.

This commit is not sufficent to run a 32-bit /sbin/geom on a 64-bit
system out of the box as it will look in the wrong place for libraries
unless GEOM_LIBRARY_PATH is set appropriatly in the environment.

Reviewed by:	bdrewery
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15360
2018-06-25 19:55:15 +00:00
Ed Maste
9b844631a6 Rename usr.bin/elfcopy to usr.bin/objcopy
We always install ELF Tool Chain's elfcopy as objcopy, so to avoid
confusion rename the src directory containing our reach-over Makefile
to match.

Requested by:	jhb
Sponsored by:	The FreeBSD Foundation
2018-06-21 14:28:20 +00:00
Ed Maste
cb623f630c Makefile.inc1: rename build metadata file to toolchain-metadata.mk
The metadata file contains more than just compiler metadata.

Discussed with:	bdrewery
2018-06-21 02:15:50 +00:00
Bryan Drewery
6e6be2bbe2 Reduce exec and fstat overhead for non-build targets.
This is mostly targetting 'make showconfig' and 'make test-system-*' for
the benefit of makeman and universe-one-clang work.

Sponsored by:	Dell EMC
2018-06-20 17:20:39 +00:00
Bryan Drewery
a7d84af890 Add WITH_SYSTEM_LINKER, on by default, that avoids building lld when possible.
This works similar to WITH_SYSTEM_COMPILER added in r300354.  It only
supports lld via WITH_LLD_BOOTSTRAP.

When both SYSTEM_COMPILER and SYSTEM_LINKER logic passes then libclang
will not build in cross-tools.  If either check fails though then
libclang is built.

The .info is reworked to notify when libclang will be built since if
either clang or lld needs to be rebuilt, but not the other, the
notification can lead to confusion on why "clang is building".

-fuse-ld= is not used with this method so some combinations of compiler
and linker are expected to fail.

A new 'make test-system-linker' target is added to see the logic results.

Makefile.inc1:
  CROSS_BINUTILS_PREFIX support had to be moved higher up so that XLD
  could be set and MK_LLD_BOOTSTRAP disabled before checking SYSTEM_LINKER
  logic as done with SYSTEM_COMPILER.  This also required moving where
  bsd.linker.mk was read since XLD needs to be set before parsing it.  This
  creates a situation where src.opts.mk can not test LINKER_FEATURES or
  add LLD_BOOTSTAP to BROKEN_OPTIONS.

Reviewed by:	emaste (earlier version)
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D15894
2018-06-20 16:10:14 +00:00
Bryan Drewery
781872781e Rework WITHOUT_LLD/TOOLCHAIN fix from r327892 for cross-tools.
MK_LLD is for the installed lld while MK_LLD_BOOTSTRAP is for the build
tool.  For WITH_SYSTEM_LINKER it is necesarry to separate the logic of
these two.  When building libllvm TOOLS_PREFIX will be defined and
MK_LLD_BOOTSTRAP should be checked instead.

Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D15837
2018-06-20 16:10:07 +00:00
Bryan Drewery
d74021d65b Rework how the ld link is handled in WORLDTMP from r322811.
LLD_BOOTSTRAP (build) is independent of LLD_IS_LD (installed) so they
should not be based on each other.

This is related to upcoming WITH_SYSTEM_LINKER work.

Reviewed by:	emaste
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D15836
2018-06-20 16:10:02 +00:00
Bryan Drewery
2d2aba181d TARGET_TRIPLE is needed much earlier now for CROSS_BINUTILS_PREFIX check.
This was missed in r335394 since the check became exists(/usr/local) in
my testing.

X-MFC-With:	r335394
MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-19 23:57:12 +00:00
Bryan Drewery
d18e2bca4b Fix detection for binutils bootstrap package.
The path was changed recently in the port to be the full target triple.

MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-19 23:40:42 +00:00
Bryan Drewery
4d64cb780b Let CROSS_BINUTILS_PREFIX work without a trailing slash.
Reported by:	jhb
MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-19 23:40:39 +00:00
Bryan Drewery
8a854b3683 SYSTEM_COMPILER: Should use X_ vars for comparing wanted version.
It is XCC used during the build of target binaries that replaces the
bootstrap compiler.

Also slightly tweak style.

MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-19 23:40:36 +00:00
Bryan Drewery
aafc33396e Fix X_COMPILER_* and X_LINKER_* not being passed to installworld environment.
This could lead to 'sh: head: not found' warnings which were a symptom
of running 'ld --version' during installworld.  This was only happening
with XCC or XLD set.  It is intended that cc and ld do not run during
installworld.  The metadata for these are already stored in
compiler-metadata.mk added in r316794.

This also removes redundant CROSSENV additions that were for
WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, and WITHOUT_TOOLCHAIN
which all don't have a cc or ld in their PATH during install.

Reported by:	Mark Millard
MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-19 23:39:55 +00:00
Bryan Drewery
cf43faaa9f Don't bootstrap lld if an external linker is used.
Sponsored by:	Dell EMC
2018-06-19 01:00:27 +00:00
Ian Lepore
2a821fd9d2 Build LOCAL_LIB_DIRS along with system lib dirs, rather than building them
in parallel with LOCAL_DIRS and all the other system post-libs stuff.
2018-06-17 14:13:45 +00:00
Konstantin Belousov
f39bffc62c Rework ofed build.
Aligns the build with the FreeBSD traditional approach to not build in
contrib/, and to track inter-dependencies between libraries.

With help from:	bdrewery
Reviewed by:	bdrewery, hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D15648
2018-06-16 15:05:05 +00:00
Bryan Drewery
4e3db1e0af Assert that a build is done before an install.
This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for
install.

MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-16 00:35:19 +00:00