Commit Graph

2629 Commits

Author SHA1 Message Date
Bryan Drewery
699f93b956 Properly allow META_MODE to be set from environment.
Sponsored by:	EMC / Isilon Storage Division
2016-05-23 17:27:42 +00:00
Bryan Drewery
62c63e31e1 Use sed(1) to determine cc version rather than tail(1) since it is already in ITOOLS.
This fixes 'tail: not found' warnings in installworld after r300351.

Sponsored by:	EMC / Isilon Storage Division
2016-05-23 17:11:32 +00:00
Ian Lepore
aa1434ec54 Restore the translation of armv6hf->arm when generating MACHINE_CPUARCH.
It turns out we need to leave this in place for a while so that people
running self-hosting armv6hf systems can do the builds necessary to update
to armv6 (which is now hardfloat by default).
2016-05-22 21:31:20 +00:00
Bryan Drewery
6120aabd32 Opportunistically skip building a cross-compiler with SYSTEM_COMPILER set.
This will still build the compiler for the target but will not build the
bootstrap cross-compiler in the cross-tools phase.  Other toolchain
bootstrapping, such as elftoolchan and binutils, currently still occurs.

This will utilize the default CC (cc, /usr/bin/cc) as an external compiler.

This is planned to be on-by-default eventually.

This will utilize the __FreeBSD_cc_version compiler macro defined in the
source tree and compare it to CC's version.  If they match then the
cross-compiler is skipped.  If [X]CC is an external compiler (absolute
path) or WITHOUT_CROSS_COMPILER is already set, then this logic is skipped.
If the expected bootstrap compiler type no longer matches the found CC
compiler type (clang vs gcc), then the logic is skipped.  As an extra
safety check the version number is also compared from the compiler to
the tree version.

Clang:
  The macro FREEBSD_CC_VERSION is defined in:
    lib/clang/include/clang/Basic/Version.inc
  For clang -target will be used if TARGET_ARCH != MACHINE_ARCH.  This
  is from the current external toolchain logic.  There is currently an
  assumption that the host compiler can build the TARGET_ARCH.  This
  will usually be the case since we don't conditionalize target arch
  support in clang, but it will break when introducing new
  architectures.  This problem is mitigated by incrementing the version
  when adding new architectures.

GCC:
  The macro FBSD_CC_VER is defined in:
    gnu/usr.bin/cc/cc_tools/freebsd-native.h
  For GCC there is no simple -target support when TARGET_ARCH !=
  MACHINE_ARCH.  In this case the opportunistic skip is not done.  If we
  add proper support for this case in external toolchain logic then it
  will be fine to enable.

This relies on the macros being incremented whenever any change occurs
to these compilers that warrant rebuilding files.  It also should never
repeat earlier values.

Reviewed by:	brooks, bapt, imp
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6357
2016-05-21 01:32:23 +00:00
Bryan Drewery
95a83d05a3 Fetch the __FreeBSD_cc_version as COMPILER_FREEBSD_VERSION.
Reviewed by:	brooks, bapt, dim
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6356
2016-05-21 01:32:13 +00:00
Bryan Drewery
67b0a15ac4 Auto determine X_COMPILER_TYPE/X_COMPILER_VERSION if XCC is set.
Reviewed by:	brooks, bapt
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6355
2016-05-21 01:32:10 +00:00
Bryan Drewery
99dd498c18 WITH_META_MODE: Disable for 'make install' from top-level.
See r298220 for more explanation.  We don't want to prevent installing
if a cookie exists for the install target.

Sponsored by:	EMC / Isilon Storage Division
2016-05-21 01:31:54 +00:00
Bryan Drewery
3b828e4492 WITH_META_MODE: Fix suffix transformation rules with guessed dependencies.
This is the same problem as r290629.  With META_MODE we do not generate
.depend files, so there is no proper dependency to lookup.  Guessed
dependencies must be used.  If this proves to be a problem then we will
have to generate and use .depend files even with META_MODE.

Sponsored by:	EMC / Isilon Storage Division
2016-05-21 01:31:48 +00:00
Bryan Drewery
d0694f2738 WITH_DIRDEPS_BUILD: Fix forcing user to run bootstrap-tools.
This is a follow-up to r299289.  If the user did not run bootstrap-tools
for this directory then just build the tool as normal.  It assumes that
TARGET == MACHINE, but that was already the case before r299289.

