Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 758914 - app-emulation/wine-vanilla-5.0*: direct GOT relocation R_386_GOT 32 against `strlen@@GLIBC_2.0' without base register can not be used when making a shared object
Summary: app-emulation/wine-vanilla-5.0*: direct GOT relocation R_386_GOT 32 against `...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Wine Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-07 15:59 UTC by Luke-Jr
Modified: 2023-04-29 09:43 UTC (History)
3 users (show)

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


Attachments
build log (build.log,374.54 KB, text/plain)
2020-12-07 15:59 UTC, Luke-Jr
Details
emerge --info (emerge--info,24.02 KB, text/plain)
2020-12-10 14:49 UTC, Luke-Jr
Details
build log w/o custom-cflags (build.log,244.88 KB, text/plain)
2020-12-10 14:49 UTC, Luke-Jr
Details
7.0 build log (build.log.zst,93.73 KB, application/zstd)
2022-04-27 23:03 UTC, Luke-Jr
Details
emerge --info (emerge--info,23.87 KB, text/plain)
2022-04-27 23:04 UTC, Luke-Jr
Details
updated build log for wine-vanilla-7.0-r3 using -crossdev-mingw -custom-cflags (wine-vanilla-7.0-r3-build.log.zst,173.13 KB, application/zstd)
2022-10-23 23:38 UTC, Luke-Jr
Details
emerge --info (emerge--info.ishi,11.84 KB, text/plain)
2022-10-24 01:55 UTC, Luke-Jr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke-Jr 2020-12-07 15:59:05 UTC
Created attachment 677155 [details]
build log

x86_64-pc-linux-gnu-gcc -m32 -c -o mkstemps.o /var/tmp/portage/app-emulation/wine-vanilla-5.0.2/work/wine-5.0.2/libs/port/mkstemps.c \
  -I. -I/var/tmp/portage/app-emulation/wine-vanilla-5.0.2/work/wine-5.0.2/libs/port -I../../include \
  -I/var/tmp/portage/app-emulation/wine-vanilla-5.0.2/work/wine-5.0.2/include -D__WINESRC__ \
  -D_REENTRANT -fno-PIC -Wall -pipe -fno-tree-loop-distribute-patterns -fcf-protection=none \
  -fno-stack-protector -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body \
  -Wignored-qualifiers -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \
  -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op \
  -fno-omit-frame-pointer -march=x86-64  -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=haswell  -O2  -fno-reorder-blocks  -pipe  -ggdb3   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
...
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../libs/port/libwine_port.a(mkstemps.o): warning: relocation in read-only section `.text'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../libs/port/libwine_port.a(mkstemps.o): direct GOT relocation R_386_GOT32 against `strlen@@GLIBC_2.0' without base register can not be used when making a shared object
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:222: winegcc] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-emulation/wine-vanilla-5.0.2/work/wine-5.0.2-abi_x86_32.x86/tools/winegcc'

This is a regression: 4.0.3 builds fine.
Comment 1 Chiitoo gentoo-dev 2020-12-09 11:55:34 UTC
Can't reproduce so far.

Could you include your 'emerge --info'?

Also, I see 'custom-cflags'.  Does this happen with that flag disabled as well?

Thanks!
Comment 2 Luke-Jr 2020-12-10 14:49:36 UTC
Created attachment 677575 [details]
emerge --info
Comment 3 Luke-Jr 2020-12-10 14:49:58 UTC
Created attachment 677578 [details]
build log w/o custom-cflags
Comment 4 Luke-Jr 2020-12-10 14:52:10 UTC
USE=-custom-cflags had the same problem (see attached build log)

