[openwrt/openwrt] build: make sure asm gets built with -DPIC

LEDE Commits lede-commits at lists.infradead.org
Sat Apr 10 16:48:58 BST 2021


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/dc31191ec3e5cefc8eceb5b1525d14e8e81c59ed

commit dc31191ec3e5cefc8eceb5b1525d14e8e81c59ed
Author: Philip Prindeville <philipp at redfish-solutions.com>
AuthorDate: Fri Mar 19 15:09:45 2021 -0600

    build: make sure asm gets built with -DPIC
    
    Fixes issue openwrt/packages#14921, whereby inline ASM wasn't getting
    built as PIC; look at gmp-6.2.1/mpn/x86/pentium/popcount.asm for
    example:
    
    ifdef(`PIC',`
    ...
    
    for a routine that exists in both PIC and non-PIC versions.
    
    Make sure that wherever $(FPIC) gets passed as a variable expansion
    that it gets quoted where necessary (such as setting environment
    variables in shell commands).
    
    Signed-off-by: Philip Prindeville <philipp at redfish-solutions.com>
    (cherry picked from commit af22991e03cae55f96b06996df2ff16752cec5d5)
---
 rules.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rules.mk b/rules.mk
index 8f41ff5861..f31d9bb113 100644
--- a/rules.mk
+++ b/rules.mk
@@ -75,12 +75,12 @@ IS_PACKAGE_BUILD := $(if $(filter package/%,$(BUILD_SUBDIR)),1)
 OPTIMIZE_FOR_CPU=$(subst i386,i486,$(ARCH))
 
 ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be powerpc ))
-  FPIC:=-fPIC
+  FPIC:=-DPIC -fPIC
 else
-  FPIC:=-fpic
+  FPIC:=-DPIC -fpic
 endif
 
-HOST_FPIC:=-fPIC
+HOST_FPIC:=-DPIC -fPIC
 
 ARCH_SUFFIX:=$(call qstrip,$(CONFIG_CPU_TYPE))
 GCC_ARCH:=



More information about the lede-commits mailing list