gold linker: Fix SYSROOT definition (unbreaks world for some)
authorJohn Marino <draco@marino.st>
Sun, 15 Nov 2015 23:11:53 +0000 (00:11 +0100)
committerJohn Marino <draco@marino.st>
Sun, 15 Nov 2015 23:15:57 +0000 (00:15 +0100)
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
contrib/binutils-2.24/gold/options.cc
contrib/binutils-2.25/README.DRAGONFLY
contrib/binutils-2.25/gold/options.cc
gnu/usr.bin/binutils224/Makefile.gld
gnu/usr.bin/binutils224/libgold/config.h
gnu/usr.bin/binutils225/block2/libgold/config.h
gnu/usr.bin/binutils225/block3/Makefile.gld

index 1a55a4d..89abaa5 100644 (file)
@@ -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
index e4876be..000e6d0 100644 (file)
@@ -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);
index 74307c7..32c3341 100644 (file)
@@ -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
index 4fc0294..731061d 100644 (file)
@@ -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);
index 19a1691..630a666 100644 (file)
@@ -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
index 06b0cf0..7d6b08b 100644 (file)
 #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
index 76389b5..2930f13 100644 (file)
 #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
index 8ae3c03..8cdeb67 100644 (file)
@@ -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