summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2019-04-08 23:59:23 +0200
committerAndoni Morales Alastruey <ylatuya@gmail.com>2019-04-09 00:05:38 +0200
commit24cb64ce605865aeeb68710b71ee36654db3796b (patch)
tree66524d36531a563d78c2f62b64e2ba9dd2dc277b
parent02073df2cbabc1e1d5105be970a117675cca8579 (diff)
Fix support for static linking
Make sure that autotools projects are configured with PIC so that they can be linked statically. This fixes the following linker issues: dist/linux_x86_64/lib/libkate.a(lib_libkate_la-kate.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libopus.a(opus_multistream_encoder.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libsoup-2.4.a(libsoup_2_4_la-soup-auth.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libwavpack.a(libwavpack_la-common_utils.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libtag.a(id3v2framefactory.cpp.o): relocation R_X86_64_32S against `_ZTVN6TagLib5ID3v212FrameFactoryE' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libspeex.a(speex.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libvorbisenc.a(vorbisenc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libtheoradec.a(decinfo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libtiff.a(tif_close.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libjpeg.a(jcapimin.o): relocation R_X86_64_32S against `jpeg_natural_order' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libcairo-gobject.a(libcairo_gobject_la-cairo-gobject-structs.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libharfbuzz.a(libharfbuzz_la-hb-buffer.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libfontconfig.a(fccfg.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libexpat.a(xmlparse.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libfreetype.a(ftinit.o): relocation R_X86_64_32 against `tt_driver_class' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libpng16.a(png.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libpixman-1.a(pixman.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libxml2.a(entities.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libgnutls.a(record.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libgmp.a(pprime_p.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC dist/linux_x86_64/lib/libtasn1.a(coding.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
-rw-r--r--cerbero/build/build.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cerbero/build/build.py b/cerbero/build/build.py
index 2db01ee0..7b4888f8 100644
--- a/cerbero/build/build.py
+++ b/cerbero/build/build.py
@@ -436,6 +436,8 @@ class Autotools (MakefilesBase):
disable_introspection = False
async def configure(self):
+ # Build with PIC for static linking
+ self.configure_tpl += ' --with-pic '
# Only use --disable-maintainer mode for real autotools based projects
if os.path.exists(os.path.join(self.config_src_dir, 'configure.in')) or\
os.path.exists(os.path.join(self.config_src_dir, 'configure.ac')):
@@ -516,7 +518,8 @@ class CMake (MakefilesBase):
'-DCMAKE_INSTALL_BINDIR=%(prefix)s/bin ' \
'-DCMAKE_INSTALL_INCLUDEDIR=%(prefix)s/include ' \
'%(options)s -DCMAKE_BUILD_TYPE=Release '\
- '-DCMAKE_FIND_ROOT_PATH=$CERBERO_PREFIX '
+ '-DCMAKE_FIND_ROOT_PATH=$CERBERO_PREFIX '\
+ '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true '
@async_modify_environment
async def configure(self):