undefined references: __sync_fetch_and_add_4 and __sync_val_compare_and_swap_4

尝试编译最新版 glibc 时出现未定义引用错误,涉及 __sync_fetch_and_add_4 和 __sync_val_compare_and_swap_4 函数。错误出现在 dl-lookup.c 和 dl-runtime.c 文件中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • From: root <root at server dot boros dot com>
  • To: libc-alpha at sourceware dot org
  • Date: Tue, 6 Feb 2007 15:57:20 -0600 (CST)
  • Subject: undefined references: __sync_fetch_and_add_4 and __sync_val_compare_and_swap_4

Upon attempting to compile the latest libc from *cvs*, I get the following
errors when compiling.

make[4]: Leaving directory `/tmp/glibc-2.6/string'
make subdir=time -C ../time ..=../ objdir=/tmp/glibc-build -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-setitimer.os'
make[4]: Entering directory `/tmp/glibc-2.6/time'
make[4]: Nothing to be done for `rtld-all'.
make[4]: Leaving directory `/tmp/glibc-2.6/time'
make[3]: Leaving directory `/tmp/glibc-2.6/elf'
gcc -nostdlib -nostartfiles -shared \
-Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
-Wl,-z,defs -Wl,--verbose 2>&1 | \
LC_ALL=C \
sed -e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . -
SIZEOF_HEADERS;/' \
> /tmp/glibc-build/elf/ld.so.lds
gcc -nostdlib -nostartfiles -shared -o /tmp/glibc-build/elf/ld.so
\
-Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
-Wl,-z,defs \
/tmp/glibc-build/elf/librtld.os
-Wl,--version-script=/tmp/glibc-build/ld.map \
-Wl,-soname=ld-linux.so.2 -T
/tmp/glibc-build/elf/ld.so.lds
/tmp/glibc-build/elf/librtld.os: In function `add_dependency':
/tmp/glibc-2.6/elf/dl-lookup.c:106: undefined reference to `__sync_fetch_and_add_4'
/tmp/glibc-2.6/elf/dl-lookup.c:110: undefined reference to
`__sync_val_compare_and_swap_4'
/tmp/glibc-build/elf/librtld.os: In function `_dl_profile_fixup':
/tmp/glibc-2.6/elf/dl-runtime.c:196: undefined reference to
`__sync_val_compare_and_swap_4'
/tmp/glibc-2.6/elf/dl-runtime.c:205: undefined reference to
`__sync_fetch_and_add_4'
/tmp/glibc-build/elf/librtld.os: In function `_dl_fixup':
/tmp/glibc-2.6/elf/dl-runtime.c:102: undefined reference to
`__sync_val_compare_and_swap_4'
/tmp/glibc-2.6/elf/dl-runtime.c:110: undefined reference to
`__sync_fetch_and_add_4'
/tmp/glibc-build/elf/librtld.os: In function `dl_open_worker':
/tmp/glibc-2.6/elf/dl-open.c:424: undefined reference to
`__sync_val_compare_and_swap_4'
/tmp/glibc-2.6/elf/dl-open.c:426: undefined reference to
`__sync_fetch_and_add_4'
/tmp/glibc-build/elf/librtld.os: In function `_dl_close_worker':
/tmp/glibc-2.6/elf/dl-close.c:406: undefined reference to
`__sync_val_compare_and_swap_4'
/tmp/glibc-2.6/elf/dl-close.c:408: undefined reference to
`__sync_fetch_and_add_4'
collect2: ld returned 1 exit status
make[2]: *** [/tmp/glibc-build/elf/ld.so] Error 1


I grepped through all the sources and I couldn't find any reference to
those two functions. This has been an issues with the latest libc for a
couple of weeks already.


Index Nav:

[Date Index] [Subject Index] [Author Index] [Thread Index]

Message Nav:

[Date Prev] [Date Next]

[Thread Prev] [Thread Next]

 

http://cygwin.com/ml/libc-alpha/2007-02/msg00008.html

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值