happyfish100 / fastdfs

FastDFS is an open source high performance distributed file system (DFS). It's major functions include: file storing, file syncing and file accessing, and design for high capacity and load balance. Wechat/Weixin public account (Chinese Language): fastdfs
GNU General Public License v3.0
8.98k stars 1.98k forks source link

libfastcommon-maset编译失败 #551

Closed sicilianz closed 1 year ago

sicilianz commented 2 years ago

系统版本:CentOS Linux release 7.6.1810 (Core) make版本:make-3.82-24.el7.x86_64

[root@localhost libfastcommon-master]# ./make.sh 
lnm: /usr/lib64/libpthread.so: 不可识别的文件格式
gcc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -o libfastcommon.so -shared hash.lo chain.lo shared_func.lo ini_file_reader.lo logger.lo sockopt.lo base64.lo sched_thread.lo http_func.lo md5.lo pthread_func.lo local_ip_func.lo avl_tree.lo ioevent.lo ioevent_loop.lo fast_task_queue.lo fast_timer.lo locked_timer.lo process_ctrl.lo fast_mblock.lo connection_pool.lo fast_mpool.lo fast_allocator.lo fast_buffer.lo multi_skiplist.lo flat_skiplist.lo system_info.lo fast_blocked_queue.lo id_generator.lo char_converter.lo char_convert_loader.lo common_blocked_queue.lo multi_socket_client.lo skiplist_set.lo uniq_skiplist.lo json_parser.lo buffered_file_writer.lo server_id_func.lo fc_queue.lo sorted_queue.lo fc_memory.lo shared_buffer.lo thread_pool.lo array_allocator.lo sorted_array.lo -lm -ldl -lpthread
ini_file_reader.lo:在函数‘iniAddAnnotation’中:
/usr/local/software/libfastcommon-master/src/ini_file_reader.c:887: 警告:Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(s_sin.o): relocation R_X86_64_32S against symbol `__sincostab' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(branred.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(dosincos.o): relocation R_X86_64_32S against symbol `__sincostab' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(sincos32.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(s_sin-fma4.o): relocation R_X86_64_32S against symbol `__sincostab' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(sincos32-fma4.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(dosincos-fma4.o): relocation R_X86_64_32S against symbol `__sincostab' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(s_sin-avx.o): relocation R_X86_64_32S against symbol `__sincostab' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(k_standard.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(mpa.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(s_rint-c.o): relocation R_X86_64_32S against `.rodata.cst16' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(mpa-fma4.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: 最后的链结失败: 输出不可表示的节
collect2: 错误:ld 返回 1
make: *** [libfastcommon.so] Error 1
happyfish100 commented 2 years ago

感觉是你环境的问题,貌似环境乱掉了。

YukWww commented 2 years ago

楼主解决了吗 我也出现了这种情况 image

happyfish100 commented 2 years ago

并没有看到编译报错啊

YukWww commented 2 years ago

非常感谢您的回复!之前几天我尝试的时候,安装 libfatscommon 的时候虽然有这个提示但是可以编译成功,如果无视继续走下去,在安装 FastDFS 的时候编译就会报错失败。今天我再尝试安装的时候,发现这里虽然还是有这个提示但是不会影响后面安装 FastDFS 了,现在我已经安装成功了。

gzlisanshao commented 2 years ago

前几天编译时看到类似报错lnm: /usr/lib64/libpthread.so: 不可识别的文件格式 当时是用gitee下载的libfastcommon-master 后来改为tighub下载的libfastcommon-1.0.55.tar 没有报错了 不知道为啥,供参考。

sansanerchuang commented 2 years ago

环境的问题