From 7059f94769a6cdf318a7aa173b9730a0e229b1e6 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 1 Apr 2019 21:32:32 -0700 Subject: [PATCH] luasec: Replace -fPIC with $(FPIC) 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 (cherry-picked from cf23dd2eb0944a9a64ecec37344d04bc0c66eb4e) --- lang/luasec/Makefile | 5 ++++- lang/luasec/patches/100-fix-compilation.patch | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 lang/luasec/patches/100-fix-compilation.patch diff --git a/lang/luasec/Makefile b/lang/luasec/Makefile index 4bf05acc9f..71969a14b6 100644 --- a/lang/luasec/Makefile +++ b/lang/luasec/Makefile @@ -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 index 0000000000..d668c05ec4 --- /dev/null +++ b/lang/luasec/patches/100-fix-compilation.patch @@ -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) -- 2.30.2