Commit graph

667 commits

Author SHA1 Message Date
John Baldwin 0b2b53a2ea Only build kernels for enabled TARGET_ARCHes in make universe/tinderbox.
Previously, all of the kernels for a given TARGET were built if that
target was enabled.  This was implemented by having each kernel built
via a universe_kernconf_<KERNEL> target that was depended on by a
universe_kernconfs target.  However, this meant that if one did a
build with a limited set of TARGET_ARCH values for a given TARGET,
kernels could be built for which we hadn't built a world or toolchain.
For example, 'make TARGETS=mips TARGET_ARCHES_mips=mips64' would build
mips32 kernels.

Fix this by adding an extra layer of indirection in the kernel make
targets.  universe_kernconf_<KERNEL> is now a dependency of a new
universe_kernconfs_<TARGET_ARCH>.  universe_kernconfs in turn depends
on a list of universe_kernconfs_<target_arch> values, but only the
values enabled in TARGET_ARCHES_<TARGET>.

Reviewed by:	imp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D23031
2020-01-06 17:34:17 +00:00
John Baldwin 0865e2bb05 Use the freebsd-gcc6 toolchains instead of powerpc64-xtoolchain-gcc.
Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D23029
2020-01-04 00:59:47 +00:00
Andrew Turner d0d8c0977c Add the missing trailing '/' when setting TARGET_ARCH from TARGET
This should fix the build when setting TARGET but not TARGET_ARCH.

Sponsored by:	DARPA, AFRL
2020-01-02 11:02:09 +00:00
Warner Losh eb4977bd0f Remove arm/arm as a valid target.
TARGET=arm now defaults to TARGET_ARCH=armv7
TARGET_ARCH=arm is no longer valid.

Bump __FreeBSD_version to 1300073

Tested with make universe. Any stale LINT-V5 config files remaining in the tree
will fail the universe build. However, LINT-V5 was removed in r355119.

This retirement has been planned since last summer. The armv5 port is fragile:
it works OK for some peeople, and fails badly for others. There's a number of
subtle bugs in busdma, pmap and other MD parts of thee system that present
themselves under load or in unusual circumstances (like fsck after a
crash). stable/8, branched 10 years ago, was the last reliable release.  Since
the support burden is larger then the benefit, the consensus view is armv5
should be removed from the tree.

Discussed with: arm@ mailing list and arm developer community.
2020-01-02 03:25:26 +00:00
Conrad Meyer e55890a9b8 Take arm.arm (armv5) out of universe
It's on the chopping block in two months, the CI tinderbox doesn't bother with
it anymore either, and buildworld fails today due to an issue linking clang.
It's not worth investigating and it just eats up CPU cycles running universe
builds.
2019-11-03 19:36:34 +00:00
John Baldwin b411a285d9 Disconnect powerpc from the default tinderbox for now.
The wrong toolchain was set in MAKE_PARAMS_powerpc, however, there are
some other issues preventing powerpc from building in tinderbox:

1) There is no powerpc-gcc and powerpc-xtoolchain-gcc port that
   provides an external 32-bit powerpc GCC toolchain.

2) On other targets, the same toolchain can build all of the
   architectures for a given target.  MIPS achieves this by always
   setting -mabi and -EB/-EL explicitly instead of relying on the
   compiler's default architecture.  PowerPC might be able to do the
   same thing, but as of today, powerpc-gcc would be required for
   powerpc and powerpcspe and powerpc64-gcc would be required for
   powerpc64.  Our existing logic for make universe does not permit
   per-MACHINE_ARCH toolchains.

I tried hacking TARGETS_powerpc to only include powerpc64 when
powerpc64-gcc was present, and while that skipped the 32-bit worlds,
it tried to build all the kernels.

Reported by:	jeff
Discussed with:	imp
2019-10-14 21:22:42 +00:00
Warner Losh 2f9520d5fe Wordsmith and simplify
Simplify expressions as suggested by jhb. The extra indirection made
sense in earlier versions of this patch, but not the final one.

While here, apply suggestion from emaste for wording of universe.
Also wordsmith awkwardly worded comment about when we effectively
neuter the universe build for an architecture.

Once llvm 9.0 has been vetted for mips and powerpc, I'll take them out
of these lists.
2019-10-09 21:18:46 +00:00
Warner Losh 3f376e4b54 Don't compile old gcc 4.2.1 archs by default in universe/tinderbox.
Only compile clang supporting architectures of amd64, arm, arm64,
i386, and riscv as part of universe. Compile the other architectures
if MAKE_OBSOLETE_GCC is defined. In all cases, explicit lists of
architectures in TARGETS= on the command line override.

For mips, powerpc and sparc64, do the same thing we do for risvc when
MAKE_OBSOLETE_GCC isn't defined and short-circuit their universe build
with an echo saying to install the xtoolchain port or pkg.

PR: 241134
Discussed on: arch@ (https://lists.freebsd.org/pipermail/freebsd-arch/2019-August/019674.html)
Differential Revision: https://reviews.freebsd.org/D21942
2019-10-09 20:59:10 +00:00
Kyle Evans c1d4532062 Add a top-level makeman target
Abstracting away the details of how src.conf(5) is generated is arguably a
good thing; do so with a top-level makeman target.
2019-10-01 15:10:35 +00:00
Emmanuel Vadot df2bb80bf0 pkgbase: Add the sub stage-packages targets to TGTS
This helps when you don't want to run the dependencies targets.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D20955
2019-07-24 08:00:00 +00:00
Mark Johnston 707b2d6586 Modernize the MAKE_JUST_KERNELS hint in the top-level makefile.
It doesn't make sense to limit to -j12 anymore, build scalability
is better than it used to be.  Fold the hint into the description
of the universe target.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20342
2019-05-24 15:45:43 +00:00
Enji Cooper 78b78a6d3b Fix a typo when sanity checking in the bootstrap-tools target
The path is incorrect for the linker in the error message. It should have been
/usr/bin/ld, not /usr/bin/cc .

Reviewed by:	emaste
Approved by:	emaste (mentor)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D19852
2019-04-09 16:17:31 +00:00
Eric van Gyzen 7c5f370d3b Update comment about 'universe' disk usage
It's 167 GB now (or 81 GB with ZFS lz4).

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2018-11-10 19:09:48 +00:00
Brooks Davis 0a9fcf3237 Add a top-level make target to rebuild all sysent files.
The sysent target is useful when changing makesyscalls.sh, when
making paired changes to syscalls.master files, or in a future where
freebsd32 sysent entries are built from the default syscalls.master.

Reviewed by:	bdrewery
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17899
2018-11-08 00:35:00 +00:00
Alex Richardson 8f62bca488 Allow building world without inheriting $PATH
Inheriting $PATH during the build phase can cause the build to fail when
compiling on a different system due to missing build tools or incompatible
versions somewhere in $PATH. This has cause build failures for us before
due to the jenkins slaves still running FreeBSD 10.
Listing the tools we depend on explicitly instead of just using whatever
happens to be in $PATH allows us to check that we don't accidentally add a
new build dependency.

All tools that do no need to be bootstrapped will now be symlinked to
${WORLDTMP}/legacy/bin and during the build phase $PATH will only contain
${WORLDTMP}. There is also a new variable "BOOTSTRAP_ALL_TOOLS" which can
be set to force compiling almost all bootstrap tools instead of symlinking
them. This will not bootstrap tools such as cp,mv, etc. since they may be
used during the build and for those we should really only be using POSIX
compatible options.

Furthermore, this change is required in order to be able to build on
non-FreeBSD hosts. While the same binaries may exist on Linux/MacOS they
often accept different flags or produce incompatible output.

Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16815
2018-11-05 19:51:10 +00:00
Brooks Davis e6d4316a45 Don't include the broken riscv64sf TARGET_ARCH in universe.
riscv64sf has been broken due to duplicate symbols for months and
degrades the quality of universe builds.  Remove it until this is
resolved leaving a comment to it is not re-added.

PR:		232085
Reviewed by:	emaste
Approved by:	re (gjb, kib)
Sponsored by:	DARPA, AFRL
2018-10-09 22:22:15 +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
Bryan Drewery b38b45af2f tinderbox: If the clang lookup fails fallback to the old default behavior.
This fixes errors from the MK_CLANG_BOOTSTRAP/MK_LLD_BOOTSTRAP lookups
to not force using XCC/XLD but to rather just build them as normal by
allowing their own bootstrap logic to work.

MFC after:	3 weeks
X-MFC-with:	r335711 r335769
Sponsored by:	Dell EMC
2018-06-28 18:22:20 +00:00
John Baldwin 32cec12c75 Include existing MAKE_PARAMS_<target> when determining the universe toolchain.
This fixes a warning for each RISCV target during universe by passing in
the required CROSS_TOOLCHAIN setting which will in turn set
CROSS_BINUTILS_PREFIX correctly.  It also ensures that a tinderbox build
uses the correct compiler for riscv.  Previously it was using the shared
clang compiler instead of riscv64-gcc.

Reviewed by:	bdrewery
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D16049
2018-06-28 18:19:46 +00:00
Devin Teske 37e29448ea Fix typo in top-level Makefile
Submitted by:	Ben Widawsky <ben.widawsky@intel.com>
MFC after:	3 days
X-MFC-to:	stable/11 stable/10
Sponsored by:	Smule, Inc.
Differential Revision:	https://reviews.freebsd.org/P186
2018-06-27 22:15:50 +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 581672388f tinderbox: Give details about kernel builds.
This is a bit noisy now but it was silent before leading to
wondering if it was doing anything.

MFC after:	1 week
Suggested by:	rpokala
Sponsored by:	Dell EMC
2018-06-27 16:57:59 +00:00
Bryan Drewery d406018534 Only look for NOTES as needed.
Sponsored by:	Dell EMC
2018-06-20 19:45:04 +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
Ed Maste ff3a8b3427 Restore arm, riscv, sparc64, and mips to UNIVERSE after r334128 2018-05-24 14:01:22 +00:00
Matt Macy e98bbcf9ca libpmcstat: compile in events based on json description 2018-05-24 04:30:06 +00:00
Bryan Drewery 9d5beec1b9 Don't read SRC_ENV_CONF for MAKEOBJDIRPREFIX guard.
This is mostly to allow using MAKEOBJDIRPREFIX in src-env.conf on stable where
src.sys.obj.mk is not going to be MFC'd.  It is still valid on head but
effectively a NOP due to MAKEOBJDIRPREFIX being handled differently in
src.sys.obj.mk.

Reported by:	eadler
MFC after:	1 week
Sponsored by:	Dell EMC
2018-03-03 23:23:23 +00:00
Warner Losh 207efdb345 Add a note about why we have the conditional before including
bsd.compiler.mk. It's so fmake from older 9.x systems still
works (still a supported build config, and having the note here
will let us know when we can cull it more easily).

Also pull in a related change from include to sinclude from
arichardson@'s cross building work, as well as it's companion in
Makefile.inc1 with a note about why we do the odd thing there.

Submitted by: archardson
Differential Revision: https://reviews.freebsd.org/D14241
2018-02-07 16:28:26 +00:00
Alex Richardson 95eff7c0c3 crossbuild: Make the CHECK_TIME variable work on Linux
Linux /usr/bin/find doesn't understand the -mtime -0s flag.
Instead create a temporary file and compare that file's mtime to
sys/sys/param.h to check whether the clock is correct.

Reviewed By:	jhb, imp
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14157
2018-02-06 15:41:45 +00:00
Bryan Drewery 1ccacaed5f tinderbox/universe: Don't execute KERNCONFS lookup if not needed.
Sponsored by:	Dell EMC
2017-12-07 00:31:28 +00:00
Bryan Drewery 9ef3e71cac Revert r325529: No longer needed after r325699.
Sponsored by:	Dell EMC
2017-12-07 00:31:10 +00:00
Warner Losh 573a3ef083 Use TARGET_ARCH=riscv64 when TARGET=riscv
The supported targets are riscv64 and riscv64sf. Use the former when
building with a bare TARGET=riscv and it is the more common one.

Sponsored by: Netflix
2017-11-21 19:23:12 +00:00
Bryan Drewery a7fa261e37 Move top-level AUTO_OBJ logic to Makefile.sys.inc.
Sponsored by:	Dell
2017-11-18 20:01:12 +00:00
Warner Losh 1cbb58886a Remove build system support for lint.
Differential Revision: https://reviews.freebsd.org/D13124
2017-11-17 18:16:46 +00:00
Bryan Drewery d7a699d3d8 Rework r325568 so all 'make LINT' targets work.
Reported by:	ngie
Sponsored by:	Dell EMC Isilon
2017-11-13 20:49:08 +00:00
Bryan Drewery d8d24cec9f META_MODE: Avoid some logic if disabled and allow enabling with make argument.
Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:50 +00:00
Bryan Drewery 58d86ed342 AUTO_OBJ: Disable in non-build targets.
There's no reason to create object directories for targets like 'installworld'
or 'distributeworld', and the others in this list.  Specifying MK_AUTO_OBJ as a
make argument allows circumventing this if needed for some reason.

This fixes mergemaster creating a full object tree due to doing a 'make
installconfig' tree walk.

Reported by:	Mark Millard
Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:46 +00:00
Bryan Drewery 6555da9c5b Remove rerelease target that was added in r38978.
I'm not sure what this target is but it doesn't exist now and doesn't seem
to have existed before.

Sponsored by:	Dell EMC Isilon
2017-11-10 21:52:33 +00:00
Bryan Drewery 9cde684d49 native-xtools: Fix for GCC archs.
- This also adds in a _cleanobj step as needed.
- This redirects TARGET/TARGET_ARCH to NXB_TARGET/NXB_TARGET_ARCH in
  Makefile.inc1 as the main build needs to be for MACHINE rather
  than TARGET.

  First build the toolchain and then use that as an external toolchain
  to build the needed directories and NXB_TARGET-toolchain, all as
  MACHINE files though via TARGET_TRIPLE=MACHINE_TRIPLE.

  The NXBDIRS is evaluated in the 'everything' submake as it needs to be
  based on TARGET's src.opts.mk values, such as MK_GCC=yes when building
  on a MK_CLANG=yes MACHINE.  This can likely be changed to a specific
  _native-xtools-everything target later and the funky late evaluation
  of SUBDIR_OVERRIDE removed.

X-MFC-With:	r325001
Pointyhat to:	bdrewery
MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-11-10 19:53:07 +00:00
Bryan Drewery faa5a80eb4 Deal with src.conf for top-level MAKEOBJDIRPREFIX guard.
- Don't discard SRCCONF value since it may incorrectly have MAKEOBJDIRPREFIX
  in it.
- Add note about src.conf not being a suitable place for MAKEOBJDIRPREFIX.

Sponsored by:	Dell EMC Isilon
2017-11-10 02:09:37 +00:00
Bryan Drewery 4556d0795f universe: Fix creating LINT files with AUTO_OBJ.
These are expected to be created in .CURDIR.

Reported by:	kib
Sponsored by:	Dell EMC Isilon
2017-11-08 23:41:27 +00:00
Bryan Drewery 1ca30d8e1c AUTO_OBJ: Don't create TARGET. directories during 'make universe'.
Reported by:	rpokala
Sponsored by:	Dell EMC Isilon
2017-11-08 02:28:24 +00:00
Bryan Drewery 2f4c7d14c8 Simplify location of bootstrap make.
Sponsored by:	Dell EMC Isilon
2017-11-05 00:11:55 +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 aee3a96ebe Something is very wrong 2017-11-02 22:23:00 +00:00
Bryan Drewery c10062b9bf Add a 'make cleanuniverse'.
This will remove all build files for the source directory
when MK_UNIFIED_OBJDIR is enabled.

Sponsored by:	Dell EMC Isilon
2017-11-01 21:22:10 +00:00
Bryan Drewery 051c25dbf3 Suggest TARGET/TARGET_ARCH, XDEV/XDEV_ARCH are depcrecated in r269031.
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-10-29 01:21:33 +00:00
Bryan Drewery 5bd47cc56f Change native-xtools to not install by default; add a native-xtools-install.
Without this the user has to mess with 'make -f Makefile.inc1 ...' to figure
out where the files are installed in the OBJDIR and then they need to copy them
to where they really wanted them. Using DESTDIR may be problematic after
r325001 as well.

The files will be installed to DESTDIR/NXTP where NXTP defaults to /nxb-bin.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-10-29 01:21:29 +00:00
Bryan Drewery 7441e255ed build(7): Document native-xtools.
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-10-29 01:21:22 +00:00
Bryan Drewery 24830684f2 Fix xdev TARGET/TARGET_ARCH assertion and expand to native-xtools.
The top of Makefile.inc1 requires TARGET/TARGET_ARCH be defined.  Just
building 'make xdev' would already set them, so this error was never
triggered.  Moving it to Makefile fixes the problem.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-10-29 01:21:19 +00:00
Bryan Drewery bb3f65ea64 Disable AUTO_OBJ as a make argument to ensure it really is disabled.
If the user sets this to yes as a make argument too we still want
to ensure these do not get enabled.

Sponsored by:	Dell EMC Isilon
2017-10-29 01:21:15 +00:00
Warner Losh 0b972ac92e Support armv7 builds for userland
Make armv7 as a new MACHINE_ARCH.

Copy all the places we do armv6 and add armv7 as basically an
alias. clang appears to generate code for armv7 by default. armv7 hard
float isn't supported by the the in-tree gcc, so it hasn't been
updated to have a new default.

Support armv7 as a new valid MACHINE_ARCH (and by extension
TARGET_ARCH).

Add armv7 to the universe build.

Differential Revision: https://reviews.freebsd.org/D12010
2017-10-05 23:01:33 +00:00
Bryan Drewery 96dd05dd7d Quote ${MAKE} when passing in env in case it contains spaces.
Downstream we are wrapping MAKE with a limits(1) call which
interferes with these non-quoted cases.

Sponsored by:	Dell EMC Isilon
2017-08-16 17:54:24 +00:00
Warner Losh 7709b2ae16 Make _TO_CPUARCH macro for ARCH to CPUARCH conversions
Consolidate all the regular expressions to convert from MACHINE_ARCH
to MACHINE_CPUARCH into a variable and use that variable in preference
to the almost identical copies in the tree (which should have been
identical).

Differential Revision: https://reviews.freebsd.org/D11986
2017-08-12 17:07:27 +00:00
Ed Maste 6d2909f6a0 genericize target exclusion for missing external toolchain
Previously we excluded riscv from make universe / tinderbox if the
required xtoolchain package was not installed. Make that logic generic
so that we can loop over multiple architectures, in preparation to test
patches to have other architectures rely on external toolchain.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11652
2017-07-27 12:29:31 +00:00
Bryan Drewery 99eedcd6a4 Add some .ORDER for distrib-dirs, distribute, distribution and distributeworld.
Reported by:	Mark Millard
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-07-24 18:54:56 +00:00
Bryan Drewery 275219cfe7 Expose only the create-packages-* targets since they set needed DEST/DIRDIR.
The other targets just fail confusingly otherwise.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-06-23 18:27:00 +00:00
Bryan Drewery e02aaf7b5a Allow ALWAYS_BOOTSTRAP_MAKE to force bmake bootstrapping.
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-06-23 16:38:18 +00:00
Ian Lepore 7e2482d6bb By popular demand: change MAKE_GENERIC_KERNELS to MAKE_LINT_KERNELS.
It appears that the same arches that lack GENERIC kernel configs also lack
LINT.  But enough different arches get built to ensure a kernel change
should build everywhere (32 and 64 bit, clang and old gcc, little and big
endian).
2017-06-13 01:12:37 +00:00
Ian Lepore 1f14b5e4c0 Add support for "make universe_kernels -DMAKE_GENERIC_KERNELS" to build
just the GENERIC kernels for each arch (including variations such as
GENERIC-NODEBUG, GENERIC64, etc).

This helps with quickly doing a test build for all[*] arches without
building dozens of variant kernels for the arches that have lots of
hardware/board/system variations.

[*] Not all arches have a generic kernel (but they probably should for
test-building purposes, even if it can't boot on any real hardware).
2017-06-12 17:22:23 +00:00
Bryan Drewery 1a9cc831dd META_MODE: Add framework to force rebuilding for major ABI changes.
Normally META_MODE ignores host files for "meta mode" decisions on whether a
file should be rebuilt or not.  This is because a simple installworld can
update timestamps and cause the next build to rebuild all host tools, when the
previous ones may not have any changes in the source tree.  These tools are
normally still ABI compatible.  They are only rebuilt if NO_META_IGNORE_HOST is
set from the workaround/hack in r301467.

One of the major problems with this is when a host tool has objects spread
across many revisions that have mixed-ABI.  For example, if struct stat were to
change on the host, some objects for a tool may have different ideas of that
struct's definition.  If just 1 source file were modified and rebuilt and
linked into the tool, then that toll will have mixed-ABI objects and crash.
This exact thing happened with the ino64 commit in r301467 followed by a
trivial update to libbfd in r318750.  The resulting binary would crash in
buildworld.

Sponsored by:	Dell EMC Isilon
2017-06-05 05:17:39 +00:00
Bryan Drewery 848d5e929b Cache compiler metadata and reuse it at installworld time.
Right after cross-tools, a compiler-metadata.mk file is created that
stores all of the bsd.compiler.mk metadata.  It is then read in
with a fail-safe during installworld time.

The file is explicitly removed when invoking cross-tools to ensure that
a stale file is not left around from odd manual 'make _cross-tools' ->
'make installworld' invocations.

This fixes several issues:
    - With WITH_SYSTEM_COMPILER (default yes on head and no on releng/11.0):
      If you build on a system where the bootstrap compiler does not
      build due to the host compiler matching the in-tree one, but then
      installworld on another system where that logic fails (a
      bootstrap compiler is needed), the installworld immediately fails
      with:
           sh: cc: not found
      Note that fixing this logic may then hit a case where a rebuild is
      attempted in installworld.  Normally cc would be ran with
      'CFLAGS+=ERROR-tried-to-rebuild-during-make-install' to cause an
      error such as:
          cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-make-install'
      However, now it will just fail with the 'cc: not found' error.
      Inspection of the compile line will show
      'ERROR-tried-to-rebuild-during-make-install';  It's not useful to
      set CC to anything other than 'cc' during install as it is more
      helpful to see the attempted compile rather than some other bogus
      error.
    - This now avoids running bsd.compiler.mk (cc executions) even more
      during installworld.  There are compiler-dependent SUBDIR in the
      tree which required having a compiler during install.

There is at least 1 case where CC is still executed in the install,
such as from a LOOKUP!= in secure/lib/libcrypto/Makefile.inc checking
for 'vzeroall' support.  This is not significant for installworld
as the lookup has a fallback (and hides its error) and only modifies CFLAGS,
thus it's not worth fixing.

PR:		212877
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-04-13 22:07:34 +00:00
Ruslan Bukin 6d7d1e1ed8 Include RISC-V target to universe build.
Check if RISC-V external toolchain package is installed,
otherwise skip build.

Reviewed by:	emaste
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10344
2017-04-12 10:45:19 +00:00
Ed Maste 1b766820b0 Unconditionally include arm64 in make universe / tinderbox
As of r316629 FreeBSD/arm64 uses the in-tree LLD linker by default, and
does not require an external an aarch64-binutils port or package.

Sponsored by:	The FreeBSD Foundation
2017-04-08 16:14:30 +00:00
Yoshihiro Takahashi 2b375b4edd Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes:	yes
2017-01-28 02:22:15 +00:00
Ruslan Bukin 7804dd5212 Add full softfloat and hardfloat support for RISC-V.
Hardfloat is now default (use riscv64sf as TARGET_ARCH
for softfloat).

Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D8529
2016-11-16 15:21:32 +00:00
Ruslan Bukin 5bca221511 Add full softfloat and hardfloat support for MIPS.
This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8376
2016-10-31 15:33:58 +00:00
Justin Hibbits dc9b124d66 Create a new MACHINE_ARCH for Freescale PowerPC e500v2
Summary:
The Freescale e500v2 PowerPC core does not use a standard FPU.
Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor
unit, which doubles as a FPU.  The PowerPC SPE ABI is incompatible with the
stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this.
Additionaly, the SPE opcodes overlap with Altivec, so these are mutually
exclusive.  Taking advantage of this fact, a new file, powerpc/booke/spe.c, was
created with the same function set as in powerpc/powerpc/altivec.c, so it
becomes effectively a drop-in replacement.  setjmp/longjmp were modified to save
the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by
the SPE).

Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not
support double-precision floating point.

Also, without a new MACHINE_ARCH it would be impossible to provide binary
packages which utilize the SPE.

Additionally, no work has been done to support ports, work is needed for this.
This also means no newer gcc can yet be used.  However, gcc's powerpc support
has been refactored which would make adding a powerpcspe-freebsd target very
easy.

Test Plan:
This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222
(P1022-based) board, compiled against the new ABI.  Base system utilities
(/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot
multiuser.

Reviewed By:	bdrewery, imp
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D5683
2016-10-22 01:57:15 +00:00
Bryan Drewery 9e2f435fc1 Add a 'make print-dir' that simply traverses all directories and prints them.
This is useful for finding connected directories.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:52 +00:00
Bryan Drewery c8de0c57d7 Avoid showing the bootstrap make command for check-old, etc.
Reported by:	koobs
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-12 13:52:51 +00:00
Bryan Drewery 6597f1f81f make world: Allow installworld to be ran in parallel.
This has been safe for a while.

Sponsored by:	EMC / Isilon Storage Division
2016-08-08 18:13:03 +00:00
Bryan Drewery b17f5b2261 SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'.
1. Always calculate what the expected values are.
2. Add 'make test-system-compiler' to show all of the computed values
   vs the wanted values.
3. Extend the .info line to buildkernel/kernel-toolchain/toolchain/_cross-tools.
4. Consolidate all of the logic to one condition.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-07-24 18:05:05 +00:00
Bryan Drewery b987685fe0 Revert r302670 and r302671 for now.
MACHINE_CPUARCH smells like MACHINE except for arm64/aarch64 which
has it backwards.
2016-07-13 01:35:53 +00:00
Bryan Drewery 8a6bdc134d Create one list of replacements for MACHINE_CPUARCH as MACHINE_CPUARCH_SUB.
This also adds missing s/aarch64/arm64 to the sys.mk version and also
adds back armv6hf for universe since it was added to the sys.mk version
in r300438.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D7159
2016-07-12 18:57:25 +00:00
Bryan Drewery e5bf62aac7 WITH_META_MODE: Whitelist 'make kernel-toolchain'
Approved by:	re (blanket, META_MODE)
Sponsored by:	EMC / Isilon Storage Division
2016-06-22 19:07:41 +00:00
Bryan Drewery 9c8809d77f Fix top-level builds with fmake / 9.x.
Reported by:	allanjude
Approved by:	re (marius)
Sponsored by:	EMC / Isilon Storage Division
2016-06-21 20:14:32 +00:00
Bryan Drewery 8f8c247740 WITH_META_MODE: Whitelist 'make kernel' and 'make world'.
installkernel is technically META_MODE safe but doesn't need an explicit
approval to use it since it's all disabled via .PHONY.

world uses 'make -B installworld' which already will disable META_MODE
via the -B (.MAKE.MODE=compat) usage.

Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-15 23:58:06 +00:00
Bryan Drewery d97607185a tinderbox/universe: Only show arm64 warning if it was in the TARGETS list.
This was a flaw in my change in r287903 but also in the original change
in r282156 since it used empty(${TARGETS}) rather than empty(TARGETS).

Reported by:	lidl
Approved by:	re (gjb)
Sponsored by:	EMC / Isilon Storage Division
2016-06-15 23:58:00 +00:00
Bryan Drewery 3a3594e584 Fix makeman showing dependency of DIRDEPS_BUILD->META_MODE.
This broke in r301887 with the meta mode whitelist.  'make showconfig'
still needs WITH_META_MODE support.

Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-14 18:37:33 +00:00
Bryan Drewery b6d5c4f594 Fix build from stable/10 with fmake.
This was broken in r301888.

fmake does not look in share/mk by default and thus does not yet
have MK_META_MODE set with default.

Pointyhat to:	bdrewery
Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-14 17:23:22 +00:00
Bryan Drewery b8ef21b88a WITH_META_MODE: Lessen the filemon(4) requirement scope.
- Move the sys.mk filemon requirement to bsd.init.mk as a warning.
  This is intended only to show when building directly in a subdirectory
  without filemon loaded.
- Move the error into Makefile and only apply it when building
  from the META_TGT_WHITELIST target list.

-DNO_FILEMON can be used to suppress both the warning and the error but
makes WITH_META_MODE less useful.  It will only compare build commands
in this mode rather than track all dependencies.

This fixes installing from a jail which doesn't need filemon in this
phase [1].

Reported by:	Nikolai Lifanov <lifanov@mail.lifanov.com> [1]
Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-14 16:20:19 +00:00
Bryan Drewery 2c6fc926b3 WITH_META_MODE: Whitelist targets that are meta-mode-safe.
META_TGT_WHITELIST is added to define which build targets are safe for
meta mode.  See comments for more details.

This fixes 'make delete-old-libs' to properly show the interactive
prompt.

Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-14 16:20:14 +00:00
Bryan Drewery 341d14b404 Add more missing .PHONY
Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-14 16:20:08 +00:00
Bryan Drewery 6f4b2e7f5c Only include bsd.compiler.mk for bmakes that use -m .../share/mk by default.
Otherwise they error when trying to include the file, which also has
its own dependencies.

Sponsored by:	EMC / Isilon Storage Division
2016-06-05 23:05:17 +00:00
Bryan Drewery 3681768c3f WITH_META_MODE: Enable bmake's missing meta rebuild feature 2016-06-05 23:04:42 +00:00
Bryan Drewery bd2464674d Fix bmake version upgrade logic to use the new bmake.
Otherwise it was only used on the next build.

This was a flaw in r295980.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-06-05 23:04:15 +00:00
Warner Losh 2c0e9e2a09 Make armv6 hard float abi by default. Kill armv6hf.
Allow CPUTYPE=soft to build the current soft-float abi libraries.
Add UPDATING entry to announce this.

Approved by: re@ (gjb)
2016-05-18 06:01:18 +00:00
Bryan Drewery f62610d7bb Follow-up r298220: Don't pass down META_MODE which will still enable it.
Reported by:	Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by:	EMC / Isilon Storage Division
2016-04-18 18:39:43 +00:00
Bryan Drewery d7698c0722 META_MODE: Disable during installworld and similar.
META_MODE may create cookies during staging of files to WORLDTMP that would
also prevent installation of the files to the final DESTDIR, since the cookie
already exists.  This is not yet the case but will be soon.  Prevent other
similar issues by disabling META_MODE for any top-level install targets.

Sponsored by:	EMC / Isilon Storage Division
2016-04-18 18:14:05 +00:00
Glen Barber 0edd2576c0 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-16 02:32:12 +00:00
Bryan Drewery a561b1060c Mark some more .PHONY targets.
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:37 +00:00
Bryan Drewery 9b8f7eaf6a Define the *soft targets properly.
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 19:29:35 +00:00
Glen Barber d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00
Bryan Drewery 497e80911e Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.
Reviewed by:	emaste, hselasky (partial), brooks (brief)
Discussed on:	arch@
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5742
2016-03-30 23:50:23 +00:00
Glen Barber 538354481e MFH
Sponsored by:	The FreeBSD Foundation
2016-03-14 18:54:29 +00:00
Warner Losh bb52d711d0 Use the newly minted Makefile.libcompat to implement libsoft libraries
for the armv6 ABI switch. This also make WITH_LIBSOFT functional on
the arm platform. As a transition thing, this seems to work even
without switching the ABI (we basically build the same libraries
twice when MK_LIBSOFT=yes until the ABI cut over next
month). MK_LIBSOFT remains default no.
2016-03-12 23:25:05 +00:00
Bryan Drewery dfb898bee2 Avoid MK_TESTS error on stable/10 by just preventing SUBDIR recursion. 2016-03-11 19:28:43 +00:00
Bryan Drewery abaf3e4ee2 Avoid bmake upgrade NO_MAN warning by just setting MAN to empty.
Suggested by:	imp
2016-03-11 19:24:15 +00:00
Bryan Drewery 7b526e77f2 Revert r296645 as it breaks stable/10->head builds. 2016-03-11 17:21:27 +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