All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] prosody: build with -fPIC
@ 2017-11-06 20:04 Thomas Petazzoni
  2017-11-06 20:40 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni @ 2017-11-06 20:04 UTC (permalink / raw)
  To: buildroot

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/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/prosody/prosody.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/prosody/prosody.mk b/package/prosody/prosody.mk
index b98748e3b6..d19653503d 100644
--- a/package/prosody/prosody.mk
+++ b/package/prosody/prosody.mk
@@ -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 \
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] prosody: build with -fPIC
  2017-11-06 20:04 [Buildroot] [PATCH] prosody: build with -fPIC Thomas Petazzoni
@ 2017-11-06 20:40 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2017-11-06 20:40 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 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.

 > Fixes:

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

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-06 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 20:04 [Buildroot] [PATCH] prosody: build with -fPIC Thomas Petazzoni
2017-11-06 20:40 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.