库本图19.10
我完全遵循that instruction:
$ mkdir $HOME/src
$ cd $HOME/src
$ git clone git://sourceware.org/git/glibc.git
$ mkdir -p $HOME/build/glibc
$ cd $HOME/build/glibc
$ $HOME/src/glibc/configure --prefix=/usr
$ make
但是在最后一个命令“ make”期间,出现以下错误(仅给出输出的结尾):
make[3]: Leaving directory '/home/denis/src/glibc/elf'
gcc -nostdlib -nostartfiles -r -o /home/denis/build/glibc/elf/librtld.os '-Wl,-(' /home/denis/build/glibc/elf/dl-allobjs.os /home/denis/build/glibc/elf/rtld-libc.a -lgcc '-Wl,-)' \
-Wl,-Map,/home/denis/build/glibc/elf/librtld.os.map
gcc -nostdlib -nostartfiles -shared -o /home/denis/build/glibc/elf/ld.so.new \
-Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs \
/home/denis/build/glibc/elf/librtld.os -Wl,--version-script=/home/denis/build/glibc/ld.map \
-Wl,-soname=ld-linux-x86-64.so.2 \
-Wl,-defsym=_begin=0
/usr/bin/ld: /home/denis/build/glibc/elf/librtld.os: in function `_rtld_main_check':
/home/denis/src/glibc/elf/../sysdeps/x86/dl-prop.h:33: undefined reference to `_dl_cet_check'
/usr/bin/ld: /home/denis/src/glibc/elf/../sysdeps/x86/dl-prop.h:33: undefined reference to `_dl_cet_check'
/usr/bin/ld: /home/denis/src/glibc/elf/../sysdeps/x86/dl-prop.h:33: undefined reference to `_dl_cet_check'
/usr/bin/ld: /home/denis/build/glibc/elf/librtld.os: in function `_dl_open_check':
/home/denis/src/glibc/elf/../sysdeps/x86/dl-prop.h:41: undefined reference to `_dl_cet_open_check'
/usr/bin/ld: /home/denis/build/glibc/elf/ld.so.new: hidden symbol `_dl_cet_open_check' isn't defined
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:510: /home/denis/build/glibc/elf/ld.so] Error 1
make[2]: Leaving directory '/home/denis/src/glibc/elf'
make[1]: *** [Makefile:438: elf/subdir_lib] Error 2
make[1]: Leaving directory '/home/denis/src/glibc'
make: *** [Makefile:9: all] Error 2
我需要做什么来建立图书馆?
最佳答案
显然,您的GCC版本隐式启用了-fcf-protection
标志。上游GCC不会执行此操作,因此没有为此准备glibc配置逻辑。您将必须使用CET进行显式配置,如下所示:
$ $HOME/src/glibc/configure --prefix=/usr --enable-cet
结果,将连接CET支持功能。
编辑这已被归档为Bug 25225 - ld.so fails to link on x86 if GCC defaults to -fcf-protection。现在,它已在所有支持CET的glibc分支上修复。
关于ubuntu - 构建glibc时对_dl_cet_check的 undefined reference ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58995065/