Skip to content
  • Ahmad Samir's avatar
    Enable -fPIC to fix linking static libraries when building with Qt6 · 28b0d321
    Ahmad Samir authored and Tomaz  Canabrava's avatar Tomaz Canabrava committed
    Otherwise the build would fail:
    /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: ../lib/libkonsoleprivate_core.a(ShellCommand.cpp.o): warning: relocation against `_ZN7QString6_emptyE@@Qt_6' in read-only section `.text'
    /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: ../lib/libkonsoleprivate_core.a(ShellCommand.cpp.o): relocation R_X86_64_PC32 against symbol `_ZN10QByteArray6_emptyE@@Qt_6' can not be used when making a shared object; recompile with -fPIC
    /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: final link failed: bad value
    
    This seems to affect both STATIC and OBJECT CMake library types.
    28b0d321