From 73aed59334edc4b7518b9313495b18b83339d0d9 Mon Sep 17 00:00:00 2001 From: John Marino Date: Mon, 16 Nov 2015 00:11:53 +0100 Subject: [PATCH] gold linker: Fix SYSROOT definition (unbreaks world for some) The linkers are supposed to have a different system rool for the crosstool versions, but this was not working for the gold linker. As a result, the host libraries are getting picked up instead of the world object lib directories. This commit fixes the build problem. As a result, a local modification to a gold source file is been removed (for 2.24 and 2.25) --- contrib/binutils-2.24/README.DRAGONFLY | 1 - contrib/binutils-2.24/gold/options.cc | 4 ++-- contrib/binutils-2.25/README.DRAGONFLY | 1 - contrib/binutils-2.25/gold/options.cc | 4 ++-- gnu/usr.bin/binutils224/Makefile.gld | 3 ++- gnu/usr.bin/binutils224/libgold/config.h | 2 +- gnu/usr.bin/binutils225/block2/libgold/config.h | 2 +- gnu/usr.bin/binutils225/block3/Makefile.gld | 3 ++- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/binutils-2.24/README.DRAGONFLY b/contrib/binutils-2.24/README.DRAGONFLY index 1a55a4db27..89abaa5d46 100644 --- a/contrib/binutils-2.24/README.DRAGONFLY +++ b/contrib/binutils-2.24/README.DRAGONFLY @@ -12,5 +12,4 @@ A list of files and directories removed is in README.DELETED Local modifications applied to following files: bfd/bfdver.h (new) - gold/options.cc ld/ldlex.l diff --git a/contrib/binutils-2.24/gold/options.cc b/contrib/binutils-2.24/gold/options.cc index e4876be4db..000e6d07a3 100644 --- a/contrib/binutils-2.24/gold/options.cc +++ b/contrib/binutils-2.24/gold/options.cc @@ -1141,8 +1141,8 @@ General_options::finalize() || this->user_set_sysroot() || *TARGET_SYSTEM_ROOT != '\0') { - this->add_to_library_path_with_sysroot(USRDATA_PREFIX "/lib"); - this->add_to_library_path_with_sysroot(USRDATA_PREFIX "/usr/lib"); + this->add_to_library_path_with_sysroot("/lib"); + this->add_to_library_path_with_sysroot("/usr/lib"); } else this->add_to_library_path_with_sysroot(TOOLLIBDIR); diff --git a/contrib/binutils-2.25/README.DRAGONFLY b/contrib/binutils-2.25/README.DRAGONFLY index 74307c7e91..32c3341c07 100644 --- a/contrib/binutils-2.25/README.DRAGONFLY +++ b/contrib/binutils-2.25/README.DRAGONFLY @@ -12,5 +12,4 @@ A list of files and directories removed is in README.DELETED Local modifications applied to following files: bfd/bfdver.h (new) - gold/options.cc ld/ldlex.l diff --git a/contrib/binutils-2.25/gold/options.cc b/contrib/binutils-2.25/gold/options.cc index 4fc0294f6c..731061d565 100644 --- a/contrib/binutils-2.25/gold/options.cc +++ b/contrib/binutils-2.25/gold/options.cc @@ -1142,8 +1142,8 @@ General_options::finalize() || this->user_set_sysroot() || *TARGET_SYSTEM_ROOT != '\0') { - this->add_to_library_path_with_sysroot(USRDATA_PREFIX "/lib"); - this->add_to_library_path_with_sysroot(USRDATA_PREFIX "/usr/lib"); + this->add_to_library_path_with_sysroot("/lib"); + this->add_to_library_path_with_sysroot("/usr/lib"); } else this->add_to_library_path_with_sysroot(TOOLLIBDIR); diff --git a/gnu/usr.bin/binutils224/Makefile.gld b/gnu/usr.bin/binutils224/Makefile.gld index 19a16916ea..630a666790 100644 --- a/gnu/usr.bin/binutils224/Makefile.gld +++ b/gnu/usr.bin/binutils224/Makefile.gld @@ -2,6 +2,7 @@ RELTOP:= .. RELSRC= ${RELTOP}/../../../contrib/binutils-2.24 SRCDIR= ${.CURDIR}/${RELSRC} +TSR= /${USRDATA_PREFIX} .PATH: ${SRCDIR}/gold @@ -15,7 +16,7 @@ CFLAGS+= -DGOLD_DEFAULT_SIZE=${GOLD_DEFAULT_SIZE} CFLAGS+= -DBINDIR="\"${TOOLS_PREFIX}${BINDIR}\"" CFLAGS+= -DTOOLBINDIR="\"${TOOLS_PREFIX}${BINDIR}\"" CFLAGS+= -DTOOLLIBDIR="\"${TOOLS_PREFIX}${LIBDIR}\"" -CFLAGS+= -DUSRDATA_PREFIX="\"${USRDATA_PREFIX}\"" +CFLAGS+= -DTARGET_SYSTEM_ROOT="\"${TSR:S|//|/|}\"" CFLAGS+= -I. -I${.CURDIR} CFLAGS+= -I${SRCDIR}/gold CFLAGS+= -I${SRCDIR}/include -I${SRCDIR}/elfcpp diff --git a/gnu/usr.bin/binutils224/libgold/config.h b/gnu/usr.bin/binutils224/libgold/config.h index 06b0cf00de..7d6b08b9da 100644 --- a/gnu/usr.bin/binutils224/libgold/config.h +++ b/gnu/usr.bin/binutils224/libgold/config.h @@ -225,7 +225,7 @@ #define STDC_HEADERS 1 /* System root for target files */ -#define TARGET_SYSTEM_ROOT "" +/* #define TARGET_SYSTEM_ROOT "" */ /* Whether the system root can be relocated */ #define TARGET_SYSTEM_ROOT_RELOCATABLE 0 diff --git a/gnu/usr.bin/binutils225/block2/libgold/config.h b/gnu/usr.bin/binutils225/block2/libgold/config.h index 76389b5578..2930f13dcc 100644 --- a/gnu/usr.bin/binutils225/block2/libgold/config.h +++ b/gnu/usr.bin/binutils225/block2/libgold/config.h @@ -231,7 +231,7 @@ #define STDC_HEADERS 1 /* System root for target files */ -#define TARGET_SYSTEM_ROOT "/" +/* #define TARGET_SYSTEM_ROOT "/" */ /* Whether the system root can be relocated */ #define TARGET_SYSTEM_ROOT_RELOCATABLE 0 diff --git a/gnu/usr.bin/binutils225/block3/Makefile.gld b/gnu/usr.bin/binutils225/block3/Makefile.gld index 8ae3c03017..8cdeb67643 100644 --- a/gnu/usr.bin/binutils225/block3/Makefile.gld +++ b/gnu/usr.bin/binutils225/block3/Makefile.gld @@ -11,6 +11,7 @@ RELTOP:= ../.. RELSRC= ${RELTOP}/../../../contrib/binutils-2.25 SRCDIR= ${.CURDIR}/${RELSRC} OBJTOP= ${.OBJDIR}/${RELTOP} +TSR= /${USRDATA_PREFIX} .PATH: ${SRCDIR}/gold @@ -20,7 +21,7 @@ CFLAGS+= -D_FILE_OFFSET_BITS=64 CFLAGS+= -DBINDIR="\"${TOOLS_PREFIX}${BINDIR}\"" CFLAGS+= -DTOOLBINDIR="\"${TOOLS_PREFIX}${BINDIR}\"" CFLAGS+= -DTOOLLIBDIR="\"${TOOLS_PREFIX}${LIBDIR}\"" -CFLAGS+= -DUSRDATA_PREFIX="\"${USRDATA_PREFIX}\"" +CFLAGS+= -DTARGET_SYSTEM_ROOT="\"${TSR:S|//|/|}\"" CFLAGS+= -I. -I${.CURDIR} -I${SRCDIR}/gold CFLAGS+= -I${SRCDIR}/include -I${SRCDIR}/elfcpp -- 2.41.0