You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/10/20 13:58:58 UTC
[GitHub] [incubator-brpc] sochinpub opened a new issue #1272: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsnappy.a(snappy.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
sochinpub opened a new issue #1272:
URL: https://github.com/apache/incubator-brpc/issues/1272
**Describe the bug (描述bug)**
编译example出错:
incubator-brpc/example/echo_c++# make -j
> Generating echo.pb.cc
/usr/bin/protoc --cpp_out=. --proto_path=. echo.proto
> Compiling client.o
g++ -c -I/usr/include/ -I../../output/include -DBRPC_WITH_GLOG=0 -DGFLAGS_NS=google -g -std=c++0x -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Wno-unused-parameter -fPIC -fno-omit-frame-pointer client.cpp -o client.o
> Compiling server.o
g++ -c -I/usr/include/ -I../../output/include -DBRPC_WITH_GLOG=0 -DGFLAGS_NS=google -g -std=c++0x -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Wno-unused-parameter -fPIC -fno-omit-frame-pointer server.cpp -o server.o
> Compiling echo.pb.o
g++ -c -I/usr/include/ -I../../output/include -DBRPC_WITH_GLOG=0 -DGFLAGS_NS=google -g -std=c++0x -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Wno-unused-parameter -fPIC -fno-omit-frame-pointer echo.pb.cc -o echo.pb.o
> Linking echo_client
g++ -L/usr/lib/x86_64-linux-gnu -L../../output/lib -Xlinker "-(" echo.pb.o client.o -Wl,-Bstatic -lgflags -lprotobuf -lleveldb -lsnappy -lbrpc -Wl,-Bdynamic -Xlinker "-)" -lpthread -lssl -lcrypto -ldl -lz -lrt -o echo_client
> Linking echo_server
g++ -L/usr/lib/x86_64-linux-gnu -L../../output/lib -Xlinker "-(" echo.pb.o server.o -Wl,-Bstatic -lgflags -lprotobuf -lleveldb -lsnappy -lbrpc -Wl,-Bdynamic -Xlinker "-)" -lpthread -lssl -lcrypto -ldl -lz -lrt -o echo_server
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsnappy.a(snappy.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:69: recipe for target 'echo_client' failed
make: *** [echo_client] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsnappy.a(snappy.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:77: recipe for target 'echo_server' failed
make: *** [echo_server] Error 1
rm echo.pb.cc
**To Reproduce (复现方法)**
编译example
**Expected behavior (期望行为)**
成功编译
**Versions (各种版本)**
OS: debian 9(4.19)
Compiler: gcc
brpc: master
protobuf:1.2.1-2 amd64
**Additional context/screenshots (更多上下文/截图)**
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org
[GitHub] [incubator-brpc] nanblpc commented on issue #1272: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsnappy.a(snappy.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
Posted by GitBox <gi...@apache.org>.
nanblpc commented on issue #1272:
URL: https://github.com/apache/incubator-brpc/issues/1272#issuecomment-945609506
Encounter the same question. Who knows the solution? Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org
[GitHub] [incubator-brpc] sochinpub commented on issue #1272: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsnappy.a(snappy.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
Posted by GitBox <gi...@apache.org>.
sochinpub commented on issue #1272:
URL: https://github.com/apache/incubator-brpc/issues/1272#issuecomment-713251988
> 应该是/usr/lib/x86_64-linux-gnu/libsnappy.a这个库编译的时候没有加-fPIC选项
直接安装的包,brpc依赖这个是不是只能自己编译libsnappy-dev了?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org
[GitHub] [incubator-brpc] serverglen commented on issue #1272: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsnappy.a(snappy.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
Posted by GitBox <gi...@apache.org>.
serverglen commented on issue #1272:
URL: https://github.com/apache/incubator-brpc/issues/1272#issuecomment-713238306
应该是/usr/lib/x86_64-linux-gnu/libsnappy.a这个库编译的时候没有加-fPIC选项
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org