gcc-11 C++ Regression on Cygwin
Sun May 2 07:10:19 GMT 2021
在 2021-05-02 08:02, James McKelvey 写道:
> My code works fine on Cygwin using C++ 10.2.0. But it fails when I build with the latest gcc-11 snapshot,gcc-11-20210426, with undefined references at link time. It fails under -O3 and -O0, with differenterrors. It failed under earlier snapshots as well.
We have been aware of this issue since a while ago. I had some discussion
with Jonathan Yong (who is
notably the Cygwin port maintainer), but there was no conclusion:
Apr 01 22:15:51 <lh_mouse> what's the error?
Apr 01 22:17:40 <jon_y> strange I am not able to reproduce it now
Apr 01 22:17:50 <jon_y> oh I think I know what the problem was
Apr 01 22:18:06 <jon_y> gcc11 was producing broken powf() from the crt
Apr 01 22:18:23 <jon_y> for some reason it generated undefined internal compiler symbols
Apr 01 22:18:28 <jon_y> like U LC5
Apr 01 22:18:41 <jon_y> switching back to gcc-10 fixed it
Apr 01 22:19:03 <lh_mouse> that is defined in 'powf.c' I think.
Apr 01 22:19:13 <jon_y> and because I did not rebuild the crt right after, it must be the reason why
the compiler tries to generate its own
Apr 01 22:19:28 <jon_y> I mean, there's an inline version in math.h
Apr 01 22:19:38 <jon_y> and then another copy in libstdc++-v3/src/c++98/math_stubs_float.cc
Apr 01 22:19:54 <jon_y> powf itself is defined
Apr 01 22:20:04 <jon_y> but the U LC5 is causing an undefined symbol error
Apr 01 22:20:19 <jon_y> I have no idea where this LC5 should be coming from
Apr 01 22:20:29 <jon_y> it only appears in the assembly, not even in the preprocessed file
Apr 01 22:20:35 <lh_mouse> so linking failed and configure thought `powf`
Apr 01 22:21:33 <jon_y> yes
Apr 01 22:21:50 <jon_y> the solution was to revert back to gcc10, rebuild
the crt and try again
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 840 bytes
Desc: OpenPGP digital signature
More information about the Gcc-help