
16 Sep
2025
16 Sep
'25
3:30 p.m.
一.背景
25.09转测发现valgrind 存在安全编译选项 SP 不满足,参考其他社区添加-fstack-protector-strong编译选项修复,会报错 undefined reference to `__stack_chk_fail',排查是安装gcc_secure 导致冲突,验证不使用gcc_secure可以正常构建通过
issue : https://gitee.com/src-openeuler/valgrind/issues/ICXUJZ
2025-09-16 10:31:33 gcc -B /home/lkp/rpmbuild/BUILD/valgrind-3.25.1/shared/libgcc/ -m64 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-unused-result -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-signedness -Wformat-security -Wignored-qualifiers -Wmissing-parameter-type -Wlogical-op -Wenum-conversion -Wimplicit-fallthrough=2 -Wold-style-declaration -finline-functions -fno-strict-aliasing -fno-builtin -O -g -fno-omit-frame-pointer -fno-strict-aliasing -fpic -fno-builtin -fno-ipa-icf -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/generic-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst -m64 -Wl,--whole-archive ../coregrind/libreplacemalloc_toolpreload-amd64-linux.a -Wl,--no-whole-archive -Wl,-z,relro -Wl,--as-needed -specs=/usr/lib/rpm/generic-hardened-ld -specs=/usr/lib/rpm/openEuler/openEuler-package-notes -o vgpreload_memcheck-amd64-linux.so vgpreload_memcheck_amd64_linux_so-mc_replace_strmem.o
2025-09-16 10:31:33 make[3]: Leaving directory '/home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck' 2025-09-16 10:31:36 /usr/bin/ld: /tmp/ccHMRr6s.ltrans6.ltrans.o: in function `expandInput': 2025-09-16 10:31:36 /home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck/../coregrind/m_errormgr.c:1993:(.text+0x59b): undefined reference to `__stack_chk_fail' 2025-09-16 10:31:36 /usr/bin/ld: /tmp/ccHMRr6s.ltrans6.ltrans.o: in function `vgPlain_parse_enum_set': 2025-09-16 10:31:36 /home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck/../coregrind/m_libcbase.c:637:(.text+0x1474): undefined reference to `__stack_chk_fail' 2025-09-16 10:31:36 /usr/bin/ld: /tmp/ccHMRr6s.ltrans6.ltrans.o: in function `bm_qsort.lto_priv.0': 2025-09-16 10:31:36 /home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck/../coregrind/m_libcbase.c:933:(.text+0x1ac9): undefined reference to `__stack_chk_fail' 2025-09-16 10:31:36 /usr/bin/ld: /tmp/ccHMRr6s.ltrans6.ltrans.o: in function `vgPlain_stat': 2025-09-16 10:31:36 /home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck/../coregrind/m_libcfile.c:605:(.text+0x2626): undefined reference to `__stack_chk_fail' 2025-09-16 10:31:36 /usr/bin/ld: /tmp/ccHMRr6s.ltrans6.ltrans.o: in function `vgPlain_fstat': 2025-09-16 10:31:36 /home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck/../coregrind/m_libcfile.c:689:(.text+0x2888): undefined reference to `__stack_chk_fail' 2025-09-16 10:31:36 /usr/bin/ld: /tmp/ccHMRr6s.ltrans6.ltrans.o:/home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck/../coregrind/m_libcfile.c:1133: more undefined references to `__stack_chk_fail' follow 2025-09-16 10:31:36 collect2: error: ld returned 1 exit status 2025-09-16 10:31:36 make[3]: *** [Makefile:1195: memcheck-amd64-linux] Error 1 2025-09-16 10:31:36 make[3]: Entering directory '/home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck' 2025-09-16 10:31:36 ../coregrind/link_tool_exe_linux 0x58000000 gcc -B /home/lkp/rpmbuild/BUILD/valgrind-3.25.1/shared/libgcc/ -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/generic-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -Wl,-z,relro -Wl,--as-needed -specs=/usr/lib/rpm/generic-hardened-ld -specs=/usr/lib/rpm/openEuler/openEuler-package-notes -o memcheck-amd64-linux -flto -fuse-linker-plugin -m64 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-unused-result -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-signedness -Wformat-security -Wignored-qualifiers -Wmissing-parameter-type -Wlogical-op -Wenum-conversion -Wimplicit-fallthrough=2 -Wold-style-declaration -finline-functions -fno-strict-aliasing -fno-builtin -fomit-frame-pointer -O2 -static -nodefaultlibs -nostartfiles -u _start -m64 memcheck_amd64_linux-mc_leakcheck.o memcheck_amd64_linux-mc_malloc_wrappers.o memcheck_amd64_linux-mc_main.o memcheck_amd64_linux-mc_main_asm.o memcheck_amd64_linux-mc_translate.o memcheck_amd64_linux-mc_machine.o memcheck_amd64_linux-mc_errors.o ../coregrind/libcoregrind-amd64-linux.a ../VEX/libvex-amd64-linux.a -lgcc ../coregrind/libgcc-sup-amd64-linux.a 2025-09-16 10:31:36 make[3]: Leaving directory '/home/lkp/rpmbuild/BUILD/valgrind-3.25.1/memcheck' 2025-09-16 10:31:36 make[2]: *** [Makefile:1506: all-recursive] Error 1 2025-09-16 10:31:36 make[1]: *** [Makefile:942: all-recursive] Error 1 2025-09-16 10:31:36 make: *** [Makefile:805: all] Error 2 2025-09-16 10:31:36 error: Bad exit status from /var/tmp/rpm-tmp.BhN0wy (%build) 2025-09-16 10:31:36 Bad exit status from /var/tmp/rpm-tmp.BhN0wy (%build)
二.期望添加的配置
在openEuler-25.09:everything、openEuler-master:everything、openEuler-24.03-LTS-Next:everything工程的%gcc_secure_exclude添加valgrind.spec配置
三.涉及工程范围
Eulermaker中master、25.09、24.03-LTS系列分支涉及工程及后续工程配置
0
Age (days ago)
0
Last active (days ago)
0 comments
1 participants
participants (1)
-
王凯