tools/tests/x86_emulator: Pass -no-pie -fno-pic to gcc on x86_32
authorIan Jackson <ian.jackson@citrix.com>
Tue, 1 Nov 2016 16:20:27 +0000 (16:20 +0000)
committerWolodja Wentland <debian@babilen5.org>
Wed, 15 Aug 2018 22:51:28 +0000 (23:51 +0100)
commitdfad0545661216fa84fd70f480774e7b43691e34
tree4d8113183f5dcecffc67bb3808a3cc1fde83bdea
parente0fe1cb3cd46762c188b4101062c0f7e66606d63
tools/tests/x86_emulator: Pass -no-pie -fno-pic to gcc on x86_32

The current build fails with GCC6 on Debian sid i386 (unstable):

 /tmp/ccqjaueF.s: Assembler messages:
 /tmp/ccqjaueF.s:3713: Error: missing or invalid displacement expression `vmovd_to_reg_len@GOT'

This is due to the combination of GCC6, and Debian's decision to
enable some hardening flags by default (to try to make runtime
addresses less predictable):
  https://wiki.debian.org/Hardening/PIEByDefaultTransition

This is of no benefit for the x86 instruction emulator test, which is
a rebuild of the emulator code for testing purposes only.  So pass
options to disable this.

These options will be no-ops if they are the same as the compiler
default.

On amd64, the -fno-pic breaks the build in a different way.  So do
this only on i386.

Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
squash! tools/tests/x86_emulator: Pass -no-pie -fno-pic to gcc

Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
Gbp-Pq: Name 0028-tools-tests-x86_emulator-Pass-no-pie-fno-pic-to-gcc-.patch
tools/tests/x86_emulator/Makefile