summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2018-03-29 12:52:58 +0000
committeremaste <emaste@FreeBSD.org>2018-03-29 12:52:58 +0000
commit9eaf2e718a98d9b306221921223f72bcd2654d51 (patch)
treee8a45a8feee7e8c7123eb04c2315c8d5da630334 /Makefile.inc1
parent8d44e96c549ac602b1bca95375e9c2acffeb5f1d (diff)
downloadFreeBSD-src-9eaf2e718a98d9b306221921223f72bcd2654d51.zip
FreeBSD-src-9eaf2e718a98d9b306221921223f72bcd2654d51.tar.gz
MFC kernel build-id support
MFC r320244, r320245, r320246, r320247, r320248, r320249, r320250 (bdrewery): Add basic bsd.linker.mk auto included from bsd.compiler.mk. This will provide LINKER_TYPE and LINKER_VERSION. Support XLD for setting X_LINKER_TYPE and X_LINKER_VERSION. This is similar to r300350 for bsd.compiler.mk. Support cached linker values in environment. This is similar to r289659 for bsd.compiler.mk. LINKER_VERSION: Support external binutils. The ports binutils stores the version in the 5th word so just look for a version using a pattern instead. Don't overwrite already-set LINKER_VERSION/LINKER_TYPE. Provide proper values for X_LINKER_TYPE/VERSION when XLD == LD. Pass along LINKER_* vars during installworld and show in test-system-compiler. MFC r320258, r320272, r320275, r320502 (emaste): change GNU ld LINKER_TYPE from binutils to bfd GNU binutils includes two linkers: ld.bfd and ld.gold. For clarity use LINKER_TYPE=bfd to refer to ld.bfd, the original binutils linker that identifies itself as "GNU ld". bsd.linker.mk: add band-aid for linker invocation failure In some cases bsd.linker.mk reports an error like: make[4]: ".../share/mk/bsd.linker.mk" line 56: Unknown linker from LD=ld -m elf32ppc_fbsd:" For now change this to a .warning, and then assume GNU ld 2.17.50. At present the linker type detection is used only for enabling build-id, and we can carry on without it when type detection fails. Also, show errors from ${LD} --version to aid in failure diagnosis. Successful invocations of ${LD} --version produce no output on stderr so this will not create any spam in non-failing builds. enable --build-id for the kernel link A Build-ID is an identifier generated at link time to uniquely identify ELF binaries. It allows efficient confirmation that an executable or shared library and a corresponding standalone debuginfo file match. (Otherwise, a checksum of the debuginfo file must be calculated when opening it in a debugger.) The FreeBSD base system includes GNU bfd ld 2.17.50 as the linker for architectures other than arm64. Build-ID support was added to bfd ld shortly after that version, so was not previously available to us. We can now start making use of Build-ID as we migrate to using lld or bfd ld from ports, conditionally enabled based on the LINKER_TYPE and LINKER_VERSION make variables added in r320244 and subsequent commits. Introduce LINKER_FEATURES to avoid duplicating version logic MFC r327857 (bdrewery, submitted by Dan McGregor): Cache LINKER_FEATURES to fix the wrong ones being used. Sponsored by: Dell EMC Isilon Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc18
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 54bb91a..ee61d14 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -147,7 +147,8 @@ TEST_SYSTEM_COMPILER_VARS= \
WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \
WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \
CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \
- COMPILER_FREEBSD_VERSION
+ COMPILER_FREEBSD_VERSION \
+ LINKER_TYPE LINKER_FEATURES LINKER_VERSION
test-system-compiler: .PHONY
.for v in ${TEST_SYSTEM_COMPILER_VARS}
${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}"
@@ -179,7 +180,10 @@ CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \
_COMPILER_METADATA_VARS= COMPILER_VERSION \
COMPILER_TYPE \
COMPILER_FEATURES \
- COMPILER_FREEBSD_VERSION
+ COMPILER_FREEBSD_VERSION \
+ LINKER_VERSION \
+ LINKER_FEATURES \
+ LINKER_TYPE
compiler-metadata.mk: .PHONY .META
@: > ${.TARGET}
@echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \
OpenPOWER on IntegriCloud