From ca1f728cbefd6955735087e45d80620113623b3b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 2 Mar 2015 14:53:11 -0800 Subject: Compile archives with -fno-pie When compiler defaults to PIE, we compile archives with -fno-pie. Since archives won't be used with PIE, compile them with -fpie isn't necessary. [BZ #17841] * Makeconfig (no-pie-ccflag): New. Set to -fno-pie. (pic-default): Don't define if $(no-pie-ccflag) is -fno-pie. (test-object-suffix): New. * Makerules (archive-objects): New. Set before including extra-lib.mk. ($(archive-objects)): New. New rule to append $(no-pie-ccflag) to CFLAGS. * extra-lib.mk (archive-objects): New. * crypt/Makefile ($(objpfx)md5test): Replace ".o" with $(test-object-suffix). ($(objpfx)md5test-giant): Likewise. ($(objpfx)sha256test): Likewise. ($(objpfx)sha512test): Likewise. * math/Makefile (LDFLAGS-atest-exp): New. (LDFLAGS-atest-sincos): Likewise. (LDFLAGS-atest-exp2): Likewise. --- Makeconfig | 15 ++++++++++++++- Makerules | 4 ++++ crypt/Makefile | 8 ++++---- extra-lib.mk | 5 +++++ math/Makefile | 3 +++ 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Makeconfig b/Makeconfig index 831604a050..f9c3b5e7d1 100644 --- a/Makeconfig +++ b/Makeconfig @@ -891,11 +891,15 @@ override CXXFLAGS = $(c++-sysincludes) \ $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \ $(CFLAGS-$(suffix $@)) $(CFLAGS-$(