luasec: Replace -fPIC with $(FPIC)
authorRosen Penev <rosenp@gmail.com>
Tue, 2 Apr 2019 04:32:32 +0000 (21:32 -0700)
committerRosen Penev <rosenp@gmail.com>
Wed, 24 Apr 2019 18:13:48 +0000 (11:13 -0700)
Currently i386 and the PPC targets have issues linking issues.

https://github.com/openwrt/packages/issues/3319

says that replacing -fPIC with -fpic works.

Patch added to avoid package overriding settings set by toolchain and make
compilation less noisy

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry-picked from cf23dd2eb0944a9a64ecec37344d04bc0c66eb4e)

lang/luasec/Makefile
lang/luasec/patches/100-fix-compilation.patch [new file with mode: 0644]

index 4bf05acc9f4557fff40a8de90f47438879ef197c..71969a14b624d9e835513ea90e9d322fbf9e78a6 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luasec
 PKG_VERSION:=0.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/brunoos/luasec/archive/
@@ -40,6 +40,9 @@ endef
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += $(FPIC)
+
 MAKE_FLAGS += \
        INCDIR="$(TARGET_CPPFLAGS) -I." \
        LIBDIR="$(TARGET_LDFLAGS) -L./luasocket" \
diff --git a/lang/luasec/patches/100-fix-compilation.patch b/lang/luasec/patches/100-fix-compilation.patch
new file mode 100644 (file)
index 0000000..d668c05
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -13,8 +13,8 @@ WARN=-Wall -pedantic
+ BSD_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
+ BSD_LDFLAGS=-O -fPIC -shared $(LIBDIR)
+-LNX_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
+-LNX_LDFLAGS=-O -fPIC -shared $(LIBDIR)
++LNX_CFLAGS=$(INCDIR) $(DEFS)
++LNX_LDFLAGS=-shared $(LIBDIR)
+ MAC_ENV=env MACOSX_DEPLOYMENT_TARGET='$(MACVER)'
+ MAC_CFLAGS=-O2 -fno-common $(WARN) $(INCDIR) $(DEFS)