Nebula 1.1.0 版本:
因为可执行文,一般都要求加上安全项fPIE pie
然而当增加安全编译连接选项:-fPIE -pie
set(CMAKE_EXE_LINKER_FLAGS “${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie”)
出现编译错误:
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: /opt/vesoft/third-party/lib64/librocksdb.a(transaction_db_mutex_impl.cc.o): relocation R_X86_64_32S against symbol `_ZTVN7rocksdb24TransactionDBCondVarImplE' can not be used when making a shared object; recompile with -fPIC
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: /opt/vesoft/third-party/lib64/librocksdb.a(transaction_lock_mgr.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: /opt/vesoft/third-party/lib64/librocksdb.a(transaction_util.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: /opt/vesoft/third-party/lib64/librocksdb.a(write_prepared_txn.cc.o): relocation R_X86_64_32S against symbol `_ZNK7rocksdb12SnapshotImpl17GetSequenceNumberEv' can not be used when making a shared object; recompile with -fPIC
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: /opt/vesoft/third-party/lib64/librocksdb.a(write_unprepared_txn_db.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: /opt/vesoft/third-party/lib64/librocksdb.a(write_batch_with_index.cc.o): relocation R_X86_64_32S against `.rodata._ZNK7rocksdb16WBWIIteratorImpl5EntryEv.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: /opt/vesoft/third-party/lib64/librocksdb.a(write_batch_with_index_internal.cc.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: /opt/vesoft/third-party/lib64/librocksdb.a(write_unprepared_txn.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/vesoft/toolset/gcc/7.5.0/libexec/gcc/x86_64-vesoft-linux/7.5.0/ld.bfd: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [bin/nebula-metad] Error 1
make[1]: *** [src/daemons/CMakeFiles/nebula-metad.dir/all] Error 2
求助一下专家