libnss: workaround for microblaze ld bug
authorWaldemar Brodkorb <wbx@openadk.org>
Sat, 18 Feb 2017 21:40:02 +0000 (22:40 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 19 Feb 2017 21:23:21 +0000 (22:23 +0100)
Add a workaround for a microblaze specific ld bug to avoid
segfault.

Fixes:
  http://autobuild.buildroot.net/results/638a65453879777a0d5bdb29231034cd261b41c0

[Peter: rename to LIBNSS_DROP_GC_SECTIONS for clarity]
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/libnss/libnss.mk

index 4a40b0a8d726f8ea318be4b3aea7770829896801..76532e8117a77cf1ef258b7350ca4527d32961ce 100644 (file)
@@ -13,6 +13,16 @@ LIBNSS_DEPENDENCIES = libnspr sqlite zlib
 LIBNSS_LICENSE = MPLv2.0
 LIBNSS_LICENSE_FILES = nss/COPYING
 
+# --gc-sections triggers binutils ld segfault
+# https://sourceware.org/bugzilla/show_bug.cgi?id=21180
+ifeq ($(BR2_microblaze),y)
+define LIBNSS_DROP_GC_SECTIONS
+       sed -i 's:-Wl,--gc-sections::g' $(@D)/nss/coreconf/Linux.mk
+endef
+
+LIBNSS_PRE_CONFIGURE_HOOKS += LIBNSS_DROP_GC_SECTIONS
+endif
+
 LIBNSS_BUILD_VARS = \
        MOZILLA_CLIENT=1 \
        NSPR_INCLUDE_DIR=$(STAGING_DIR)/usr/include/nspr \