leveldb: generate pic for static libraries
authorGaël PORTAY <gael.portay@collabora.com>
Wed, 2 Jan 2019 20:56:29 +0000 (15:56 -0500)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Thu, 7 Mar 2019 21:45:49 +0000 (22:45 +0100)
commit088f261dbb89bb48a918a3153f293b86708c8a58
treed87a8ef056376f112e86d97acb53a5f0448aff6b
parent16f847340d07dce620e4c3fc0a099aa79898d86a
leveldb: generate pic for static libraries

The project's static libraries are not compiled with the -fPIC compiler
flag. This prevents dynamic libraries to link against those libraries.

This commit adds a patch that sets the -fPIC compiler flag to the list of
CFLAGS/CXXFLAGS.

The project now generates position independant code for all of its
outputs (i.e. not limited anymore to its shared libraries).

Fixes:

/home/gportay/src/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-amd-linux-gnu/6.2.0/../../../../x86_64-amd-linux-gnu/bin/ld: /home/gportay/src/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libmemenv.a(memenv.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/home/gportay/src/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libmemenv.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
[Arnout: renumber patch]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/leveldb/0003-Generate-position-independant-code-for-static-librar.patch [new file with mode: 0644]