Skip to content

Commit

Permalink
[build] Prevent gcc from creating position-independent 32-bit code
Browse files Browse the repository at this point in the history
Some possibly-patched versions of gcc (observed with gcc 6.3.0 on
Debian Stretch and with gcc 7.2.0 on Arch) seem to default to creating
position-independent code.  This results in GOT relocation records
which are not handled by efireloc, causing a build failure.

Fix by adding -fno-pic to the 32-bit build options.

Reported-by: Brent S <bts@square-r00t.net>
Reported-by: Peter Capriccio <peter.capriccio@hpe.com>
Tested-by: Peter Capriccio <peter.capriccio@hpe.com>
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
  • Loading branch information
mcb30 committed Mar 14, 2018
1 parent f84f1d7 commit 55cfe8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Makefile
Expand Up @@ -32,7 +32,7 @@ HOST_CFLAGS += -Wall -W -Werror
CFLAGS += -Os -ffreestanding -Wall -W -Werror -nostdinc -I. -fshort-wchar
CFLAGS += -DVERSION="\"$(VERSION)\""

CFLAGS_i386 += -m32 -march=i386 -malign-double
CFLAGS_i386 += -m32 -march=i386 -malign-double -fno-pic
CFLAGS_x86_64 += -m64 -mno-red-zone -fpie

# Inhibit -fno-stack-protector
Expand Down

0 comments on commit 55cfe8a

Please sign in to comment.