svn commit: r291321 - in head: lib/libdwarf lib/libelf lib/liblzma lib/libmd share/mk targets/pseudo/bootstrap-tools targets/pseudo/toolchain usr.bin/cxxfilt usr.bin/readelf usr.bin/xinstall
Bryan Drewery
bdrewery at FreeBSD.org
Wed Nov 25 19:44:54 UTC 2015
Author: bdrewery
Date: Wed Nov 25 19:44:51 2015
New Revision: 291321
URL: https://svnweb.freebsd.org/changeset/base/291321
Log:
META MODE: Fix 'make bootstrap-tools'.
The main problem was bitrot after elftoolchain being swapped in for the
GNU toolchain.
This also reworks how the list of 'host allowed' libraries is determined
to only allow INTERNALLIBs, which is needed for libelftc to come in.
For usr.bin/readelf use the same hack, as libelf and libdward, to bring in
the needed sys/ headers for host builds. This has not yet been a problem due
to readelf not being built as a host tool in buildworld. This is possible
in the meta build though when building the toolchain.
Sponsored by: EMC / Isilon Storage Division
Added:
head/usr.bin/cxxfilt/Makefile.depend
- copied, changed from r291320, head/lib/liblzma/Makefile.depend
Modified:
head/lib/libdwarf/Makefile
head/lib/libelf/Makefile
head/lib/liblzma/Makefile.depend
head/lib/libmd/Makefile.depend.host
head/share/mk/local.dirdeps.mk
head/share/mk/local.gendirdeps.mk
head/share/mk/src.libnames.mk
head/targets/pseudo/bootstrap-tools/Makefile
head/targets/pseudo/toolchain/Makefile.depend
head/usr.bin/readelf/Makefile
head/usr.bin/xinstall/Makefile.depend.host
Modified: head/lib/libdwarf/Makefile
==============================================================================
--- head/lib/libdwarf/Makefile Wed Nov 25 19:44:43 2015 (r291320)
+++ head/lib/libdwarf/Makefile Wed Nov 25 19:44:51 2015 (r291321)
@@ -76,7 +76,7 @@ SRCS= \
INCS= dwarf.h libdwarf.h
-#
+# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
# We need to link against the correct version of these files. One
# solution is to include ../../sys in the include path. This causes
# problems when a header file in sys depends on a file in another
Modified: head/lib/libelf/Makefile
==============================================================================
--- head/lib/libelf/Makefile Wed Nov 25 19:44:43 2015 (r291320)
+++ head/lib/libelf/Makefile Wed Nov 25 19:44:51 2015 (r291321)
@@ -65,7 +65,7 @@ SRCS= elf.c \
INCS= libelf.h gelf.h
-#
+# This same hack is in lib/libdwarf/Makefile and usr.bin/readelf/Makefile
# We need to link against the correct version of these files. One
# solution is to include ../../sys in the include path. This causes
# problems when a header file in sys depends on a file in another
Modified: head/lib/liblzma/Makefile.depend
==============================================================================
--- head/lib/liblzma/Makefile.depend Wed Nov 25 19:44:43 2015 (r291320)
+++ head/lib/liblzma/Makefile.depend Wed Nov 25 19:44:51 2015 (r291321)
@@ -7,7 +7,6 @@ DIRDEPS = \
include \
include/xlocale \
lib/${CSU_DIR} \
- lib/clang/include.host \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
Modified: head/lib/libmd/Makefile.depend.host
==============================================================================
--- head/lib/libmd/Makefile.depend.host Wed Nov 25 19:44:43 2015 (r291320)
+++ head/lib/libmd/Makefile.depend.host Wed Nov 25 19:44:51 2015 (r291321)
@@ -2,9 +2,6 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
- gnu/usr.bin/binutils/ld \
- gnu/usr.bin/binutils/nm \
- usr.bin/xinstall \
.include <dirdeps.mk>
Modified: head/share/mk/local.dirdeps.mk
==============================================================================
--- head/share/mk/local.dirdeps.mk Wed Nov 25 19:44:43 2015 (r291320)
+++ head/share/mk/local.dirdeps.mk Wed Nov 25 19:44:51 2015 (r291321)
@@ -28,15 +28,20 @@ DIRDEPS_FILTER+= N*.host
.for m in host common
M_dep_qual_fixes += C;($m),[^/.,]*$$;\1;
.endfor
-
#.info M_dep_qual_fixes=${M_dep_qual_fixes}
-# we want to supress these dependencies for host tools
-# but some libs are sadly needed.
-_need_host_libs= \
- lib/libc++ \
- lib/libcxxrt \
- lib/libdwarf \
- lib/libmd \
+
+# Cheat for including src.libnames.mk
+__<bsd.init.mk>__:
+# Pull in _INTERNALLIBS
+.include <src.libnames.mk>
+
+# Host libraries should mostly be excluded from the build so the
+# host version in /usr/lib is used. Internal libraries need to be
+# allowed to be built though since they are never installed.
+_need_host_libs=
+.for lib in ${_INTERNALLIBS}
+_need_host_libs+= ${LIB${lib:tu}DIR:S,^${ROOTOBJDIR}/,,}
+.endfor
N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}}
DIRDEPS_FILTER.host = \
Modified: head/share/mk/local.gendirdeps.mk
==============================================================================
--- head/share/mk/local.gendirdeps.mk Wed Nov 25 19:44:43 2015 (r291320)
+++ head/share/mk/local.gendirdeps.mk Wed Nov 25 19:44:51 2015 (r291321)
@@ -14,6 +14,7 @@ GENDIRDEPS_FILTER+= \
Ntargets/pseudo/stage* \
Ntools/*
+# Exclude toolchain which is handled special.
.if ${RELDIR:Mtargets*} == ""
.if ${RELDIR:Nusr.bin/clang/*:Ngnu/usr.bin/cc/*:Nlib/clang*} != ""
GENDIRDEPS_FILTER.host+= \
@@ -22,7 +23,17 @@ GENDIRDEPS_FILTER.host+= \
.endif
GENDIRDEPS_FILTER+= \
+ Nlib/clang/include.host \
+ Nusr.bin/addr2line.host \
+ Nusr.bin/ar.host \
Nusr.bin/clang/clang.host \
+ Nusr.bin/elfcopy.host \
+ Nusr.bin/elfdump.host \
+ Nusr.bin/nm.host \
+ Nusr.bin/readelf.host \
+ Nusr.bin/size.host \
+ Nusr.bin/strings.host \
+ Nusr.bin/strip.host \
Ngnu/usr.bin/cc* \
Ngnu/usr.bin/binutils*.host \
Modified: head/share/mk/src.libnames.mk
==============================================================================
--- head/share/mk/src.libnames.mk Wed Nov 25 19:44:43 2015 (r291320)
+++ head/share/mk/src.libnames.mk Wed Nov 25 19:44:51 2015 (r291321)
@@ -7,6 +7,9 @@
.error src.libnames.mk cannot be included directly.
.endif
+.if !target(__<src.libnames.mk>__)
+__<src.libnames.mk>__:
+
.include <src.opts.mk>
.if ${.OBJDIR:S,${.CURDIR},,} != ${.OBJDIR}
@@ -368,3 +371,4 @@ LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libb
LIBAMUDIR= ${ROOTOBJDIR}/usr.sbin/amd/libamu
LIBAMU?= ${LIBAMUDIR}/libamu/libamu.a
+.endif # !target(__<src.libnames.mk>__)
Modified: head/targets/pseudo/bootstrap-tools/Makefile
==============================================================================
--- head/targets/pseudo/bootstrap-tools/Makefile Wed Nov 25 19:44:43 2015 (r291320)
+++ head/targets/pseudo/bootstrap-tools/Makefile Wed Nov 25 19:44:51 2015 (r291321)
@@ -62,7 +62,7 @@ cross-tools build-tools bootstrap-tools:
touch $@
# MAKELEVEL=0 so that dirdeps.mk does its thing
-# LEGACY_TOOLS lets us use the bootstaped stuff above
+# LEGACY_TOOLS lets us use the bootstrapped stuff above
# TARGET* is so that MK_CLANG gets set correctly.
BSTCENV= \
MAKELEVEL=0 \
Modified: head/targets/pseudo/toolchain/Makefile.depend
==============================================================================
--- head/targets/pseudo/toolchain/Makefile.depend Wed Nov 25 19:44:43 2015 (r291320)
+++ head/targets/pseudo/toolchain/Makefile.depend Wed Nov 25 19:44:51 2015 (r291321)
@@ -5,44 +5,26 @@
.if !defined(MK_CLANG)
.include "${SRCTOP}/share/mk/src.opts.mk"
.endif
-DIRDEPS=
-.if ${MK_TOOLCHAIN} == "yes"
-DIRDEPS+= \
+DIRDEPS= \
+ gnu/usr.bin/binutils/as \
+ gnu/usr.bin/binutils/ld \
usr.bin/addr2line \
- usr.bin/cxxflit \
+ usr.bin/ar \
+ usr.bin/cxxfilt \
usr.bin/elfcopy \
+ usr.bin/elfdump \
usr.bin/nm \
usr.bin/readelf \
usr.bin/size \
- usr.bin/strip \
usr.bin/strings \
-
-.else
-DIRDEPS+= \
- gnu/usr.bin/binutils/addr2line \
- gnu/usr.bin/binutils/nm \
- gnu/usr.bin/binutils/readelf \
- gnu/usr.bin/binutils/size \
- gnu/usr.bin/binutils/strip \
- gnu/usr.bin/binutils/strings \
-
-.endif
-
-DIRDEPS+= \
+ usr.bin/strip \
usr.bin/xinstall \
- gnu/usr.bin/binutils/ar \
- gnu/usr.bin/binutils/as \
- gnu/usr.bin/binutils/ld \
- gnu/usr.bin/binutils/objcopy \
- gnu/usr.bin/binutils/objdump \
- gnu/usr.bin/binutils/ranlib \
-
-.if ${MK_CLANG} == "yes"
+.if ${MK_CLANG_BOOTSTRAP} == "yes"
DIRDEPS+= targets/pseudo/clang
.endif
-.if ${MK_GCC} == "yes"
+.if ${MK_GCC_BOOTSTRAP} == "yes"
DIRDEPS+= targets/pseudo/gcc
.endif
Copied and modified: head/usr.bin/cxxfilt/Makefile.depend (from r291320, head/lib/liblzma/Makefile.depend)
==============================================================================
--- head/lib/liblzma/Makefile.depend Wed Nov 25 19:44:43 2015 (r291320, copy source)
+++ head/usr.bin/cxxfilt/Makefile.depend Wed Nov 25 19:44:51 2015 (r291321)
@@ -7,10 +7,10 @@ DIRDEPS = \
include \
include/xlocale \
lib/${CSU_DIR} \
- lib/clang/include.host \
lib/libc \
lib/libcompiler_rt \
- lib/libthr \
+ lib/libelf \
+ lib/libelftc \
.include <dirdeps.mk>
Modified: head/usr.bin/readelf/Makefile
==============================================================================
--- head/usr.bin/readelf/Makefile Wed Nov 25 19:44:43 2015 (r291320)
+++ head/usr.bin/readelf/Makefile Wed Nov 25 19:44:51 2015 (r291321)
@@ -6,9 +6,23 @@ READELFDIR= ${ELFTCDIR}/readelf
.PATH: ${READELFDIR}
PROG= readelf
+SRCS= readelf.c
LIBADD= dwarf elftc elf
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
+# This same hack is in lib/libelf/Makefile and lib/libdward/Makefile
+# We need to link against the correct version of these files. One
+# solution is to include ../../sys in the include path. This causes
+# problems when a header file in sys depends on a file in another
+# part of the tree, e.g. a machine dependent header.
+#
+SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h
+CLEANDIRS= sys
+CFLAGS+= -I.
+sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
+ mkdir -p ${.OBJDIR}/sys
+ ln -sf ${.ALLSRC} ${.TARGET}
+
.include <bsd.prog.mk>
Modified: head/usr.bin/xinstall/Makefile.depend.host
==============================================================================
--- head/usr.bin/xinstall/Makefile.depend.host Wed Nov 25 19:44:43 2015 (r291320)
+++ head/usr.bin/xinstall/Makefile.depend.host Wed Nov 25 19:44:51 2015 (r291321)
@@ -2,7 +2,6 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
- gnu/usr.bin/binutils/ld \
lib/libmd \
More information about the svn-src-all
mailing list