Skip to content
/ openwrt Public
forked from openwrt/openwrt

Commit

Permalink
build: make sure asm gets built with -DPIC
Browse files Browse the repository at this point in the history
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@redfish-solutions.com>
  • Loading branch information
pprindeville authored and ldir-EDB0 committed Mar 24, 2021
1 parent 1bf2b3f commit af22991
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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:=
Expand Down

0 comments on commit af22991

Please sign in to comment.