Skip to contentSkip to conversation

prosody: build with -fPIC

PATCH New Thomas Petazzoni 2 participants 2 messages Nov 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 prosody: build with -fPIC

The prosody configure script defines CFLAGS as -fPIC -Wall, but because we pass our own CFLAGS, the -fPIC goes away, causing a build failure when building shared libraries on x86-64:

/home/test/autobuild/run/instance-0/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-amd-linux-gnu/6.2.0/../../../../x86_64-amd-linux-gnu/bin/ld: encodings.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

So let's pass this -fPIC flag explicitly in CFLAGS. We don't bother passing it conditionally !BR2_STATIC_LIBS because other packages (e.g lua) also pass -fPIC unconditionally.

Fixes:

http://autobuild.buildroot.net/results/7f0eb285b75cdeacb21a1f9a9f64d2f0cbbf1d59/

---
 package/prosody/prosody.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/prosody/prosody.mk +1 -1
index b98748e3b6..d19653503d 100644
@@ -21,7 +21,7 @@ endif
 PROSODY_CONF_OPTS = \
 	--with-lua=$(STAGING_DIR)/usr \
 	--c-compiler=$(TARGET_CC) \
-	--cflags="$(TARGET_CFLAGS)" \
+	--cflags="$(TARGET_CFLAGS) -fPIC" \
 	--linker=$(TARGET_CC) \
 	--ldflags="$(TARGET_LDFLAGS) -shared" \
 	--sysconfdir=/etc/prosody \
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/1 prosody: build with -fPIC

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

The prosody configure script defines CFLAGS as -fPIC -Wall, but because we pass our own CFLAGS, the -fPIC goes away, causing a build failure when building shared libraries on x86-64:

/home/test/autobuild/run/instance-0/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-amd-linux-gnu/6.2.0/../../../../x86_64-amd-linux-gnu/bin/ld: encodings.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

So let's pass this -fPIC flag explicitly in CFLAGS. We don't bother passing it conditionally !BR2_STATIC_LIBS because other packages (e.g lua) also pass -fPIC unconditionally.

Quoted 5 lines

Fixes:

http://autobuild.buildroot.net/results/7f0eb285b75cdeacb21a1f9a9f64d2f0cbbf1d59/

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard