uclibc++: honor ldflags, disable SSP
authorSteven Barth <cyrus@openwrt.org>
Fri, 19 Jun 2015 14:09:02 +0000 (14:09 +0000)
committerSteven Barth <cyrus@openwrt.org>
Fri, 19 Jun 2015 14:09:02 +0000 (14:09 +0000)
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 46066

package/libs/uclibc++/Makefile
package/libs/uclibc++/patches/010-honor-ldflags.patch [new file with mode: 0644]

index 1196926e8ccc7b8227629d10ebb5ca2eabf4218e..a726a1edad52c34cf88b6075555c85f0da3bdfd2 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uclibc++
 PKG_VERSION:=0.2.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=uClibc++-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://cxx.uclibc.org/src/
@@ -44,7 +44,7 @@ UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
        -e 's/mipsel.*/mips/' \
 )
 
-TARGET_CFLAGS += $(FPIC)
+TARGET_CFLAGS += $(FPIC) -fno-stack-protector
 
 ifneq ($(CONFIG_CCACHE),)
 TARGET_CXX=$(TARGET_CXX_NOCACHE)
@@ -55,8 +55,9 @@ MAKE_FLAGS:= \
        $(TARGET_CONFIGURE_OPTS) \
        CPU_CFLAGS="$(TARGET_CFLAGS)" \
        CROSS="$(TARGET_CROSS)" \
+       LDFLAGS="-Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,defs $(TARGET_LDFLAGS)" \
        CP="$(CP)" \
-       GEN_LIBS="-lc $(LIBGCC_S)" \
+       GEN_LIBS="-lc $(LIBGCC_S) -lssp" \
        check_as_needed=
 
 # check_as_needed overrides dependency on libgcc_s
diff --git a/package/libs/uclibc++/patches/010-honor-ldflags.patch b/package/libs/uclibc++/patches/010-honor-ldflags.patch
new file mode 100644 (file)
index 0000000..b1050cb
--- /dev/null
@@ -0,0 +1,23 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -3,9 +3,9 @@ include $(TOPDIR)Rules.mak
+ WR_CXX := WRAPPER_INCLUDEDIR=-I$(TOPDIR)include $(TOPDIR)bin/g++-uc
+-LDFLAGS += -nodefaultlibs -shared -Wl,-soname,$(SHARED_MAJORNAME) $(BUILD_EXTRA_LIBRARIES)
++EXTRA_LDFLAGS += -nodefaultlibs -shared -Wl,-soname,$(SHARED_MAJORNAME) $(BUILD_EXTRA_LIBRARIES)
+ ifneq ($(DODEBUG),y)
+-LDFLAGS += -Wl,-s
++EXTRA_LDFLAGS += -Wl,-s
+ endif
+ SRCS =        $(wildcard *.cpp)
+@@ -60,7 +60,7 @@ $(LIBNAME).a: libgcc_eh libsupc $(EXOBJS
+       $(RANLIB) $@
+ $(SHARED_FULLNAME): libgcc_eh libsupc $(EXOBJS)
+-      $(CC) $(LDFLAGS) -o $@ $(EXOBJS) $(SUPOBJS) $(GCCOBJS) $(LIBS)
++      $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $(EXOBJS) $(SUPOBJS) $(GCCOBJS) $(LIBS)
+       $(LN) $@ $(SHARED_MAJORNAME)
+       $(LN) $(SHARED_MAJORNAME) $(LIBNAME).so