1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

makefiles: fix linking of PIE code

PIE documentation:
:
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
http://lfs.osuosl.org/hlfs/view/unstable/glibc/chapter02/pie.html

suggest to suply -fPIE (or -fpie) with -pie
during executable compilation.

When -fPIC and -fPIE are used together - -fPIE wins

Drop usage of -DPIE - we are not using this flag anywhere

TODO: cleanup linking flags
This commit is contained in:
Zdenek Kabelac 2014-09-18 18:14:21 +02:00
parent d450c7fb10
commit b72e9d3a93

View File

@ -158,8 +158,8 @@ endif
ifneq ("@STATIC_LINK@", "yes")
ifeq ("@HAVE_PIE@", "yes")
ifeq ("@HAVE_FULL_RELRO@", "yes")
EXTRA_EXEC_CFLAGS += -fPIE -DPIE
EXTRA_EXEC_LDFLAGS += -Wl,-z,relro,-z,now -pie
EXTRA_EXEC_CFLAGS += -fPIE
EXTRA_EXEC_LDFLAGS += -Wl,-z,relro,-z,now -pie -fPIE
CLDFLAGS += -Wl,-z,relro
endif
endif