Sponsored by:	EMC / Isilon Storage Division
2016-05-21 01:31:44 +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
Ed Maste
ce9d1e2acd Deorbit ALLOW_SHARED_TEXTREL
We want to avoid .text relocations in shared objects. libcrypto was the
only consumer and it is now fixed (as of r299389). Remove the now-unused
support for turning off the linker warning.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D6323
2016-05-11 17:55:09 +00:00
Bryan Drewery
73571281f5 DIRDEPS_BUILD: Exclude host tools for Makefile.depend.host as well.
Sponsored by:	EMC / Isilon Storage Division
2016-05-11 17:40:51 +00:00
John Baldwin
5f0263c120 Change the default installation directory for modules to /boot/modules.
Kernel installs always override KMODDIR when installing modules, so
this default setting is only used for standalone module builds.  Many
out-of-tree modules manually override KMODDIR already to avoid placing
modules in /boot/kernel.  This now makes that behavior the default.

Discussed on:	arch@
Reviewed by:	imp
Relnotes:	yes
2016-05-10 22:32:23 +00:00
Bryan Drewery
29df9f6b75 DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools.
This avoids running target binaries.

Sponsored by:	EMC / Isilon Storage Division
2016-05-09 22:21:09 +00:00
Enji Cooper
430f7286a5 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
  namespacing is kept with FILES appropriately, and that this shouldn't need
  to be repeated if the namespace changes -- only the definition of PACKAGE
  needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
  `tests`. In the event we get to the point where things can be split up
  enough in the base system, it would make more sense to group the tests
  with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
  previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
  bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
  ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
  and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
2016-05-04 23:20:53 +00:00
Bryan Drewery
a0c640c2a0 DIRDEPS_BUILD: Exclude secure/lib* libraries for host builds.
Sponsored by:	EMC / Isilon Storage Division
2016-05-04 03:13:48 +00:00
Pedro F. Giffuni
ca7f4027f7 share: minor spelling fixes.
Mostly comments but these tend to be user-visible.

MFC after:	2 weeks
2016-05-01 16:29:02 +00:00
Enji Cooper
f2a5d14c4a Allow FILESGROUPS to be specified more than once by pruning out duplicates
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-04-30 21:32:29 +00:00
Bryan Drewery
f19c33eed4 Fix error when SRCCONF is empty.
Sponsored by:	EMC / Isilon Storage Division
2016-04-22 20:31:29 +00:00
Bryan Drewery
4a70acf1dc Follow-up r298219: Don't error with 'make all install'.
Reported by:	kib
Sponsored by:	EMC / Isilon Storage Division
2016-04-21 16:12:55 +00:00
Simon J. Gerraty
30e2910007 Allow -f dirdeps.mk some/dir with no TARGET_MACHINE spec
Use $MACHINE if target does not specify.

Reviewed by:	bdrewery
2016-04-18 22:00:26 +00:00
Bryan Drewery
f31828ed9c META_MODE: Don't hide the .depend rm -f command.
Otherwise the build command changes every build.  META_MODE will
only remove it if something changes to warrant rebuilding
the file.

Sponsored by:	EMC / Isilon Storage Division
2016-04-18 21:11:55 +00:00
Bryan Drewery
e1dfa6572d Update meta2deps to fix crash when using -X with M2D_EXCLUDES. 2016-04-18 21:05:19 +00:00
Simon J. Gerraty
51c71d3e03 Update dirdeps.mk et al
dirdeps.mk: move logic to handle -f dirdeps.mk to inside check
for first read of dirdeps.mk

Also fix handling of WITHOUT_DIRDEPS_BELOW

gendirdeps.mk: pass M2D_EXCLUDES to meta2deps

meta.autodep.mk: if we build with nofilemon, leave a cookie to
prevent updating dependencies until cleaned.

Reviewed by:	bdrewery
2016-04-18 20:56:21 +00:00
Bryan Drewery
29fbb8071f Cause an error during 'make install' if trying to compile with CC.
This is limited to src-tree builds, meaning not extended to ports or other
out-of-tree builds.

This will help ensure that read-only OBJDIRS will be respected at install-time
by causing a more consistent failure for those who don't use a read-only
OBJDIR.  It also will cause Jenkins to yell.  This is a better solution than
trying to see CC=false as has been attempted and discussed before.

Of course this is only relevant for files generated by CC.

Disable this for META_MODE since it will detect the CFLAGS/command
change and force a rebuild.

