aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-10-22 06:11:34 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-10-22 07:03:59 -0700
commitbec0b9f6f2e74c799e382bcf5154ecab6bd77c74 (patch)
tree6d943668fafe3790817516db44c3d917d559c0db /gold
parent6faad766e7515fe1b7e57d9d2857a9b661a98481 (diff)
downloadgdb-bec0b9f6f2e74c799e382bcf5154ecab6bd77c74.zip
gdb-bec0b9f6f2e74c799e382bcf5154ecab6bd77c74.tar.gz
gdb-bec0b9f6f2e74c799e382bcf5154ecab6bd77c74.tar.bz2
gold: Skip bootstrap-test/bootstrap-test-r for LTO build
Skip bootstrap-test and bootstrap-test-r for LTO build due to different build IDs. * Makefile.am (bootstrap-test): Skip for LTO build. (bootstrap-test-r): Likewise.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/Makefile.am16
-rw-r--r--gold/Makefile.in15
3 files changed, 32 insertions, 4 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 6f1abcc..fccf734 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2020-10-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.am (bootstrap-test): Skip for LTO build.
+ (bootstrap-test-r): Likewise.
+
2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
PR gold/23539
diff --git a/gold/Makefile.am b/gold/Makefile.am
index 3860e79..679f07d 100644
--- a/gold/Makefile.am
+++ b/gold/Makefile.am
@@ -284,10 +284,17 @@ editcc2 = -e 's/\([^ ]*\)\(.*\)/\1 -Bgcctestdir2\/\2/'
ld2_LINK = `echo $(CXXLD) | sed $(editcc2)`\
$(AM_CXXFLAGS) $(CXXFLAGS) $(ld2_LDFLAGS) $(LDFLAGS) -o $@
+TEST_READELF = $(top_builddir)/../binutils/readelf
+
+# Skip this for LTO build due to different build IDs.
bootstrap-test: ld2
rm -f $@
echo "#!/bin/sh" > $@
- echo "cmp ld1 ld2" >> $@
+ if $(TEST_READELF) -SW main.$(OBJEXT) | grep "gnu.lto" > /dev/null; then \
+ echo true >> $@; \
+ else \
+ echo "cmp ld1 ld2" >> $@; \
+ fi
chmod +x $@
libgold-1-r.o: gcctestdir1/ld libgold.a
@@ -314,10 +321,15 @@ editcc2r = -e 's/\([^ ]*\)\(.*\)/\1 -Bgcctestdir2-r\/\2/'
ld2_r_LINK = `echo $(CXXLD) | sed $(editcc2r)`\
$(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+# Skip this for LTO build due to different build IDs.
bootstrap-test-r: ld2-r
rm -f $@
echo "#!/bin/sh" > $@
- echo "cmp ld1-r ld2-r" >> $@
+ if $(TEST_READELF) -SW main.$(OBJEXT) | grep "gnu.lto" > /dev/null; then \
+ echo true >> $@; \
+ else \
+ echo "cmp ld1-r ld2-r" >> $@; \
+ fi
chmod +x $@
check_PROGRAMS = ld1 ld2 ld1-r ld2-r
diff --git a/gold/Makefile.in b/gold/Makefile.in
index f2906ed..28991b2 100644
--- a/gold/Makefile.in
+++ b/gold/Makefile.in
@@ -842,6 +842,7 @@ POTFILES = $(CCFILES) $(HFILES) $(TARGETSOURCES)
@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_LINK = `echo $(CXXLD) | sed $(editcc2)`\
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(AM_CXXFLAGS) $(CXXFLAGS) $(ld2_LDFLAGS) $(LDFLAGS) -o $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@TEST_READELF = $(top_builddir)/../binutils/readelf
@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_SOURCES = $(sources_var)
@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld gcctestdir1/collect-ld
@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
@@ -1625,10 +1626,15 @@ po/POTFILES.in: @MAINT@ Makefile
@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LN_S) $(abs_top_builddir)/ld1 $@
+# Skip this for LTO build due to different build IDs.
@GCC_TRUE@@NATIVE_LINKER_TRUE@bootstrap-test: ld2
@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "#!/bin/sh" > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "cmp ld1 ld2" >> $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ if $(TEST_READELF) -SW main.$(OBJEXT) | grep "gnu.lto" > /dev/null; then \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo true >> $@; \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ else \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "cmp ld1 ld2" >> $@; \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ fi
@GCC_TRUE@@NATIVE_LINKER_TRUE@ chmod +x $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@libgold-1-r.o: gcctestdir1/ld libgold.a
@@ -1642,10 +1648,15 @@ po/POTFILES.in: @MAINT@ Makefile
@GCC_TRUE@@NATIVE_LINKER_TRUE@libgold-2-r.o: gcctestdir2-r/ld libgold.a
@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a
+# Skip this for LTO build due to different build IDs.
@GCC_TRUE@@NATIVE_LINKER_TRUE@bootstrap-test-r: ld2-r
@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "#!/bin/sh" > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "cmp ld1-r ld2-r" >> $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ if $(TEST_READELF) -SW main.$(OBJEXT) | grep "gnu.lto" > /dev/null; then \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo true >> $@; \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ else \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "cmp ld1-r ld2-r" >> $@; \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ fi
@GCC_TRUE@@NATIVE_LINKER_TRUE@ chmod +x $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@gcctestdir3/ld gcctestdir3/collect-ld: ld-new