GMP test fails with -flto

Torbjörn Granlund tg at gmplib.org
Tue Jul 2 13:42:38 UTC 2019


Richard Biener <richard.guenther at gmail.com> writes:

  Yes, this should work.  It probably has a slightly higher chance of
  mismatching the start/end patterns elsewhere in the file, but well...

Thanks for checking my proposed patch!

Yes, I realise that we could get unlucky now, something which really
shouldn't happen with just the object file.  It's not neat, but it
should work.

A solution would be to make before[] and after[] huge enough that their
combined sizes are sure to be greater than 1/2 a plain executable.  Then
there is simply no space for a false match.  But as configure cannot
know the size of a plain executable, one would need to loop over
gradually larger before/after until

  2 * (sizeof(before)+sizeof(after)) > wc -c conftest

hold true.  :-)

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-bugs mailing list