]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: fix new sigfe.o generation in optimized case
authorCorinna Vinschen <corinna@vinschen.de>
Fri, 13 May 2022 19:22:44 +0000 (21:22 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 13 May 2022 19:22:44 +0000 (21:22 +0200)
commit8f66bc28ae461763d1da91384a652512590eea16
tree6440a4a088a541692db2e555f35961b2a3c5f77a
parent4f034daba70f359015f79cba3d5fb3d0d468924e
Cygwin: fix new sigfe.o generation in optimized case

Commit 0597c84b9bdb ("Cygwin: revamp TLS offsets computation")
introduced a really weird problem when building Cygwin with
optimization.

First of all, the tlsoffsets file is broken with -O2.  This
can easily be fixed by running the compiler with -O0 when called
from the gentls_offsets script.

But it gets worse:

When creating sigfe.o with optimization, the generated machine code
uses incorrect offsets: For some reason the assembler codes using
_cygtls.stackptr as offset value are assembled into machine code
using _cygtls.pstackptr as offsets.

And as if that isn't already absurd enough, renaming _cygtls.pstackptr
to, say, _cygtls.blurb, fixes the assembled machine code expressions;
they use the value of _cygtls.stackptr again.

So I changed gentls_offsets and gendef to use _cygtls.foo_p rather
than _cygtls.pfoo and that fixes the assembled code in the optimized
case.

No, I can't explain that.  There's no system in that behaviour.
It looks absolutely crazy.

Fixes: 0597c84b9bdb ("Cygwin: revamp TLS offsets computation")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/gendef
winsup/cygwin/gentls_offsets
This page took 0.030212 seconds and 5 git commands to generate.