baresip: fix build failure on 32bit x86 targets 225/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Thu, 7 Dec 2017 20:32:45 +0000 (21:32 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Thu, 7 Dec 2017 20:32:56 +0000 (21:32 +0100)
re and baresip builds for 32bit x86 targets are currently failing:

build-i386/sip/auth.o: In function `sip_auth_encode':
/build/lede-snapshots/i386_pentium/build/sdk/build_dir/target-i386_pentium_musl/re-0.5.6/src/sip/auth.c:279: undefined reference to `__stack_chk_fail_local'

The undefined references occur because there is no linking done to ssp.
Fix this by setting LD to TARGET_CC, so ld is not called directly. This
also means one patch is not needed anymore.

Do the same for rem and restund as they basically all share the same
build system.

Compile-tested for x86, x86_64 and mips.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
libs/re/Makefile
libs/re/patches/003-fix-linker-call.patch [deleted file]
libs/rem/Makefile
net/baresip/Makefile
net/restund/Makefile

index d1fc68c7e79c0913011b5d92d3e5aeeb8e6785cf..5ce0c58a7288681cec8552144cec93056109d779 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=re
 PKG_VERSION:=0.5.6
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.creytiv.com/pub
@@ -41,6 +41,9 @@ endef
 # CFLAGS are picked up from the environment, as well as CPPFLAGS (and LD etc.).
 # But LDFLAGS aren't picked up, so they need to be handed over via
 # EXTRA_LFLAGS.
+#
+# LD is changed to TARGET_CC to fix build failures on x86 32bit. Without this
+# there's no linking to ssp, which results in undefined references.
 
 ifneq ($(CONFIG_USE_GLIBC)$(CONFIG_USE_MUSL),)
 TARGET_CFLAGS+=-D_GNU_SOURCE
@@ -48,6 +51,7 @@ endif
 
 MAKE_FLAGS+= \
        EXTRA_LFLAGS="$(TARGET_LDFLAGS)" \
+       LD="$(TARGET_CC)" \
        SYSROOT="$(shell $(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s|/include/pthread.h||p')" \
        SYSROOT_ALT="$(STAGING_DIR)/usr" \
        RELEASE=1
diff --git a/libs/re/patches/003-fix-linker-call.patch b/libs/re/patches/003-fix-linker-call.patch
deleted file mode 100644 (file)
index 263bbb2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/mk/re.mk
-+++ b/mk/re.mk
-@@ -235,7 +235,7 @@ ifeq ($(OS),linux)
-       LFLAGS          += -fPIC
-       SH_LFLAGS       += -shared
-       MOD_LFLAGS      +=
--      APP_LFLAGS      += -rdynamic
-+      APP_LFLAGS      += --export-dynamic
-       AR              := ar
-       AFLAGS          := crD
- endif
index ab4f503f2b56fcd46a6e6c5a290134b929b0e5ae..d50ae87a68d17349a3fcc9cd4765a38e173e0484 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rem
 PKG_VERSION:=0.5.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.creytiv.com/pub
@@ -35,6 +35,7 @@ endef
 
 MAKE_FLAGS+= \
        EXTRA_LFLAGS="$(TARGET_LDFLAGS)" \
+       LD="$(TARGET_CC)" \
        LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \
        LIBRE_INC="$(STAGING_DIR)/usr/include/re" \
        LIBRE_SO="$(STAGING_DIR)/usr/lib" \
index 9e47f5994a665730772bd0aad7f96ab8c67ed41f..65d199b1036e71d54e66b31af10b73f1a3f15189 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=baresip
 PKG_VERSION:=0.5.6
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.creytiv.com/pub
@@ -93,6 +93,7 @@ BARESIP_MOD_OPTIONS:= \
 
 MAKE_FLAGS+= \
        EXTRA_LFLAGS="$(TARGET_LDFLAGS)" \
+       LD="$(TARGET_CC)" \
        LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \
        LIBRE_INC="$(STAGING_DIR)/usr/include/re" \
        LIBRE_SO="$(STAGING_DIR)/usr/lib" \
index d2518cde9a9584ac24feaf131b87d56e8aac6915..21c956e4308c7c1e214189b3a6c1a3d3cefec80a 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=restund
 PKG_VERSION:=0.4.12
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.creytiv.com/pub
@@ -48,6 +48,7 @@ RESTUND_MOD_OPTIONS:= \
 
 MAKE_FLAGS+= \
        EXTRA_LFLAGS="$(TARGET_LDFLAGS)" \
+       LD="$(TARGET_CC)" \
        LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \
        LIBRE_INC="$(STAGING_DIR)/usr/include/re" \
        LIBRE_SO="$(STAGING_DIR)/usr/lib" \