It seems WINE is intentionally turning off PIC for 32-bit builds, and the x86_64 linker is enforcing it being required despite -m32. (IIRC, x86_32 doesn't require PIC for shared libs, while x86_64 does)

FWIW I have binutils 2.34-r2 at the moment
Comment 5 Nick Sarnie gentoo-dev 2021-08-05 14:53:07 UTC
Is this still reproducible with in-tree versions?
Comment 6 Luke-Jr 2021-09-07 02:47:34 UTC
Hitting this with app-emulation/wine-vanilla-6.0.1 on amd64
Comment 7 Luke-Jr 2021-12-11 17:03:18 UTC
Still an issue with 6.0.2.

Also noted that all working versions have been pruned from the tree...
Comment 8 Chiitoo gentoo-dev 2021-12-12 15:00:35 UTC
I just tried building 6.0.2 mirroring your CFLAGS and USE-flags mostly as much as I can, but still could not hit the error...

If I find the time and energy for it at some point, I'll try building a test install using the hardened profile and further align with your set-up.

Could you upload a new 'emerge --info' and build log even if they seem identical to the year-old ones.

Thanks!
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-08 03:34:35 UTC
This binutils change might be related: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=30a954525f4e53a9cd50a1a8a6f201c7cf6595c7.
Comment 10 Luke-Jr 2022-04-27 23:03:19 UTC
Created attachment 775080 [details]
7.0 build log

build log from 7.0 (still affected)
Comment 11 Luke-Jr 2022-04-27 23:04:02 UTC
Created attachment 775083 [details]
emerge --info

Updated emerge --info
Comment 12 Nick Sarnie gentoo-dev 2022-05-23 22:29:35 UTC
Can you repro with in-tree versions of wine or binutils?
Comment 13 Luke-Jr 2022-05-23 23:55:35 UTC
(In reply to Nick Sarnie from comment #12)
> Can you repro with in-tree versions of wine or binutils?

This has only ever been with in-tree versions...
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-23 23:56:56 UTC
(In reply to Luke-Jr from comment #13)
> (In reply to Nick Sarnie from comment #12)
> > Can you repro with in-tree versions of wine or binutils?
> 
> This has only ever been with in-tree versions...

That doesn't make much sense given you originally posted this in December 2020. Nick is asking if you can reproduce still this with the latest versions in tree, or at least things still in tree. i.e. Is it still relevant?
Comment 15 Luke-Jr 2022-05-24 01:04:12 UTC
(In reply to Sam James from comment #14)
> (In reply to Luke-Jr from comment #13)
> > (In reply to Nick Sarnie from comment #12)
> > > Can you repro with in-tree versions of wine or binutils?
> > 
> > This has only ever been with in-tree versions...
> 
> That doesn't make much sense given you originally posted this in December
> 2020. Nick is asking if you can reproduce still this with the latest
> versions in tree, or at least things still in tree. i.e. Is it still
> relevant?

Already confirmed it is still relevant less than a month ago: https://bugs.gentoo.org/758914#c10

Nothing in the diff for -r2 indicates it's worth re-testing.
Comment 16 Nick Sarnie gentoo-dev 2022-05-24 01:06:08 UTC
Thanks, as the issue seems to be related to binutils and the linked upstream bug was fixed in the past few months, I thought maybe a recent gentoo version bump of binutils might have fixed it.
Comment 17 Ionen Wolkens gentoo-dev 2022-10-22 08:48:14 UTC
Is this really still happening? Never ran into this while revamping ebuilds (old ones are gone, so testing with the new ones may help), and binutils got bumped a few times since.
Comment 18 Luke-Jr 2022-10-22 17:31:15 UTC
(In reply to Ionen Wolkens from comment #17)
> Is this really still happening? Never ran into this while revamping ebuilds
> (old ones are gone, so testing with the new ones may help), and binutils got
> bumped a few times since.

Already confirmed it is still relevant with the current stable version: https://bugs.gentoo.org/758914#c10

app-emulation/wine-vanilla-7.18 however fails with a different error:

/var/tmp/portage/app-emulation/wine-vanilla-7.18/work/wine-7.18/dlls/winecrt0/exception.c:93:1: internal compiler error: in seh_emit_stackalloc, at config/i386/winnt.cc:1055

This was using x86_64-w64-mingw32-gcc (Gentoo 12.2.0 p1) 12.2.0
Comment 19 Ionen Wolkens gentoo-dev 2022-10-22 17:53:36 UTC
(In reply to Luke-Jr from comment #18)
> (In reply to Ionen Wolkens from comment #17)
> > Is this really still happening? Never ran into this while revamping ebuilds
> > (old ones are gone, so testing with the new ones may help), and binutils got
> > bumped a few times since.
> 
> Already confirmed it is still relevant with the current stable version:
> https://bugs.gentoo.org/758914#c10
I meant with the current ebuild (7.0-r3 is a completely new ebuild) and updated toolchain (especially new binutils), not from 6 months ago.

> app-emulation/wine-vanilla-7.18 however fails with a different error:
> 
> /var/tmp/portage/app-emulation/wine-vanilla-7.18/work/wine-7.18/dlls/
> winecrt0/exception.c:93:1: internal compiler error: in seh_emit_stackalloc,
> at config/i386/winnt.cc:1055
> 
> This was using x86_64-w64-mingw32-gcc (Gentoo 12.2.0 p1) 12.2.0
Hm, related?
https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=e2c717c7

Are you using crossdev or mingw64-toolchain? And did you pass any fancy flags?
Comment 20 Ionen Wolkens gentoo-dev 2022-10-22 18:04:31 UTC
(In reply to Ionen Wolkens from comment #19)
> Hm, related?
> https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=e2c717c7
> 
> Are you using crossdev or mingw64-toolchain? And did you pass any fancy
> flags?
... and for the record, mingw generally doesn't play too well with hardening features (both on the toolchain itself and wine) -- already had to filter stack protection flags for one (may be able to allow it in the future given mingw is trying to implement some of these though), but that may not be the only issue.
Comment 21 Luke-Jr 2022-10-22 21:17:42 UTC
USE=hardened isn't enabled

[ebuild   R   ~] cross-x86_64-w64-mingw32/gcc-12.2.0:12::auto  USE="custom-cflags cxx lto nls nptl openmp (pie) (ssp) valgrind zstd -ada -cet -d -debug -doc (-fixed-point) -fortran -go -graphite -hardened -jit -libssp -multilib -objc -objc++ -objc-gc (-pch) -pgo -sanitize -systemtap -test -vanilla -vtv" 0 KiB
[ebuild   R   ~] cross-x86_64-w64-mingw32/mingw64-runtime-10.0.0-r1::auto  USE="-default-ucrt -headers-only -idl -libraries -tools" 0 KiB
[ebuild   R    ] cross-x86_64-w64-mingw32/binutils-2.38-r2:2.38::auto  USE="gold multitarget nls plugins -cet -default-gold -doc -pgo -static-libs -test -vanilla" 0 KiB
Comment 22 Ionen Wolkens gentoo-dev 2022-10-23 00:25:06 UTC
>(pie)
Why is (pie) enabled? crossdev not only tries to disable it for mingw but even puts it in package.use.mask (to override hardened profile's use.force, so should be seeing (-pie) with the mask).

    $ grep pie /etc/portage/profile/package.use.mask/cross-x86_64-w64-mingw32 
    cross-x86_64-w64-mingw32/gcc  pie -nopie multilib

Haven't tried but this is probably what caused your original issue, please make sure it's disabled as intended.

For the ICE, I don't know. I'd personally suggest to try wine with USE="-custom-cflags -crossdev-mingw" (also -custom-cflags for mingw64-toolchain that will be pulled as a dep) to rule out some possibilities. If not enough, may need to look into other hardening stuff you're using.
Comment 23 Ionen Wolkens gentoo-dev 2022-10-23 01:15:54 UTC
On as side-note, if never removed the pie mask yourself, odds are it's because you ran crossdev long ago before this was added and it never updated (not much I can do about this, part of why mingw64-toolchain exists given it's easier to keep it working with wine).
Comment 24 Ionen Wolkens gentoo-dev 2022-10-23 01:19:20 UTC
(In reply to Ionen Wolkens from comment #22)
> Haven't tried but this is probably what caused your original issue, please
> make sure it's disabled as intended.
Well, correction there. Guess wine-4.0.3 didn't have USE=mingw back then -- so maybe it's instead causing the current or continued issues.
Comment 25 Luke-Jr 2022-10-23 03:09:45 UTC
# grep 'mingw.*\bpie\b' /etc/portage/ -r
/etc/portage/package.use/cross-i686-w64-mingw32:cross-i686-w64-mingw32/gcc -sanitize -vtv -pie nopie cxx -tools -selinux -boundschecking -d -gcj -gtk -libffi -mudflap -objc -objc++ -objc-gc -multilib

Kind of at a loss for what is forcing pie on. :/
Comment 26 Luke-Jr 2022-10-23 03:18:53 UTC
Noticed that is for i686 mingw, so ran `crossdev -t x86_64-w64-mingw32 --init-target` and now it is happy rebuilding without pie. Will report back.
Comment 27 Luke-Jr 2022-10-23 03:49:05 UTC
(In reply to Luke-Jr from comment #18)
> app-emulation/wine-vanilla-7.18 however fails with a different error:
> 
> /var/tmp/portage/app-emulation/wine-vanilla-7.18/work/wine-7.18/dlls/
> winecrt0/exception.c:93:1: internal compiler error: in seh_emit_stackalloc,
> at config/i386/winnt.cc:1055

Still getting this with pie-free gcc :/
Comment 28 Luke-Jr 2022-10-23 04:01:41 UTC
Same with 7.0-r3 FWIW
Comment 29 Ionen Wolkens gentoo-dev 2022-10-23 04:16:40 UTC
(In reply to Ionen Wolkens from comment #22)
> For the ICE, I don't know. I'd personally suggest to try wine with
> USE="-custom-cflags -crossdev-mingw" (also -custom-cflags for
> mingw64-toolchain that will be pulled as a dep) to rule out some
> possibilities. If not enough, may need to look into other hardening stuff
> you're using.
Comment 30 Ionen Wolkens gentoo-dev 2022-10-23 04:24:24 UTC
Note that since you're talking of crossdev, I've been assuming you have USE=crossdev-mingw set right now (it doesn't use crossdev if that's not set).
Comment 31 Ionen Wolkens gentoo-dev 2022-10-23 04:25:30 UTC
(In reply to Ionen Wolkens from comment #30)
> Note that since you're talking of crossdev, I've been assuming you have
> USE=crossdev-mingw set right now (it doesn't use crossdev if that's not set).
...without some updated build.log / emerge --info, have to mostly guess around
Comment 32 Luke-Jr 2022-10-23 06:43:17 UTC
dev-util/mingw64-toolchain-10.0.0_p1-r1[-custom-cflags] also fails to build with an ICE in seh_emit_stackalloc :/
Comment 33 Ionen Wolkens gentoo-dev 2022-10-23 07:00:03 UTC
Looking at your old emerge --info (assuming still up to date), I see -fstack-clash-protection (which won't get stripped even with -custom-cflags), maybe need to force-filter it too.

Message is a bit different but I'm looking at: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458

Could you try without?
Comment 34 Larry the Git Cow gentoo-dev 2022-10-23 07:20:58 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9512a3db7da6f8ee2afa1854b370a37cea0abaf

commit d9512a3db7da6f8ee2afa1854b370a37cea0abaf
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2022-10-23 07:15:50 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-10-23 07:20:05 +0000

    dev-util/mingw64-toolchain: filter -fstack-clash-protection
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild | 1 +
 1 file changed, 1 insertion(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f73fa3368e506eb6ee5bfafb73c3d10bee4a012b

commit f73fa3368e506eb6ee5bfafb73c3d10bee4a012b
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2022-10-23 07:15:28 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-10-23 07:20:04 +0000

    app-emulation/wine-proton: filter -fstack-clash-protection
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/wine-proton/wine-proton-7.0.4.ebuild    | 1 +
 app-emulation/wine-proton/wine-proton-7.0.9999.ebuild | 1 +
 2 files changed, 2 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ee64d3cef989374e74da4be22398e10e5a54d4d

commit 3ee64d3cef989374e74da4be22398e10e5a54d4d
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2022-10-23 07:15:17 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-10-23 07:20:04 +0000

    app-emulation/wine-staging: filter -fstack-clash-protection
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/wine-staging/wine-staging-7.17.ebuild | 1 +
 app-emulation/wine-staging/wine-staging-7.18.ebuild | 1 +
 app-emulation/wine-staging/wine-staging-7.19.ebuild | 1 +
 app-emulation/wine-staging/wine-staging-9999.ebuild | 1 +
 4 files changed, 4 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc5460b747ada1490fb3958477084f647293df5e

commit bc5460b747ada1490fb3958477084f647293df5e
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2022-10-23 07:15:10 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-10-23 07:20:04 +0000

    app-emulation/wine-vanilla: filter -fstack-clash-protection
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/wine-vanilla/wine-vanilla-7.0-r3.ebuild | 1 +
 app-emulation/wine-vanilla/wine-vanilla-7.17.ebuild   | 1 +
 app-emulation/wine-vanilla/wine-vanilla-7.18.ebuild   | 1 +
 app-emulation/wine-vanilla/wine-vanilla-7.19.ebuild   | 1 +
 app-emulation/wine-vanilla/wine-vanilla-9999.ebuild   | 1 +
 5 files changed, 5 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4db7f4b4a6e01072a93ada1cb0118db7e5e1e5c7

commit 4db7f4b4a6e01072a93ada1cb0118db7e5e1e5c7
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2022-10-23 07:15:02 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-10-23 07:20:03 +0000

    app-emulation/vkd3d-proton: filter -fstack-clash-protection
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/vkd3d-proton/vkd3d-proton-2.6.ebuild  | 1 +
 app-emulation/vkd3d-proton/vkd3d-proton-9999.ebuild | 1 +
 2 files changed, 2 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2ba01a42b0e5f60c3b1d53716c0542998f71869

commit a2ba01a42b0e5f60c3b1d53716c0542998f71869
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2022-10-23 07:14:55 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-10-23 07:20:03 +0000

    app-emulation/dxvk: filter -fstack-clash-protection
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/dxvk/dxvk-1.10.3.ebuild | 1 +
 app-emulation/dxvk/dxvk-9999.ebuild   | 1 +
 2 files changed, 2 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=320c0f7d7300cb5c834614e0fdbe99b3a9776f70

commit 320c0f7d7300cb5c834614e0fdbe99b3a9776f70
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2022-10-23 07:14:45 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-10-23 07:20:03 +0000

    dev-util/mingw64-runtime: filter -fstack-clash-protection
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild | 1 +
 dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild  | 1 +
 dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild  | 1 +
 3 files changed, 3 insertions(+)
Comment 35 Ionen Wolkens gentoo-dev 2022-10-23 07:22:52 UTC
(In reply to Ionen Wolkens from comment #33)
> Looking at your old emerge --info (assuming still up to date), I see
> -fstack-clash-protection (which won't get stripped even with
> -custom-cflags), maybe need to force-filter it too.
> 
> Message is a bit different but I'm looking at:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458
> 
> Could you try without?
Yeah, I can reproduce.. so pretty sure that will fix it for the ICE.

Just need to confirm if dropping (pie) or using mingw64-toolchain fixed your original issue to (hopefully) close this.
Comment 36 Luke-Jr 2022-10-23 23:36:59 UTC
(In reply to Ionen Wolkens from comment #35)
> (In reply to Ionen Wolkens from comment #33)
> > Looking at your old emerge --info (assuming still up to date), I see
> > -fstack-clash-protection (which won't get stripped even with
> > -custom-cflags), maybe need to force-filter it too.
> > 
> > Message is a bit different but I'm looking at:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458
> > 
> > Could you try without?
> Yeah, I can reproduce.. so pretty sure that will fix it for the ICE.

Confirmed, ICE error gone without -fstack-clash-protection

> Just need to confirm if dropping (pie) or using mingw64-toolchain fixed your
> original issue to (hopefully) close this.

Nope, GOT errors remain no matter what USE combinations I try. :/
Comment 37 Luke-Jr 2022-10-23 23:38:16 UTC
Created attachment 825157 [details]
updated build log for wine-vanilla-7.0-r3 using -crossdev-mingw -custom-cflags
Comment 38 Ionen Wolkens gentoo-dev 2022-10-24 01:12:45 UTC
Updated emerge --info too? I'm seeing some -fuse-ld=lld in there that weren't in your older one (albeit that bit shouldn't be an issue given it forces bfd due to other problems and I've tried to build this with -fuse-ld=lld before).

Also want to confirm current binutils version, should have at least >=binutils-2.38 selected in `eselect binutils list` at this point (as long as it's not 2.37. albeit afaik it was fine with 2.37 but could be due to a combination of things).
Comment 39 Luke-Jr 2022-10-24 01:55:34 UTC
Created attachment 825161 [details]
emerge --info
Comment 40 Luke-Jr 2022-10-24 01:56:01 UTC
 [1] armv7a-hardfloat-linux-gnueabi-2.37_p1 *
 [2] armv7a-hardfloat-linux-gnueabi-2.38

 [3] armv7a-softfloat-linux-gnueabi-2.37_p1 *
 [4] armv7a-softfloat-linux-gnueabi-2.38

 [5] i686-w64-mingw32-2.37_p1 *
 [6] i686-w64-mingw32-2.38

 [7] powerpc64le-unknown-linux-gnu-2.37_p1 *
 [8] powerpc64le-unknown-linux-gnu-2.38

 [9] x86_64-pc-linux-gnu-2.37_p1
 [10] x86_64-pc-linux-gnu-2.38 *

 [11] x86_64-w64-mingw32-2.37_p1
 [12] x86_64-w64-mingw32-2.38 *
Comment 41 Ionen Wolkens gentoo-dev 2022-10-24 03:15:01 UTC
Tried with same binutils+gcc+c/ldflags+USE (gcc built with hardened profile too fwiw), but still can't reproduce (not that I've tried glibc-2.33 that you seem to still be using).

I don't think it's an issue but fwiw there's still mingw 2.37 on:
 [5] i686-w64-mingw32-2.37_p1 *
 [6] i686-w64-mingw32-2.38
With -crossdev-mingw it adds /usr/lib/mingw64-toolchain/bin in front of PATH and i686-w64-mingw32-ld would be from there anyway, so that "should" be unused.

Sorry, out of ideas and not finding anyone else that ran into this for some hints.
Comment 42 Ionen Wolkens gentoo-dev 2022-10-26 15:12:42 UTC
I'll go ahead and close this for now, afaik nobody been able to reproduce and haven't seen anyone else affected, don't think much more we can do unless figure out what's special about your system.
Comment 43 Larry the Git Cow gentoo-dev 2023-04-29 09:43:32 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb62cf0b7099c567c9cf43b78a82ee07771d682b

commit bb62cf0b7099c567c9cf43b78a82ee07771d682b
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-04-29 09:31:24 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-04-29 09:42:40 +0000

    app-emulation/wine-staging: remove obsolete clash-protection filter
    
    ICE was fixed (bug #758914), if still run into this then updating
    gcc to a newer _p* snapshot should sort it (alternatively, use
    released >=gcc-13.1.0).
    
    Note that -fstack-protector* (bug #870136) is still needed, while
    mingw64-runtime-11.0.0 add some degree of support, it still seems
    to fail for Wine itself.
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/wine-staging/wine-staging-8.0.ebuild   | 1 -
 app-emulation/wine-staging/wine-staging-8.5.ebuild   | 1 -
 app-emulation/wine-staging/wine-staging-8.6.1.ebuild | 1 -
 app-emulation/wine-staging/wine-staging-9999.ebuild  | 1 -
 4 files changed, 4 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a32b129cb14dc4434bc05fd99a7275a4aab77593

commit a32b129cb14dc4434bc05fd99a7275a4aab77593
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-04-29 09:30:51 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-04-29 09:42:40 +0000

    app-emulation/wine-proton: remove obsolete clash-protection filter
    
    ICE was fixed (bug #758914), if still run into this then updating
    gcc to a newer _p* snapshot should sort it (alternatively, use
    released >=gcc-13.1.0).
    
    Note that -fstack-protector* (bug #870136) is still needed, while
    mingw64-runtime-11.0.0 add some degree of support, it still seems
    to fail for Wine itself.
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/wine-proton/wine-proton-7.0.5.ebuild    | 1 -
 app-emulation/wine-proton/wine-proton-7.0.6.ebuild    | 1 -
 app-emulation/wine-proton/wine-proton-7.0.9999.ebuild | 1 -
 app-emulation/wine-proton/wine-proton-8.0.1d.ebuild   | 1 -
 app-emulation/wine-proton/wine-proton-8.0.9999.ebuild | 1 -
 5 files changed, 5 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4e5ef8fe7a9ce61c9177d1b107a329e6ac53872

commit b4e5ef8fe7a9ce61c9177d1b107a329e6ac53872
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-04-29 09:28:06 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-04-29 09:42:39 +0000

    app-emulation/wine-vanilla: remove obsolete clash-protection filter
    
    ICE was fixed (bug #758914), if still run into this then updating
    gcc to a newer _p* snapshot should sort it (alternatively, use
    released >=gcc-13.1.0).
    
    Note that -fstack-protector* (bug #870136) is still needed, while
    mingw64-runtime-11.0.0 add some degree of support, it still seems
    to fail for Wine itself.
    
    Bug: https://bugs.gentoo.org/758914
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/wine-vanilla/wine-vanilla-7.0.1.ebuild | 1 -
 app-emulation/wine-vanilla/wine-vanilla-7.0.2.ebuild | 1 -
 app-emulation/wine-vanilla/wine-vanilla-8.0.1.ebuild | 1 -
 app-emulation/wine-vanilla/wine-vanilla-8.0.ebuild   | 1 -
 app-emulation/wine-vanilla/wine-vanilla-8.5.ebuild   | 1 -
 app-emulation/wine-vanilla/wine-vanilla-8.6.ebuild   | 1 -
 app-emulation/wine-vanilla/wine-vanilla-8.7.ebuild   | 1 -
 app-emulation/wine-vanilla/wine-vanilla-9999.ebuild  | 1 -
 8 files changed, 8 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=527d13170d519590c4fa3fd320d0c6a3bd5d88fc

commit 527d13170d519590c4fa3fd320d0c6a3bd5d88fc
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-04-29 09:14:28 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-04-29 09:42:39 +0000

    app-emulation/vkd3d-proton: update flags filters
    
    * -fstack-clash-protection (bug #758914): ICE was fixed, if still
      run into this then updating gcc to a newer _p* snapshot should
      sort it (alternatively, use released >=gcc-13.1.0)
    * -fstack-protector* (bug #870136): mingw64-runtime-11.0.0 adds
      its own (partial) ssp support, allowing -D_FORTIFY_SOURCE=3 and
      -fstack-protector-strong without libssp. Using these to build
      Wine currently still leads to failure, but we can allow it here.
    
    Bug: https://bugs.gentoo.org/758914
    Bug: https://bugs.gentoo.org/870136
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/vkd3d-proton/vkd3d-proton-2.6.ebuild           | 10 +++++++---
 app-emulation/vkd3d-proton/vkd3d-proton-2.8.ebuild           | 10 +++++++---
 app-emulation/vkd3d-proton/vkd3d-proton-2.8_p20230207.ebuild |  8 ++++++--
 app-emulation/vkd3d-proton/vkd3d-proton-9999.ebuild          | 10 +++++++---
 4 files changed, 27 insertions(+), 11 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fca841ad33dbb0e5c6cd29950331b30ab2364d8d

commit fca841ad33dbb0e5c6cd29950331b30ab2364d8d
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-04-29 09:02:52 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-04-29 09:42:39 +0000

    app-emulation/dxvk: update flags filters
    
    * -fstack-clash-protection (bug #758914): ICE was fixed, if still
      run into this then updating gcc to a newer _p* snapshot should
      sort it (alternatively, use released >=gcc-13.1.0)
    * -fstack-protector* (bug #870136): mingw64-runtime-11.0.0 adds
      its own (partial) ssp support, allowing -D_FORTIFY_SOURCE=3 and
      -fstack-protector-strong without libssp. Using these to build
      Wine currently still leads to failure, but we can allow it here.
    
    Bug: https://bugs.gentoo.org/758914
    Bug: https://bugs.gentoo.org/870136
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 app-emulation/dxvk/dxvk-1.10.3.ebuild        | 8 ++++++--
 app-emulation/dxvk/dxvk-2.0.ebuild           | 8 ++++++--
 app-emulation/dxvk/dxvk-2.1.ebuild           | 8 ++++++--
 app-emulation/dxvk/dxvk-2.1_p20230207.ebuild | 8 ++++++--
 app-emulation/dxvk/dxvk-9999.ebuild          | 8 ++++++--
 5 files changed, 30 insertions(+), 10 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97613a229fa10fd2589e122e64bae6156133987f

commit 97613a229fa10fd2589e122e64bae6156133987f
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-04-29 08:03:41 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-04-29 09:42:39 +0000

    dev-util/mingw64-toolchain: add 11.0.0
    
    Also remove two obsolete flags filters:
    * -fstack-clash-protection (bug #758914): ICE was fixed, if still
      run into this then updating gcc to a newer _p* snapshot should
      sort it (alternatively, use released >=gcc-13.1.0)
    * -fstack-protector* (bug #870136): mingw64-runtime-11.0.0 adds
      its own (partial) ssp support, allowing -D_FORTIFY_SOURCE=3 and
      -fstack-protector-strong without libssp. Using these to build
      Wine currently still leads to failure, but we can allow it here.
    
    Bug: https://bugs.gentoo.org/758914
    Bug: https://bugs.gentoo.org/870136
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 +
 .../mingw64-toolchain-11.0.0.ebuild                | 317 +++++++++++++++++++++
 2 files changed, 318 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2779aaf2710bab9bedbd6d66501c04b1552b54ad

commit 2779aaf2710bab9bedbd6d66501c04b1552b54ad
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-04-29 04:24:51 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-04-29 09:42:39 +0000

    dev-util/mingw64-runtime: add 11.0.0
    
    Tentatively remove the ssp patch. Bootstrapping using USE=ssp seems
    to work both with and without libssp. The libscrypt reproducer from
    the patch's old link also builds fine with this version.
    
    Also remove two obsolete flags filters:
    * -fstack-clash-protection (bug #758914): ICE was fixed, if still
      run into this then updating gcc to a newer _p* snapshot should
      sort it (alternatively, use released >=gcc-13.1.0)
    * -fstack-protector* (bug #870136): mingw64-runtime-11.0.0 adds
      its own (partial) ssp support, allowing -D_FORTIFY_SOURCE=3 and
      -fstack-protector-strong without libssp. Using these to build
      Wine currently still leads to failure, but we can allow it here.
    
    Bug: https://bugs.gentoo.org/758914
    Bug: https://bugs.gentoo.org/870136
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-util/mingw64-runtime/Manifest                  |   1 +
 .../mingw64-runtime/mingw64-runtime-11.0.0.ebuild  | 141 +++++++++++++++++++++
 2 files changed, 142 insertions(+)