Skip to contentSkip to conversation

elfutils: fix sparc64 build, -fPIC required

PATCH New Waldemar Brodkorb 2 participants 4 messages Nov 3, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 elfutils: fix sparc64 build, -fPIC required

Fixes following autobuild errors:
http://autobuild.buildroot.net/results/82cc7766d2c805146e94baf82a24d1002f56593d/
http://autobuild.buildroot.net/results/ca4ca362581ee0111cba389d1afbff287692c21b/

---
 package/elfutils/elfutils.mk |    5 +++++
 1 file changed, 5 insertions(+)
package/elfutils/elfutils.mk +5 -0
index 838c3b8..261849a 100644
@@ -21,6 +21,11 @@ ELFUTILS_CONF_ENV += \
 	CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
 	CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
 
+# sparc64 needs -fPIC instead of -fpic
+ifeq ($(BR2_sparc64),y)
+ELFUTILS_CONF_ENV += CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) -fPIC"
+endif
+
 ELFUTILS_LDFLAGS = $(TARGET_LDFLAGS)
 
 # Unconditionnally requires gettext.
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 elfutils: fix sparc64 build, -fPIC required

Dear Waldemar Brodkorb,

Quoted 14 lines · Waldemar Brodkorb

Fixes following autobuild errors:
http://autobuild.buildroot.net/results/82cc7766d2c805146e94baf82a24d1002f56593d/
http://autobuild.buildroot.net/results/ca4ca362581ee0111cba389d1afbff287692c21b/

---
 package/elfutils/elfutils.mk |    5 +++++
 1 file changed, 5 insertions(+)
package/elfutils/elfutils.mk +0 -0
index 838c3b8..261849a 100644

package/elfutils/elfutils.mk ELFUTILS_CONF_ENV += \ · line 26

Quoted 6 lines
package/elfutils/elfutils.mk +3 -0
@@ -21,6 +21,11 @@ ELFUTILS_CONF_ENV += \
 	CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
 	CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
 
+# sparc64 needs -fPIC instead of -fpic
+ifeq ($(BR2_sparc64),y)
+ELFUTILS_CONF_ENV += CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) -fPIC"

I don't like the duplication of the _FILE_OFFSET_BITS dance. Can you introduce an ELFUTILS_CFLAGS instead ?

Also, for libpcap, -fPIC is needed instead of -fpic for both microblaze and sparc64. But for elfutils, -fPIC is only needed for sparc64 ? I just tested a quick build of elfutils on microblaze, and it indeed works without any change.

Do you have any clue why?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 elfutils: fix sparc64 build, -fPIC required

Hi Thomas,
Thomas Petazzoni wrote,

Quoted 20 lines

Dear Waldemar Brodkorb,

Quoted 17 lines · Waldemar Brodkorb

Fixes following autobuild errors:
http://autobuild.buildroot.net/results/82cc7766d2c805146e94baf82a24d1002f56593d/
http://autobuild.buildroot.net/results/ca4ca362581ee0111cba389d1afbff287692c21b/

---
 package/elfutils/elfutils.mk |    5 +++++
 1 file changed, 5 insertions(+)
package/elfutils/elfutils.mk +0 -0
index 838c3b8..261849a 100644
@@ -21,6 +21,11 @@ ELFUTILS_CONF_ENV += \
 	CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
 	CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
 
Quoted 6 lines

package/elfutils/elfutils.mk ELFUTILS_CONF_ENV += \ · line 26

Quoted 3 lines
package/elfutils/elfutils.mk +3 -0
+# sparc64 needs -fPIC instead of -fpic
+ifeq ($(BR2_sparc64),y)
+ELFUTILS_CONF_ENV += CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) -fPIC"

I don't like the duplication of the _FILE_OFFSET_BITS dance. Can you introduce an ELFUTILS_CFLAGS instead ?

Okay, I did know you wouldn't like it ;)

Quoted 6 lines

Also, for libpcap, -fPIC is needed instead of -fpic for both microblaze and sparc64. But for elfutils, -fPIC is only needed for sparc64 ? I just tested a quick build of elfutils on microblaze, and it indeed works without any change.

Do you have any clue why?

No idea, sorry.

best regards
Waldemar

#3 lore raw

PATCH 1/1 elfutils: fix sparc64 build, -fPIC required

Waldemar,

Quoted 4 lines · Waldemar Brodkorb
Quoted 2 lines

I don't like the duplication of the _FILE_OFFSET_BITS dance. Can you introduce an ELFUTILS_CFLAGS instead ?

Okay, I did know you wouldn't like it ;)

So why didn't you fix in the first iteration ? :-)

Quoted 8 lines
Quoted 6 lines

Also, for libpcap, -fPIC is needed instead of -fpic for both microblaze and sparc64. But for elfutils, -fPIC is only needed for sparc64 ? I just tested a quick build of elfutils on microblaze, and it indeed works without any change.

Do you have any clue why?

No idea, sorry.

In fact, libpcap builds just fine with -fPIC on Microblaze with the Buildroot toolchain. Maybe it was an issue with a specific toolchain a while ago.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com