Sponsored by:	EMC / Isilon Storage Division
2016-04-18 18:14:02 +00:00
Bryan Drewery
b964b94376 META_MODE: Clean .meta files with 'make cleandepend'.
Sponsored by:	EMC / Isilon Storage Division
2016-04-18 18:12:12 +00:00
Glen Barber
0edd2576c0 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-16 02:32:12 +00:00
Bryan Drewery
86abeac495 Document SHLIB/SHLIB_CXX/NO_PIC.
Sponsored by:	EMC / Isilon Storage Division
2016-04-15 18:49:26 +00:00
Bryan Drewery
21e2745698 Add SHLIB_CXX to allow building a C++ shared library without a static one.
Submitted by:	ngie
Sponsored by:	EMC / Isilon Storage Division
2016-04-15 18:43:54 +00:00
Enji Cooper
206c31c812 Regenerate the list of bsd.progs.mk supported variables
Prefix with dashes (unordered list) and put one variable on each
line (to avoid future conflicts)

Done via the following one-liner:

> sh -c 'for i in $(make -C tests/sys/aio PROG=foo -VPROG_VARS:O); do printf "\t\t- $i\n"; done'

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-04-14 22:32:56 +00:00
Enji Cooper
84833cfe39 Commit documentation change for r298012
Requested by: bdrewery
X-MFC with: r298012
Sponsored by: EMC / Isilon Storage Division
2016-04-14 22:23:15 +00:00
Enji Cooper
423e350b31 Add DEBUG_FLAGS to PROG_VARS and STRIP to PROG_OVERRIDE_VARS
This will allow the variables [*] to be overridden on a per-PROG basis,
which is useful when controlling "stripping" behavior for some tests
that require debug symbols or to be unstripped

DEBUG_FLAGS (similar to CFLAGS) supports appending, whereas STRIP is
an override

*: Due to how STRIP is defined in bsd.own.mk (in addition to
bsd.lib.mk and bsd.prog.mk), and the fact that bsd.test.mk pulls in
bsd.own.mk first, overriding STRIP doesn't work today.

A follow up commit is pending to "rectify" this after additional
testing is done.

Discussed with: bdrewery
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-04-14 22:22:03 +00:00
Bryan Drewery
d7296a8fae Implement the dependency condition more safely.
Nested : are not handled well without "".

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:49 +00:00
Bryan Drewery
2d9796bd24 Follow-up r297835: Let the intented default cookie work.
This happened to work for not prepending .OBJDIR twice but broke the
other case of prepending it when needed.

Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:45 +00:00
Bryan Drewery
94086cea27 Rework META_TARGETS so that it automatically adds META_DEPS to the targets.
This will only be done if the target is defined, so if the target is
defined after bsd.sys.mk is included then it needs to manually add
${META_DEPS} still.

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:42 +00:00
Glen Barber
a123f26e92 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-12 17:00:13 +00:00
Bryan Drewery
0457a4e053 META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.
Sponsored by:	EMC / Isilon Storage Division
2016-04-11 21:12:24 +00:00
Bryan Drewery
5528bda1b2 Revert r297833 which committed the wrong file 2016-04-11 21:12:00 +00:00
Bryan Drewery
63208a7a29 META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.
Sponsored by:	EMC / Isilon Storage Division
2016-04-11 21:10:14 +00:00
Glen Barber
d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00
Bryan Drewery
8e8df7d50a DIRDEPS_BUILD: Use 1 parameter for defining -rpath-link.
Sponsored by:	EMC / Isilon Storage Division
2016-04-04 23:15:57 +00:00
Bryan Drewery
9b8d26fdbc Follow-up r297282: Make the COPTS warning more useful.
Sponsored by:	EMC / Isilon Storage Division
2016-04-01 23:31:57 +00:00
Bryan Drewery
5a8d10d763 We don't support DPLIBS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-31 16:09:59 +00:00
Bryan Drewery
8f399aba4d Define OBJTOP earlier if possible for use in targets.
Sponsored by:	EMC / Isilon Storage Division
2016-03-31 14:48:17 +00:00
Bryan Drewery
0d0ef32951 DIRDEPS_BUILD: Don't reset OBJROOT in sub-makes.
MAKEOBJDIRPREFIX is set to blank and exported from MAKELEVEL0 along
with OBJROOT exported.  In sub-makes OBJROOT is recalculated with
an empty MAKEOBJDIRPREFIX though.

Sponsored by:	EMC / Isilon Storage Division
2016-03-31 00:26:40 +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
Bryan Drewery
cfbf3971dc Remove redundant code imported into dirdeps.mk in r290956.
Sponsored by:	EMC / Isilon Storage Division
2016-03-30 21:31:34 +00:00
Warner Losh
b1101485df Support simple soft floating point abi for CPUTYPE in arm. Complex
types to follow.
2016-03-28 17:32:31 +00:00
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