On 05/18/2016 11:25 PM, Michael Tokarev wrote: > Yes, my bad, I looked in the wrong branch and thought > the patch is applied.
Attaching an updated patch which applies to the current 2.6 package of qemu in unstable. I am testing now whether qemu builds fine on sparc64 with the patch applied. Would be great if you could then apply the patch to the qemu Debian package until it has been merged upstream or fixed otherwise. Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Description: Fix linker options on sparc* On sparc*, qemu fails to build from source because passing both -r and --relax at the same time is not allowed here. This patch adds a check to the configure time whether -r and --relax at the same time are accepted by the linker and passes --no-relax to the linker in case the test result is negative. . --- qemu-2.6+dfsg.orig/configure +++ qemu-2.6+dfsg/configure @@ -4520,6 +4520,18 @@ if compile_prog "" "" ; then have_fsxattr=yes fi +################################################# +# Sparc implicitly links with --relax, which is +# incompatible with -r. It does no harm to give +# it on other platforms too. + +cat > $TMPC << EOF +int foo(void) { return 0; } +EOF +if compile_prog "" "-nostdlib -Wl,-r -Wl,--no-relax"; then + LD_REL_FLAGS="-Wl,--no-relax" +fi + ########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -5525,6 +5537,7 @@ else fi echo "LDFLAGS=$LDFLAGS" >> $config_host_mak echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak +echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak echo "LIBS+=$LIBS" >> $config_host_mak echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak --- qemu-2.6+dfsg.orig/rules.mak +++ qemu-2.6+dfsg/rules.mak @@ -93,7 +93,7 @@ module-common.o: CFLAGS += $(DSO_OBJ_CFL $(if $(findstring /,$@),$(call quiet-command,cp $@ $(subst /,-,$@), " CP $(subst /,-,$@)")) -LD_REL := $(CC) -nostdlib -Wl,-r +LD_REL := $(CC) -nostdlib -Wl,-r $(LD_REL_FLAGS) %.mo: $(call quiet-command,$(LD_REL) -o $@ $^," LD -r $(TARGET_DIR)$@")