【发布时间】:2021-09-21 19:46:15
【问题描述】:
我目前正在尝试创建 Glibc 2.33 的构建以与默认系统版本并行运行,但构建过程导致大量单元测试失败。虽然有些故障可以忽略不计,但大多数似乎是合法的问题,但我不知道如何解决它们。所需的最终目标系统是 CentOS 7.9,但我目前正在 Ubuntu Desktop 21.04 中测试构建步骤(在 VMware 15 虚拟机中)因为 CentOS 7.9 需要创建引导工具链(默认工具链太旧了)。根据 Glibc 2.33 文档,--enable-add-ons 选项不再需要(甚至可能不受支持),所以我不确定我可能缺少哪些步骤或配置选项。
创建构建虚拟机的步骤
- 创建一个“干净”的最小 Ubuntu Desktop 21.04 虚拟机安装
- 完全更新虚拟机
- 安装以下软件包
build-essentialgawkbisontexinfomsgfmtgettext
最终系统的软件版本
- GCC:Ubuntu 10.3.0-1ubuntu1
- Binutils:2.36.1
- 制作:4.3
- 野牛:3.7.5
- Gawk:5.1.0,API:3.0(GNU MPFR 4.1.0,GNU MP 6.2.1)
- Python 3:3.9.5
- PExpect:4.8.0
- Perl:5.32.1
- Texinfo:6.7.0
- Sed:4.7
- Gdb:Ubuntu 10.1-2ubuntu2 (10.1.90.20210411-git)
Glibc 2.33 构建步骤:
-
下载Glibc 2.33源代码
wget https://ftp.gnu.org/gnu/glibc/glibc-2.33.tar.gz -P ${HOME}/Downloads -
创建目录
rm -rf ${HOME}/Projects/BuildToolchain && mkdir -p ${HOME}/Projects/BuildToolchain/Build -
提取Glibc 2.33源代码
tar -xf ${HOME}/Downloads/glibc-2.33.tar.gz -C ${HOME}/Projects/BuildToolchain -
进入(源外)构建目录
cd ${HOME}/Projects/BuildToolchain/Build -
配置Glibc 2.33
../glibc-2.33/configure --prefix=${HOME}/Projects/BuildToolchain/Install 2>&1 | tee output-configure.txt -
构建 Glibc 2.33
make -j`nproc` 2>&1 | tee output-make.txt -
构建并运行单元测试
make check 2>&1 | tee output-make-check.txt
单元测试结果
以上步骤产生以下单元测试结果,包括 149 个失败的测试。
FAIL: debug/tst-backtrace2
FAIL: debug/tst-backtrace3
FAIL: debug/tst-backtrace4
FAIL: debug/tst-backtrace5
FAIL: debug/tst-backtrace6
FAIL: dlfcn/bug-atexit3
FAIL: elf/check-abi-libc
UNSUPPORTED: elf/tst-audit10
UNSUPPORTED: elf/tst-avx512
UNSUPPORTED: elf/tst-cet-legacy-8
UNSUPPORTED: elf/tst-cet-property-2
FAIL: elf/tst-cpu-features-cpuinfo
FAIL: elf/tst-glibc-hwcaps-prepend-cache
FAIL: elf/tst-ldconfig-ld_so_conf-update
XPASS: elf/tst-protected1a
XPASS: elf/tst-protected1b
FAIL: elf/tst-unwind-main
FAIL: iconv/tst-iconv-mt
FAIL: malloc/tst-malloc-stats-cancellation
FAIL: malloc/tst-malloc-stats-cancellation-mcheck
UNSUPPORTED: math/test-double-libmvec-sincos-avx512
UNSUPPORTED: math/test-float-libmvec-sincosf-avx512
FAIL: misc/tst-gettid-kill
UNSUPPORTED: misc/tst-pkey
FAIL: misc/tst-sigcontext-get_pc
UNSUPPORTED: nptl/test-cond-printers
UNSUPPORTED: nptl/test-condattr-printers
UNSUPPORTED: nptl/test-mutex-printers
UNSUPPORTED: nptl/test-mutexattr-printers
UNSUPPORTED: nptl/test-rwlock-printers
UNSUPPORTED: nptl/test-rwlockattr-printers
FAIL: nptl/tst-basic3
FAIL: nptl/tst-basic4
FAIL: nptl/tst-call-once
FAIL: nptl/tst-cancel-self
FAIL: nptl/tst-cancel-self-cancelstate
FAIL: nptl/tst-cancel-self-canceltype
FAIL: nptl/tst-cancel-self-testcancel
FAIL: nptl/tst-cancel1
FAIL: nptl/tst-cancel10
FAIL: nptl/tst-cancel11
FAIL: nptl/tst-cancel12
FAIL: nptl/tst-cancel13
FAIL: nptl/tst-cancel14
FAIL: nptl/tst-cancel15
FAIL: nptl/tst-cancel16
FAIL: nptl/tst-cancel17
FAIL: nptl/tst-cancel18
FAIL: nptl/tst-cancel2
FAIL: nptl/tst-cancel20
FAIL: nptl/tst-cancel21
FAIL: nptl/tst-cancel22
FAIL: nptl/tst-cancel23
FAIL: nptl/tst-cancel24
FAIL: nptl/tst-cancel25
FAIL: nptl/tst-cancel28
FAIL: nptl/tst-cancel3
FAIL: nptl/tst-cancel4
FAIL: nptl/tst-cancel4_1
FAIL: nptl/tst-cancel4_2
FAIL: nptl/tst-cancel5
FAIL: nptl/tst-cancel6
FAIL: nptl/tst-cancel7
FAIL: nptl/tst-cancel8
FAIL: nptl/tst-cancel9
FAIL: nptl/tst-cancelx10
FAIL: nptl/tst-cancelx11
FAIL: nptl/tst-cancelx12
FAIL: nptl/tst-cancelx13
FAIL: nptl/tst-cancelx14
FAIL: nptl/tst-cancelx15
FAIL: nptl/tst-cancelx16
FAIL: nptl/tst-cancelx17
FAIL: nptl/tst-cancelx18
FAIL: nptl/tst-cancelx2
FAIL: nptl/tst-cancelx20
FAIL: nptl/tst-cancelx21
FAIL: nptl/tst-cancelx3
FAIL: nptl/tst-cancelx4
FAIL: nptl/tst-cancelx5
FAIL: nptl/tst-cancelx6
FAIL: nptl/tst-cancelx7
FAIL: nptl/tst-cancelx8
FAIL: nptl/tst-cancelx9
FAIL: nptl/tst-cleanup0
FAIL: nptl/tst-cleanup0-cmp
FAIL: nptl/tst-cleanup1
FAIL: nptl/tst-cleanup3
FAIL: nptl/tst-cleanup4
FAIL: nptl/tst-cleanupx0
FAIL: nptl/tst-cleanupx1
FAIL: nptl/tst-cleanupx3
FAIL: nptl/tst-cleanupx4
FAIL: nptl/tst-cnd-basic
FAIL: nptl/tst-cnd-broadcast
FAIL: nptl/tst-cnd-timedwait
FAIL: nptl/tst-cond-except
FAIL: nptl/tst-cond22
FAIL: nptl/tst-cond25
FAIL: nptl/tst-cond7
FAIL: nptl/tst-cond8
FAIL: nptl/tst-default-attr
FAIL: nptl/tst-exec5
FAIL: nptl/tst-execstack
FAIL: nptl/tst-exit2
FAIL: nptl/tst-exit3
FAIL: nptl/tst-fini1
FAIL: nptl/tst-join1
FAIL: nptl/tst-join10
FAIL: nptl/tst-join11
FAIL: nptl/tst-join12
FAIL: nptl/tst-join13
FAIL: nptl/tst-join5
FAIL: nptl/tst-join6
FAIL: nptl/tst-join8
FAIL: nptl/tst-join9
FAIL: nptl/tst-key3
FAIL: nptl/tst-minstack-cancel
FAIL: nptl/tst-minstack-exit
FAIL: nptl/tst-minstack-throw
FAIL: nptl/tst-mtx-basic
FAIL: nptl/tst-mtx-timedlock
FAIL: nptl/tst-mtx-trylock
FAIL: nptl/tst-mutex10
FAIL: nptl/tst-mutex8
FAIL: nptl/tst-mutexpi8
FAIL: nptl/tst-once3
FAIL: nptl/tst-once4
FAIL: nptl/tst-oncex3
FAIL: nptl/tst-oncex4
FAIL: nptl/tst-robust1
FAIL: nptl/tst-robust2
FAIL: nptl/tst-robust3
FAIL: nptl/tst-robust4
FAIL: nptl/tst-robust5
FAIL: nptl/tst-robust6
FAIL: nptl/tst-robust7
FAIL: nptl/tst-robustpi1
FAIL: nptl/tst-robustpi2
FAIL: nptl/tst-robustpi3
FAIL: nptl/tst-robustpi4
FAIL: nptl/tst-robustpi5
FAIL: nptl/tst-robustpi6
FAIL: nptl/tst-robustpi7
FAIL: nptl/tst-sem11
FAIL: nptl/tst-sem12
FAIL: nptl/tst-sem16
FAIL: nptl/tst-stack4
FAIL: nptl/tst-thrd-detach
FAIL: nptl/tst-thrd-sleep
FAIL: nptl/tst-thread-exit-clobber
FAIL: nptl/tst-thread_local1
FAIL: nptl/tst-tsd5
FAIL: nptl/tst-tss-basic
FAIL: nptl/tst-unwind-thread
FAIL: nss/tst-cancel-getpwuid_r
FAIL: nss/tst-nss-files-hosts-long
UNSUPPORTED: posix/tst-cet-vfork-1
FAIL: posix/tst-getopt-cancel
UNSUPPORTED: resolv/tst-resolv-ai_idn
UNSUPPORTED: resolv/tst-resolv-ai_idn-latin1
FAIL: rt/tst-cpuclock2
FAIL: rt/tst-mqueue8
FAIL: rt/tst-mqueue8x
FAIL: rt/tst-shm-cancel
FAIL: stdlib/tst-quick_exit
FAIL: stdlib/tst-thread-quick_exit
Summary of test results:
149 FAIL
4202 PASS
16 UNSUPPORTED
17 XFAIL
2 XPASS
选择详细的失败测试结果
-
tst-backtrace2
Obtained backtrace with 0 functions Failure on line 44 -
tst-backtrace3
Obtained backtrace with 0 functions Failure on line 49 -
dlfcn/bug-atexit3
dlopen failed: libstdc++.so.6: cannot open shared object file: No such file or directory -
elf/check-abi-libc
--- ../sysdeps/unix/sysv/linux/x86_64/64/libc.abilist 2021-02-01 12:15:33.000000000 -0500 +++ /home/sandy/Projects/BuildToolchain/Build/libc.symlist 2021-07-12 11:42:58.693499635 -0400 @@ -499 +499 @@ GLIBC_2.2.5 _mcount F -GLIBC_2.2.5 _nl_default_dirname D 0x12 +GLIBC_2.2.5 _nl_default_dirname D 0x39 -
杂项/tst-gettid-kill
Didn't expect signal from child: got `Aborted' -
nptl/tst-basic3
starting 20 + 1 threads 20 left Incorrect signal from child: got `Aborted', need `User defined signal 1' -
nss/tst-nss-files-hosts-long(如果未使用
--prefix命令行选项,则此测试通过)error: tst-nss-files-hosts-long.c:35: ahostsv4 failed error: 1 test failures -
posix/tst-getopt-cancel
begin: no errors Didn't expect signal from child: got `Aborted' -
rt/tst-cpuclock2
live thread clock ffffffffff031f26 resolution 0.000000001 live thread before sleep => 0.000115540 self thread before sleep => 0.000294453 live thread after sleep => 0.500264022 self thread after sleep => 0.000336234 Didn't expect signal from child: got `Aborted' -
stdlib/tst-quick_exit
(empty) -
stdlib/tst-thread-quick_exit
(empty)
【问题讨论】:
-
可能从头开始:
make clean && make -j1linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html ..... 预期make check失败 linuxfromscratch.org/lfs/view/stable/chapter08/glibc.html ....... EL7 的额外编译器 stackoverflow.com/questions/47175706/… -
目前还不清楚为什么所有测试都失败了。您应该查看(并更新问题)
dlfcn/bug-atexit3.out等的内容。 -
没有
libstdc++.so.6可能表明您的安装太最小化。无论如何,sourceware.org/bugzilla 可能是一个更合适的论坛。 -
@n.1.8e9-where's-my-sharem.,“最小”的 Ubuntu 桌面安装只会导致一些生产力软件和游戏无法安装。但是,除了 Gnome、Firefox 等之外,还安装了所有预期的 GNU/Linux 软件包。
-
Glibc-2.33 : CentOS7 示例,{make-4.2.1-10.el7, gcc84} → drive.google.com/drive/folders/…