| Summary: | dev-util/valgrind-3.12.0 build fails with vg_preloaded.c:124: undefined reference to `__stack_chk_fail_local' | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Zoltan Puskas <zoltan> |
| Component: | Current packages | Assignee: | Anthony Basile <blueness> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | norbeet, wizardedit |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
build.log
proposed patch |
||
|
Description
Zoltan Puskas
2017-06-02 06:48:56 UTC
remove -fstack-protector-strong from CFLAGS also remove -fno-stack-protector from CFLAGS...
part of my info:
=================================================================
Package Settings
=================================================================
dev-util/valgrind-3.13.0::gentoo was built with the following:
USE="-mpi" ABI_X86="(64)"
CFLAGS="-O2 -march=native -mtune=native -pipe"
CXXFLAGS="-O2 -march=native -mtune=native -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
comment #1 makes sense. comment #2 doesn't. are you sure you want to *remove* -fno-stack-protector? By removing only -fstack-protector-strong valgrind compiles. Two questions: 1) Why is this? 2) Can the ebuild maybe check for this flag and warn user? Better, remove this flag if the user has it set? (In reply to Zoltan Puskas from comment #4) > By removing only -fstack-protector-strong valgrind compiles. Two questions: > 1) Why is this? Probably a gcc bug, as I'm not able to reproduce this with gcc-5.4.0 or 6.4.0, with either 3.12.0 or 3.13.0 > 2) Can the ebuild maybe check for this flag and warn user? Better, remove > this flag if the user has it set? That's doable in an ebuild. Upstream tries to force no-stack-protector, so it makes sense: https://sourceware.org/git/?p=valgrind.git;a=commitdiff;h=ecc35db60bde00d624986a5aaf5271f0de4bae30 https://bugs.kde.org/show_bug.cgi?id=144112 I'm curious how you're seeing this. I tried using your CFLAGS/CXXFLAGS in a chroot, and I clearly see -fstack-protector getting passed, but the latter -fno-stack-protector later overrides it: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../include -I../VEX/pub -I../VEX/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -DVGPV_amd64_linux_vanilla=1 -m64 -fno-stack-protector -O2 -g -std=gnu99 -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers -Wmissing-parameter-type -Wold-style-declaration -fno-stack-protector -fno-strict-aliasing -fno-builtin -fomit-frame-pointer -O2 -march=ivybridge -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -maes -mpclmul -mpopcnt -mavx -msse4.2 -msse4.1 -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=ivybridge -fstack-protector-strong -O2 -pipe -fno-stack-protector -c -o helgrind_amd64_linux-hg_addrdescr.o `test -f 'hg_addrdescr.c' || echo './'`hg_addrdescr.c The ebuild already filters this out as well, see bug 114347: filter-flags -fstack-protector something weird is going on. If I comment out that line, I see the same failure you do. That change has been in Gentoo since the git transition, so you certainly have that in your ebuild. I'm at a loss. Thanks for the hint. The following patch helped:
# diff /usr/portage/dev-util/valgrind/valgrind-3.12.0.ebuild /usr/portage/dev-util/valgrind/valgrind-3.12.0-r1.ebuild
52a53
> filter-flags -fstack-protector-strong
#
Created attachment 508196 [details, diff]
proposed patch
This is the fix I intend to commit for this, assuming @blueness is okay with it.
(In reply to Austin English from comment #7) > Created attachment 508196 [details, diff] [details, diff] > proposed patch > > This is the fix I intend to commit for this, assuming @blueness is okay with > it. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=625541b28d782f5f55a13427424a7eb2b9e7ebf3 |