diff mbox

[14/15] tst-quad1pie, tst-quad2pie: compile with -fPIE

Message ID 9de96df6-c531-50d1-879e-d6a82f272a8f@redhat.com
State New
Headers show

Commit Message

Florian Weimer Dec. 21, 2016, 1:35 p.m. UTC
On 12/19/2016 12:15 PM, Nix wrote:
> From: Nick Alcock <nick.alcock@oracle.com>
>
> With stack protection enabled, these files have external symbol
> references for the first time, so the fact that they are not compiled
> with -fPIE and are then linked into a -pie binary starts to hurt.
>
> v10: New.
>
> 	* sysdeps/x86_64/Makefile (CFLAGS-tst-quad1pie.c): Add PIE-ccflag.
> 	(CFLAGS-tst-quad2pie.c): Likewise.

This is what I committed.

Thanks,
Florian
diff mbox

Patch

x86_64: tst-quad1pie, tst-quad2pie: compile with -fPIE [BZ #7065]

With stack protection enabled, these files have external symbol
references for the first time, so the fact that they are not compiled
with -fPIE and are then linked into a -pie binary starts to hurt.

2016-12-21  Nick Alcock <nick.alcock@oracle.com>

	[BZ #7065]
	* sysdeps/x86_64/Makefile [$(subdir) = elf]
	(CFLAGS-tst-quad1pie.c, CFLAGS-tst-quad2pie.c): Add $(PIE-ccflag).

diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 6d99284..5f25893 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -49,6 +49,9 @@  extra-test-objs += tst-quadmod1pie.o tst-quadmod2pie.o
 $(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o
 $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
 
+CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
+CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
+
 tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 tst-audit10
 test-extras += tst-audit4-aux tst-audit10-aux
 extra-test-objs += tst-audit4-aux.o tst-audit10-aux.o