Skip to the content.

glibc

使用 kernel.nix

mkdir build
cd build
../configure CC="gcc" CFLAGS="-O3" --prefix=$(pwd)

看看 glibc 的实现

例如 nptl/pthread_spin_lock.c 中的 atomic_compare_exchange_weak_acquire

bits/loongarch/strnlen.S

sysdeps/x86_64/strnlen.S 中存在

weak_alias (__strnlen, strnlen);
libc_hidden_builtin_def (strnlen)

但是,显然这是 c 语言的语法,为什么会出现在 .S 中,这是 因为 include/libc-symbols.h 对于 weak 分别定义了两种情况。

原来 glibc

$ fio
fio: symbol lookup error: /usr/lib64/ceph/libceph-common.so.0: undefined symbol: pthread_cond_clockwait, version GLIBC_2.28

原来 ldd 是 glibc 中的功能:

$ rpm -qf $(which ldd)
glibc-common-2.28-84.oe1.x86_64

glibc-common 包含的东西:

/etc/default
/etc/default/nss
/usr/bin/catchsegv
/usr/bin/gencat
/usr/bin/getconf
/usr/bin/getent
/usr/bin/iconv
/usr/bin/ldd
/usr/bin/locale
/usr/bin/localedef
/usr/bin/makedb
/usr/bin/pldd
/usr/bin/sotruss
/usr/bin/sprof
/usr/bin/tzselect
/usr/lib/build-locale-archive
/usr/sbin/zdump
/usr/sbin/zic

本站所有文章转发 CSDN 将按侵权追究法律责任,其它情况随意。