Closed JamesLu000 closed 4 years ago
There is the installation in https://github.com/rime/librime/pull/368 Dockerfile.
不要用make thirdparty
。
請通過軟件包管理器安裝依賴。
https://github.com/rime/librime#build-dependencies
您好,我使用Cenotos7 编译时,也出现该问题,
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitterstate.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC我的make 日志如下:
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/rh/devtoolset-7/root/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/rh/devtoolset-7/root/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/lib/cmake/Boost-1.75.0/BoostConfig.cmake (found suitable version "1.75.0", minimum required is "1.46.0") found components: filesystem regex system
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
-- Checking for module 'capnp'
-- Found capnp, version 0.8.0
-- Checking for module 'capnp-rpc'
-- Found capnp-rpc, version 0.8.0
-- Checking for module 'capnp-json'
-- Found capnp-json, version 0.8.0
-- Checking for module 'kj'
-- Found kj, version 0.8.0
-- Checking for module 'kj-async'
-- Found kj-async, version 0.8.0
-- Checking for module 'kj-http'
-- Found kj-http, version 0.8.0
-- Checking for module 'kj-gzip'
-- Found kj-gzip, version 0.8.0
-- Checking for module 'kj-tls'
-- Found kj-tls, version 0.8.0
-- Checking for module 'kj-test'
-- Found kj-test, version 0.8.0
-- Found glog: /usr/local/lib64/libglog.a
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found GTest: /usr/local/lib64/libgtest.a
-- Found yaml-cpp: /usr/local/lib64/libyaml-cpp.a
-- Found leveldb: /usr/local/lib64/libleveldb.a
-- Found marisa: /usr/local/lib/libmarisa.so
-- Found opencc: /usr/lib/libopencc.so
-- Found X11/keysym.h at /root/pinyin/librime-master/thirdparty/include
-- compiled capnproto schemata (sources): /root/pinyin/librime-master/build/proto//rime_proto.capnp.c++
-- compiled capnproto schemata (headers): /root/pinyin/librime-master/build/proto//rime_proto.capnp.h
-- rime_plugins_libs:
-- rime_plugins_modules: plugins
-- compiled capnproto schemata (sources): /root/pinyin/librime-master/build/tools//rime_message.capnp.c++
-- compiled capnproto schemata (headers): /root/pinyin/librime-master/build/tools//rime_message.capnp.h
-- Configuring done
-- Generating done
-- Build files have been written to: /root/pinyin/librime-master/build
[root@analyze-40 build]# vim Makefile
[root@analyze-40 build]# make
[ 1%] Compiling Cap'n Proto schema rime_proto.capnp
Scanning dependencies of target rime-proto-objs
[ 1%] Building CXX object proto/CMakeFiles/rime-proto-objs.dir/rime_proto.capnp.c++.o
[ 1%] Built target rime-proto-objs
Scanning dependencies of target rime-plugins-objs
[ 2%] Building CXX object plugins/CMakeFiles/rime-plugins-objs.dir/plugins_module.cc.o
[ 2%] Built target rime-plugins-objs
Scanning dependencies of target rime
[ 2%] Building CXX object src/CMakeFiles/rime.dir/rime_api.cc.o
[ 3%] Building CXX object src/CMakeFiles/rime.dir/rime/candidate.cc.o
[ 4%] Building CXX object src/CMakeFiles/rime.dir/rime/commit_history.cc.o
[ 4%] Building CXX object src/CMakeFiles/rime.dir/rime/composition.cc.o
[ 5%] Building CXX object src/CMakeFiles/rime.dir/rime/context.cc.o
[ 6%] Building CXX object src/CMakeFiles/rime.dir/rime/core_module.cc.o
[ 7%] Building CXX object src/CMakeFiles/rime.dir/rime/deployer.cc.o
[ 7%] Building CXX object src/CMakeFiles/rime.dir/rime/engine.cc.o
[ 8%] Building CXX object src/CMakeFiles/rime.dir/rime/key_event.cc.o
[ 9%] Building CXX object src/CMakeFiles/rime.dir/rime/key_table.cc.o
[ 10%] Building CXX object src/CMakeFiles/rime.dir/rime/language.cc.o
[ 10%] Building CXX object src/CMakeFiles/rime.dir/rime/menu.cc.o
[ 11%] Building CXX object src/CMakeFiles/rime.dir/rime/module.cc.o
[ 12%] Building CXX object src/CMakeFiles/rime.dir/rime/registry.cc.o
[ 12%] Building CXX object src/CMakeFiles/rime.dir/rime/resource.cc.o
[ 13%] Building CXX object src/CMakeFiles/rime.dir/rime/schema.cc.o
[ 14%] Building CXX object src/CMakeFiles/rime.dir/rime/segmentation.cc.o
[ 15%] Building CXX object src/CMakeFiles/rime.dir/rime/service.cc.o
[ 15%] Building CXX object src/CMakeFiles/rime.dir/rime/setup.cc.o
[ 16%] Building CXX object src/CMakeFiles/rime.dir/rime/signature.cc.o
[ 17%] Building CXX object src/CMakeFiles/rime.dir/rime/switcher.cc.o
[ 18%] Building CXX object src/CMakeFiles/rime.dir/rime/ticket.cc.o
[ 18%] Building CXX object src/CMakeFiles/rime.dir/rime/translation.cc.o
[ 19%] Building CXX object src/CMakeFiles/rime.dir/rime/config/auto_patch_config_plugin.cc.o
[ 20%] Building CXX object src/CMakeFiles/rime.dir/rime/config/build_info_plugin.cc.o
[ 20%] Building CXX object src/CMakeFiles/rime.dir/rime/config/config_compiler.cc.o
[ 21%] Building CXX object src/CMakeFiles/rime.dir/rime/config/config_component.cc.o
[ 22%] Building CXX object src/CMakeFiles/rime.dir/rime/config/config_data.cc.o
[ 23%] Building CXX object src/CMakeFiles/rime.dir/rime/config/config_types.cc.o
[ 23%] Building CXX object src/CMakeFiles/rime.dir/rime/config/default_config_plugin.cc.o
[ 24%] Building CXX object src/CMakeFiles/rime.dir/rime/config/legacy_dictionary_config_plugin.cc.o
[ 25%] Building CXX object src/CMakeFiles/rime.dir/rime/config/legacy_preset_config_plugin.cc.o
[ 26%] Building CXX object src/CMakeFiles/rime.dir/rime/config/save_output_plugin.cc.o
[ 26%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/algebra.cc.o
[ 27%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/calculus.cc.o
[ 28%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/encoder.cc.o
[ 29%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/syllabifier.cc.o
[ 29%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/utilities.cc.o
[ 30%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/corrector.cc.o
[ 31%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/db.cc.o
[ 31%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/db_utils.cc.o
[ 32%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/dict_compiler.cc.o
[ 33%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/dict_module.cc.o
[ 34%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/dict_settings.cc.o
[ 34%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/dictionary.cc.o
[ 35%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/entry_collector.cc.o
[ 36%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/level_db.cc.o
[ 37%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/mapped_file.cc.o
[ 37%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/preset_vocabulary.cc.o
[ 38%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/prism.cc.o
[ 39%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/reverse_lookup_dictionary.cc.o
[ 39%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/string_table.cc.o
[ 40%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/table.cc.o
[ 41%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/table_db.cc.o
[ 42%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/text_db.cc.o
[ 42%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/tsv.cc.o
[ 43%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/user_db.cc.o
[ 44%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/user_db_recovery_task.cc.o
[ 45%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/user_dictionary.cc.o
[ 45%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/vocabulary.cc.o
[ 46%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/abc_segmentor.cc.o
[ 47%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/affix_segmentor.cc.o
[ 47%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/ascii_composer.cc.o
[ 48%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/ascii_segmentor.cc.o
[ 49%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/charset_filter.cc.o
[ 50%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/chord_composer.cc.o
[ 50%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/contextual_translation.cc.o
[ 51%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/echo_translator.cc.o
[ 52%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/editor.cc.o
[ 53%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/fallback_segmentor.cc.o
[ 53%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/filter_commons.cc.o
[ 54%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/gears_module.cc.o
[ 55%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/history_translator.cc.o
[ 56%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/key_binder.cc.o
[ 56%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/matcher.cc.o
[ 57%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/memory.cc.o
[ 58%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/navigator.cc.o
[ 58%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/poet.cc.o
[ 59%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/punctuator.cc.o
[ 60%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/recognizer.cc.o
[ 61%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/reverse_lookup_filter.cc.o
[ 61%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/reverse_lookup_translator.cc.o
[ 62%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/schema_list_translator.cc.o
[ 63%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/script_translator.cc.o
[ 64%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/selector.cc.o
[ 64%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/shape.cc.o
[ 65%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/simplifier.cc.o
[ 66%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/single_char_filter.cc.o
[ 66%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/speller.cc.o
[ 67%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/switch_translator.cc.o
[ 68%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/table_translator.cc.o
[ 69%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/translator_commons.cc.o
[ 69%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/uniquifier.cc.o
[ 70%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/unity_table_encoder.cc.o
[ 71%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/custom_settings.cc.o
[ 72%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/customizer.cc.o
[ 72%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/deployment_tasks.cc.o
[ 73%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/levers_module.cc.o
[ 74%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/switcher_settings.cc.o
[ 74%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/user_dict_manager.cc.o
[ 75%] Linking CXX shared library ../lib/librime.so
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitter.cpp.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitterstate.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitterutils.cpp.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(exceptions.cpp.o): relocation R_X86_64_32 against symbol
_ZTVN4YAML9ExceptionE' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(node_data.cpp.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(null.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(ostream_wrapper.cpp.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(parse.cpp.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/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(parser.cpp.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(regex_yaml.cpp.o): relocation R_X86_64_32 against
.bss' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(scanner.cpp.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(scantoken.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(simplekey.cpp.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(singledocparser.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(stream.cpp.o): relocation R_X86_64_32S against .data' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(tag.cpp.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(binary.cpp.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(depthguard.cpp.o): relocation R_X86_64_32 against symbol
_ZTVN4YAML13DeepRecursionE' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(directives.cpp.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(memory.cpp.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/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(nodebuilder.cpp.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/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(scanscalar.cpp.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(scantag.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(exp.cpp.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(db_impl.cc.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(db_iter.cc.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(dbformat.cc.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(filename.cc.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(log_reader.cc.o): relocation R_X86_64_32S against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(log_writer.cc.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(memtable.cc.o): relocation R_X86_64_32S against symbol
_ZTVN7leveldb21InternalKeyComparatorE' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(repair.cc.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(table_cache.cc.o): relocation R_X86_64_32S against symbol
_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(version_edit.cc.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(version_set.cc.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(write_batch.cc.o): relocation R_X86_64_32S against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(iterator.cc.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(merger.cc.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(table_builder.cc.o): relocation R_X86_64_32S against symbol
_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(table.cc.o): relocation R_X86_64_32S against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(two_level_iterator.cc.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(cache.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/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(comparator.cc.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(crc32c.cc.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(env.cc.o): relocation R_X86_64_32S against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(logging.cc.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(status.cc.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(env_posix.cc.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(builder.cc.o): relocation R_X86_64_32S against symbol
_ZN7leveldb10EnvWrapper15NewWritableFileERKSsPPNS_12WritableFileE' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(block_builder.cc.o): relocation R_X86_64_32S against symbol _ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(block.cc.o): relocation R_X86_64_32S against symbol
_ZTVN7leveldb5Block4IterE' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(filter_block.cc.o): relocation R_X86_64_32S against symbol _ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(format.cc.o): relocation R_X86_64_32S against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: [src/CMakeFiles/rime.dir/build.make:1602: lib/librime.so.1.7.3] Error 1
make[1]: [CMakeFiles/Makefile2:290: src/CMakeFiles/rime.dir/all] Error 2
make: *** [Makefile:160: all] Error 2
ld: library not found for -licudata
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld /Users/alswl/dev/myproject/squirrel/librime/build/lib/Release/librime.1.7.3.dylib normal
same issue:
Solution via https://github.com/Homebrew/homebrew-core/issues/67427#issuecomment-754187345:
export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/icu4c/lib
您好,我使用Cenotos7 编译时,也出现该问题,
- 我是使用git 下载的代码
- 我通过下载依赖包,逐步安装了每个依赖包
- 进入librime 中,执行make 在执行到75的时候报错: [ 74%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/switcher_settings.cc.o [ 74%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/user_dict_manager.cc.o [ 75%] Linking CXX shared library ../lib/librime.so /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitter.cpp.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitterstate.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC我的make 日志如下: -- The C compiler identification is GNU 7.3.1 -- The CXX compiler identification is GNU 7.3.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /opt/rh/devtoolset-7/root/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /opt/rh/devtoolset-7/root/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Boost: /usr/lib/cmake/Boost-1.75.0/BoostConfig.cmake (found suitable version "1.75.0", minimum required is "1.46.0") found components: filesystem regex system -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1") -- Checking for module 'capnp' -- Found capnp, version 0.8.0 -- Checking for module 'capnp-rpc' -- Found capnp-rpc, version 0.8.0 -- Checking for module 'capnp-json' -- Found capnp-json, version 0.8.0 -- Checking for module 'kj' -- Found kj, version 0.8.0 -- Checking for module 'kj-async' -- Found kj-async, version 0.8.0 -- Checking for module 'kj-http' -- Found kj-http, version 0.8.0 -- Checking for module 'kj-gzip' -- Found kj-gzip, version 0.8.0 -- Checking for module 'kj-tls' -- Found kj-tls, version 0.8.0 -- Checking for module 'kj-test' -- Found kj-test, version 0.8.0 -- Found glog: /usr/local/lib64/libglog.a -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found GTest: /usr/local/lib64/libgtest.a -- Found yaml-cpp: /usr/local/lib64/libyaml-cpp.a -- Found leveldb: /usr/local/lib64/libleveldb.a -- Found marisa: /usr/local/lib/libmarisa.so -- Found opencc: /usr/lib/libopencc.so -- Found X11/keysym.h at /root/pinyin/librime-master/thirdparty/include -- compiled capnproto schemata (sources): /root/pinyin/librime-master/build/proto//rime_proto.capnp.c++ -- compiled capnproto schemata (headers): /root/pinyin/librime-master/build/proto//rime_proto.capnp.h -- rime_plugins_libs: -- rime_plugins_modules: plugins -- compiled capnproto schemata (sources): /root/pinyin/librime-master/build/tools//rime_message.capnp.c++ -- compiled capnproto schemata (headers): /root/pinyin/librime-master/build/tools//rime_message.capnp.h -- Configuring done -- Generating done -- Build files have been written to: /root/pinyin/librime-master/build [root@analyze-40 build]# vim Makefile [root@analyze-40 build]# make [ 1%] Compiling Cap'n Proto schema rime_proto.capnp Scanning dependencies of target rime-proto-objs [ 1%] Building CXX object proto/CMakeFiles/rime-proto-objs.dir/rime_proto.capnp.c++.o [ 1%] Built target rime-proto-objs Scanning dependencies of target rime-plugins-objs [ 2%] Building CXX object plugins/CMakeFiles/rime-plugins-objs.dir/plugins_module.cc.o [ 2%] Built target rime-plugins-objs Scanning dependencies of target rime [ 2%] Building CXX object src/CMakeFiles/rime.dir/rime_api.cc.o [ 3%] Building CXX object src/CMakeFiles/rime.dir/rime/candidate.cc.o [ 4%] Building CXX object src/CMakeFiles/rime.dir/rime/commit_history.cc.o [ 4%] Building CXX object src/CMakeFiles/rime.dir/rime/composition.cc.o [ 5%] Building CXX object src/CMakeFiles/rime.dir/rime/context.cc.o [ 6%] Building CXX object src/CMakeFiles/rime.dir/rime/core_module.cc.o [ 7%] Building CXX object src/CMakeFiles/rime.dir/rime/deployer.cc.o [ 7%] Building CXX object src/CMakeFiles/rime.dir/rime/engine.cc.o [ 8%] Building CXX object src/CMakeFiles/rime.dir/rime/key_event.cc.o [ 9%] Building CXX object src/CMakeFiles/rime.dir/rime/key_table.cc.o [ 10%] Building CXX object src/CMakeFiles/rime.dir/rime/language.cc.o [ 10%] Building CXX object src/CMakeFiles/rime.dir/rime/menu.cc.o [ 11%] Building CXX object src/CMakeFiles/rime.dir/rime/module.cc.o [ 12%] Building CXX object src/CMakeFiles/rime.dir/rime/registry.cc.o [ 12%] Building CXX object src/CMakeFiles/rime.dir/rime/resource.cc.o [ 13%] Building CXX object src/CMakeFiles/rime.dir/rime/schema.cc.o [ 14%] Building CXX object src/CMakeFiles/rime.dir/rime/segmentation.cc.o [ 15%] Building CXX object src/CMakeFiles/rime.dir/rime/service.cc.o [ 15%] Building CXX object src/CMakeFiles/rime.dir/rime/setup.cc.o [ 16%] Building CXX object src/CMakeFiles/rime.dir/rime/signature.cc.o [ 17%] Building CXX object src/CMakeFiles/rime.dir/rime/switcher.cc.o [ 18%] Building CXX object src/CMakeFiles/rime.dir/rime/ticket.cc.o [ 18%] Building CXX object src/CMakeFiles/rime.dir/rime/translation.cc.o [ 19%] Building CXX object src/CMakeFiles/rime.dir/rime/config/auto_patch_config_plugin.cc.o [ 20%] Building CXX object src/CMakeFiles/rime.dir/rime/config/build_info_plugin.cc.o [ 20%] Building CXX object src/CMakeFiles/rime.dir/rime/config/config_compiler.cc.o [ 21%] Building CXX object src/CMakeFiles/rime.dir/rime/config/config_component.cc.o [ 22%] Building CXX object src/CMakeFiles/rime.dir/rime/config/config_data.cc.o [ 23%] Building CXX object src/CMakeFiles/rime.dir/rime/config/config_types.cc.o [ 23%] Building CXX object src/CMakeFiles/rime.dir/rime/config/default_config_plugin.cc.o [ 24%] Building CXX object src/CMakeFiles/rime.dir/rime/config/legacy_dictionary_config_plugin.cc.o [ 25%] Building CXX object src/CMakeFiles/rime.dir/rime/config/legacy_preset_config_plugin.cc.o [ 26%] Building CXX object src/CMakeFiles/rime.dir/rime/config/save_output_plugin.cc.o [ 26%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/algebra.cc.o [ 27%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/calculus.cc.o [ 28%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/encoder.cc.o [ 29%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/syllabifier.cc.o [ 29%] Building CXX object src/CMakeFiles/rime.dir/rime/algo/utilities.cc.o [ 30%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/corrector.cc.o [ 31%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/db.cc.o [ 31%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/db_utils.cc.o [ 32%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/dict_compiler.cc.o [ 33%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/dict_module.cc.o [ 34%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/dict_settings.cc.o [ 34%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/dictionary.cc.o [ 35%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/entry_collector.cc.o [ 36%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/level_db.cc.o [ 37%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/mapped_file.cc.o [ 37%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/preset_vocabulary.cc.o [ 38%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/prism.cc.o [ 39%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/reverse_lookup_dictionary.cc.o [ 39%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/string_table.cc.o [ 40%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/table.cc.o [ 41%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/table_db.cc.o [ 42%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/text_db.cc.o [ 42%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/tsv.cc.o [ 43%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/user_db.cc.o [ 44%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/user_db_recovery_task.cc.o [ 45%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/user_dictionary.cc.o [ 45%] Building CXX object src/CMakeFiles/rime.dir/rime/dict/vocabulary.cc.o [ 46%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/abc_segmentor.cc.o [ 47%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/affix_segmentor.cc.o [ 47%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/ascii_composer.cc.o [ 48%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/ascii_segmentor.cc.o [ 49%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/charset_filter.cc.o [ 50%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/chord_composer.cc.o [ 50%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/contextual_translation.cc.o [ 51%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/echo_translator.cc.o [ 52%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/editor.cc.o [ 53%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/fallback_segmentor.cc.o [ 53%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/filter_commons.cc.o [ 54%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/gears_module.cc.o [ 55%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/history_translator.cc.o [ 56%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/key_binder.cc.o [ 56%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/matcher.cc.o [ 57%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/memory.cc.o [ 58%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/navigator.cc.o [ 58%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/poet.cc.o [ 59%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/punctuator.cc.o [ 60%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/recognizer.cc.o [ 61%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/reverse_lookup_filter.cc.o [ 61%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/reverse_lookup_translator.cc.o [ 62%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/schema_list_translator.cc.o [ 63%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/script_translator.cc.o [ 64%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/selector.cc.o [ 64%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/shape.cc.o [ 65%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/simplifier.cc.o [ 66%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/single_char_filter.cc.o [ 66%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/speller.cc.o [ 67%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/switch_translator.cc.o [ 68%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/table_translator.cc.o [ 69%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/translator_commons.cc.o [ 69%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/uniquifier.cc.o [ 70%] Building CXX object src/CMakeFiles/rime.dir/rime/gear/unity_table_encoder.cc.o [ 71%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/custom_settings.cc.o [ 72%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/customizer.cc.o [ 72%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/deployment_tasks.cc.o [ 73%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/levers_module.cc.o [ 74%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/switcher_settings.cc.o [ 74%] Building CXX object src/CMakeFiles/rime.dir/rime/lever/user_dict_manager.cc.o [ 75%] Linking CXX shared library ../lib/librime.so /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitter.cpp.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitterstate.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(emitterutils.cpp.o): relocation R_X86_64_32S against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(exceptions.cpp.o): relocation R_X86_64_32 against symbol
_ZTVN4YAML9ExceptionE' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(node_data.cpp.o): relocation R_X86_64_32 against.bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(null.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(ostream_wrapper.cpp.o): relocation R_X86_64_32 against.bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(parse.cpp.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/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(parser.cpp.o): relocation R_X86_64_32 against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(regex_yaml.cpp.o): relocation R_X86_64_32 against
.bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(scanner.cpp.o): relocation R_X86_64_32 against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(scantoken.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(simplekey.cpp.o): relocation R_X86_64_32 against.bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(singledocparser.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(stream.cpp.o): relocation R_X86_64_32S against.data' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(tag.cpp.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(binary.cpp.o): relocation R_X86_64_32S against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(depthguard.cpp.o): relocation R_X86_64_32 against symbol
_ZTVN4YAML13DeepRecursionE' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(directives.cpp.o): relocation R_X86_64_32 against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(memory.cpp.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/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(nodebuilder.cpp.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/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(scanscalar.cpp.o): relocation R_X86_64_32 against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(scantag.cpp.o): relocation R_X86_64_32 against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libyaml-cpp.a(exp.cpp.o): relocation R_X86_64_32 against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(db_impl.cc.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(db_iter.cc.o): relocation R_X86_64_32S against.text' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(dbformat.cc.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(filename.cc.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(log_reader.cc.o): relocation R_X86_64_32S against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(log_writer.cc.o): relocation R_X86_64_32S against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(memtable.cc.o): relocation R_X86_64_32S against symbol
_ZTVN7leveldb21InternalKeyComparatorE' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(repair.cc.o): relocation R_X86_64_32S against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(table_cache.cc.o): relocation R_X86_64_32S against symbol
_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(version_edit.cc.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(version_set.cc.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(write_batch.cc.o): relocation R_X86_64_32S against.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(iterator.cc.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(merger.cc.o): relocation R_X86_64_32S against.text' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(table_builder.cc.o): relocation R_X86_64_32S against symbol
_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(table.cc.o): relocation R_X86_64_32S against.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(two_level_iterator.cc.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(cache.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/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(comparator.cc.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(crc32c.cc.o): relocation R_X86_64_32 against.bss' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(env.cc.o): relocation R_X86_64_32S against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(logging.cc.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(status.cc.o): relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(env_posix.cc.o): relocation R_X86_64_32S against.rodata' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(builder.cc.o): relocation R_X86_64_32S against symbol
_ZN7leveldb10EnvWrapper15NewWritableFileERKSsPPNS_12WritableFileE' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(block_builder.cc.o): relocation R_X86_64_32S against symbol_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(block.cc.o): relocation R_X86_64_32S against symbol
_ZTVN7leveldb5Block4IterE' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(filter_block.cc.o): relocation R_X86_64_32S against symbol_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /usr/local/lib64/libleveldb.a(format.cc.o): relocation R_X86_64_32S against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status make[2]: [src/CMakeFiles/rime.dir/build.make:1602: lib/librime.so.1.7.3] Error 1 make[1]: [CMakeFiles/Makefile2:290: src/CMakeFiles/rime.dir/all] Error 2 make: *** [Makefile:160: all] Error 2
我也出现了这个问题。centos8
環境: 乾淨的Google Cloud Platform VM (內建的Ubuntu 18.04 LTS)
具體步驟:(一切皆使用default設定) 執行 sudo apt install build-essential 安裝基本環境 執行 sudo apt install libboost-all-dev 安裝boost 執行 git clone --recursive https://github.com/rime/librime.git 進行下載 cd rime/librime/ 執行 make thirdparty 編譯第三方source code 執行 make 編譯librime本體 ----------- 編譯失敗 ----------
具體錯誤代碼如下: [ 77%] Linking CXX shared library ../lib/librime.so /usr/bin/ld: ../../thirdparty/lib/libyaml-cpp.a(emitterstate.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4YAML13SettingChangeImEE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status src/CMakeFiles/rime.dir/build.make:2676: recipe for target 'lib/librime.so.1.5.3' failed make[3]: [lib/librime.so.1.5.3] Error 1 make[3]: Leaving directory '/home/james096088/GIT/librime/build' CMakeFiles/Makefile2:135: recipe for target 'src/CMakeFiles/rime.dir/all' failed make[2]: [src/CMakeFiles/rime.dir/all] Error 2 make[2]: Leaving directory '/home/james096088/GIT/librime/build' Makefile:140: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/james096088/GIT/librime/build' Makefile:44: recipe for target 'release' failed make: [release] Error 2
--------- 嘗試處理 --------- 根據這個文章:https://github.com/rime/librime/issues/243 嘗試從:https://github.com/jbeder/yaml-cpp 下載0.3.0與0.6.0進行安裝,均無法改善,可能我錯誤理解「二进制装仓库里的久远版本」的意思。
感謝