Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 827923 - cross-{i686,x86_64}-w64-mingw32/gcc-10.3.0-r2: undefined reference to `__stack_chk_guard'
Summary: cross-{i686,x86_64}-w64-mingw32/gcc-10.3.0-r2: undefined reference to `__stac...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Crossdev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-01 00:32 UTC by James Beddek
Modified: 2021-12-01 18:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cross-x86_64-w64-mingw32-info.log (cross-x86_64-w64-mingw32-info.log,18.66 KB, text/x-log)
2021-12-01 00:32 UTC, James Beddek
Details
cross-x86_64-w64-mingw32-gcc-stage2.log.xz (cross-x86_64-w64-mingw32-gcc-stage2.log.xz,60.82 KB, application/x-xz)
2021-12-01 00:33 UTC, James Beddek
Details
gcc-config.logs.tar.xz (gcc-config.logs.tar.xz,53.50 KB, application/x-xz)
2021-12-01 00:34 UTC, James Beddek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Beddek 2021-12-01 00:32:40 UTC
Created attachment 757109 [details]
cross-x86_64-w64-mingw32-info.log

I'm encountering the same build failure as seen in https://bugs.gentoo.org/513706 from 2014. Though I'm opening a new issue as I'm sure there have been a lot of changes in the 7 years since, and apparently this bug was "Fixed in CVS" (@zorry). I'm not sure what change it was that had meant to fix it.

/usr/libexec/gcc/x86_64-w64-mingw32/ld: /usr/x86_64-w64-mingw32/mingw/lib/../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):pseudo-reloc.c:(.text+0x202): undefined reference to `__stack_chk_fail'
/usr/libexec/gcc/x86_64-w64-mingw32/ld: /usr/x86_64-w64-mingw32/mingw/lib/../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):pseudo-reloc.c:(.text+0x4e2): undefined reference to `__stack_chk_fail'
/usr/libexec/gcc/x86_64-w64-mingw32/ld: /usr/x86_64-w64-mingw32/mingw/lib/../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):pseudo-reloc.c:(.rdata$.refptr.__stack_chk_guard[.refptr.__stack_chk_guard]+0x0): undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:994: libgcc_s.dll] Error 1

Cheers
Comment 1 James Beddek 2021-12-01 00:33:29 UTC
Created attachment 757110 [details]
cross-x86_64-w64-mingw32-gcc-stage2.log.xz
Comment 2 James Beddek 2021-12-01 00:34:12 UTC
Created attachment 757111 [details]
gcc-config.logs.tar.xz
Comment 3 James Beddek 2021-12-01 00:35:50 UTC
Note: I'm using the default USE flags for the cross compiler installation through crossdev
Comment 4 Tee KOBAYASHI 2021-12-01 01:09:19 UTC
I see "-fstack-protector-strong -D_FORTIFY_SOURCE=2" in your CFLAGS. It would be troublesome if cross-x86_64-w64-mingw32_ucrt/mingw64-runtime were built with these flags.
Comment 5 James Beddek 2021-12-01 01:26:28 UTC
Ah that's a duh on my part as I use the Clang compiler on my system, and Clang doesn't have sane semi-hardening defaults. https://wiki.gentoo.org/wiki/Clang#Clang_environments

Now crossdev works a treat after switching mingw64-runtime to use a gcc env. Thanks for helping me fix this :)