build: make sure asm gets built with -DPIC
[openwrt/staging/jow.git] / rules.mk
index cbe1b0cb4c7f6fa9753f30ae90b2a7e1f08f7a83..f31d9bb113e25f83475177ca83125d98ba9346a6 100644 (file)
--- 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:=
@@ -428,6 +428,8 @@ $(shell \
 )
 endef
 
+abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))
+
 COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
 AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))