elfutils: fix sparc64 build, -fPIC required
authorWaldemar Brodkorb <wbx@openadk.org>
Tue, 3 Nov 2015 21:04:38 +0000 (22:04 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 3 Nov 2015 21:10:17 +0000 (22:10 +0100)
Fixes following autobuild errors:
http://autobuild.buildroot.net/results/82cc7766d2c805146e94baf82a24d1002f56593d/
http://autobuild.buildroot.net/results/ca4ca362581ee0111cba389d1afbff287692c21b/

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/elfutils/elfutils.mk

index 838c3b881f7633aaef49290a4fe2198df5486a77..d96ef4120e8494150b7651159c9cc7514a1fc468 100644 (file)
@@ -16,9 +16,16 @@ ELFUTILS_PATCH = elfutils-portability-0.161.patch
 ELFUTILS_AUTORECONF = YES
 ELFUTILS_CONF_OPTS += --disable-werror
 
+ELFUTILS_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))
+
+# sparc64 needs -fPIC instead of -fpic
+ifeq ($(BR2_sparc64),y)
+ELFUTILS_CFLAGS += -fPIC
+endif
+
 # elfutils gets confused when lfs mode is forced, so don't
 ELFUTILS_CONF_ENV += \
-       CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
+       CFLAGS="$(ELFUTILS_CFLAGS)" \
        CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
 
 ELFUTILS_LDFLAGS = $(TARGET_LDFLAGS)