当前位置:网站首页>Boot1.62.0 compilation static library FPIC link problem
Boot1.62.0 compilation static library FPIC link problem
2022-06-09 08:25:00 【Erice_ s】
The problem background : The application introduces boost library , Reference library usage -fPIC Compilation options In order to compile links directly using static libraries
Compile error :libboost_system.a(error_code.o): relocation R_X86_64_32 against `.rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libboost_system.a: error adding symbols: Bad value
Analyze and process :
* boost_1_62_0 pwd
/root/3rd/boost_1_62_0
* boost_1_62_0 vim tools/build/src/tools/gcc.jam
# take 403 It is amended as follows if $(link) = shared || $(link) = static
400 rule setup-fpic ( targets * : sources * : properties * )
401 {
402 local link = [ feature.get-values link : $(properties) ] ;
403 if $(link) = shared
404 {
405 local target = [ feature.get-values target-os : $(properties) ] ;
406
407 # This logic will add -fPIC for all compilations:
408 #
409 # lib a : a.cpp b ;
410 # obj b : b.cpp ;
411 # exe c : c.cpp a d ;
412 # obj d : d.cpp ;
413 #
414 # This all is fine, except that 'd' will be compiled with -fPIC even
415 # though it is not needed, as 'd' is used only in exe. However, it is
416 # hard to detect where a target is going to be used. Alternatively, we
417 # can set -fPIC only when main target type is LIB but than 'b' would be
418 # compiled without -fPIC which would lead to link errors on x86-64. So,
419 # compile everything with -fPIC.
420 #
421 # Yet another alternative would be to create a propagated <sharedable>
422 # feature and set it when building shared libraries, but that would be
423 # hard to implement and would increase the target path length even more.
424
425 # On Windows, fPIC is the default, and specifying -fPIC explicitly leads
426 # to a warning.
427 if ! $(target) in cygwin windows
428 {
429 OPTIONS on $(targets) += -fPIC ;
430 }
431 }
432 }
边栏推荐
- AMS advanced - how to start an unregistered activity
- Market Research - current market situation and future development trend of aloe leaf powder in the world and China
- Nacos二次开发
- Oracle partition table paging query SQL optimization
- [reading point paper] ghostnet: more features from cheapoperations convolution operation is still expensive, and feature graph redundancy can be obtained by linear transformation
- English语法_方式副词
- Go questions / knowledge gathering - 2
- RMAN备份概念_一致的和不一致的RMAN备份
- POI and COS realize excel file uploading and downloading
- Market Research - current situation and future development trend of global and Chinese cosmetic grade ascorbic acid glucoside Market
猜你喜欢

C language review 10

OpenInfra Summit 2022 | 安超云用户脱颖而出 入围超级用户大奖

【论文简介】2204.VQGAN-CLIP(已开源):Open Domain Image Generation and Editing with Natural Language Guidance

C language review 11

RedLock红锁安全性争论(上)

Secondary development of Nacos

whatweb

自制编译器学习4:使用Flex

No, you still can't read the log with requestid?

通过低代码和无代码实现保险行业客户体验突破
随机推荐
IELTS review 1
Kibana:Kibana 入门 (一)
The philosophical thought of the process of suffering
English语法_副词
leetcodeSQL:1070. Product sales analysis III
mysql 往字段后面加字符串
配置RMAN备份的环境_配置控制文件和服务器参数文件的自动备份
Market Research - current situation and future development trend of ethylene absorbent package market in the world and China
C language review 12
2022-2028 global nonlinear node detector industry survey and trend analysis report
Puzzle (105) plane inversion
【论文简介】CLIP:图像与自然语言配对预训练可迁移模型:Learning Transferable Visual Models From Natural Language Supervision
Anatomy of illusory rendering system (15) - XR topic
【TeXstudio】【1】分式dfrac,tfrac Undefined control squence错误
Graphic knowledge points: leakcanary
刘勇智:一码通缺陷分析与架构设计方案丨声网开发者创业讲堂 Vol.02
Do you really know tcp/ip
RMAN备份概念_一致的和不一致的RMAN备份
CV learning notes cnn-vgg
[reading papers] efficientnet: retailing model scaling for revolutionary neural networks