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
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