boost icon indicating copy to clipboard operation
boost copied to clipboard

1.88.0 build fails on powerpc64le-linux-gnu with IEEE long double

Open doko42 opened this issue 11 months ago • 15 comments

The 1.88.0 build fails on powerpc64le-linux-gnu with IEEE long double enabled. It still succeeds with with IBM long double. The 1.83.0 build succeeds with both long double configurations.

a failing build log can be found at https://launchpad.net/ubuntu/+source/boost1.88/1.88.0-1ubuntu2/+build/30693987/+files/buildlog_ubuntu-questing-ppc64el.boost1.88_1.88.0-1ubuntu2_BUILDING.txt.gz

however it's non-obvious what exactly is failing ... any hint?

doko42 avatar May 07 '25 08:05 doko42

There seems to be two issues in this bug

  1. The build silently fails when charconv library build fails (the logs say that the targets have been skipped, but the exit status from the build process is 1 meaning not successful, and therefore the over build fails). If we run the build with b2 again, we can see the error particularly in the charconv library
  2. Redefinition of functions in charconv library. When ieeelongdouble is enabled, the types for long double and __float128 is essentially the same during compilation and we see the following error
/home/avinashj/src/boost_1.88_src/libs/charconv/build/../src/to_chars_float_impl.hpp:849:17: error: redefinition of ‘boost::charconv::to_chars_result boost::charconv::detail::to_chars_float_impl(char*, char*, Real, boost::charconv::chars_format, int) [with Real = long double]’
  849 | to_chars_result to_chars_float_impl(char* first, char* last, __float128 value, chars_format fmt, int precision) noexcept
      |                 ^~~~~~~~~~~~~~~~~~~
/home/avinashj/src/boost_1.88_src/libs/charconv/build/../src/to_chars_float_impl.hpp:776:17: note: ‘boost::charconv::to_chars_result boost::charconv::detail::to_chars_float_impl(char*, char*, Real, boost::charconv::chars_format, int) [with Real = long double]’ previously declared here
  776 | to_chars_result to_chars_float_impl(char* first, char* last, long double value, chars_format fmt, int precision) noexcept
      |                 ^~~~~~~~~~~~~~~~~~~

specifically the macros BOOST_CHARCONV_HAS_QUADMATH and BOOST_CHARCONV_UNSUPPORTED_LONG_DOUBLE are defined and undefined respectively, and therefore both definitions move on for compilation after pre-processing which causes this specific error. Small note: In some architectures like IA-64 __float128 is an alias for long double (more details here: https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html.), so this error would happen there as well. For example, in x86 platform if -mlong-double-128 compiler option is used (however here error happens at assembly stage rather than at compile stage).

avithemad avatar Jul 17 '25 12:07 avithemad

@doko42 , please let me know in case we need to investigate this further for why both macros are turned on during compilation.

avithemad avatar Jul 22 '25 05:07 avithemad

that would be nice for a first successful build

doko42 avatar Jul 27 '25 12:07 doko42

The errors mention "charconv", @mborland might know.

sdarwin avatar Jul 27 '25 12:07 sdarwin

@doko42 Can you please give https://github.com/boostorg/charconv/pull/278 a try if you have a chance? I added an extra configuration macro that checks for the number of mantissa bits in a long double on PPC64 which should tell us if you're using IEEE754 ldbl or IBM128 ldbl.

mborland avatar Jul 30 '25 13:07 mborland

please see https://launchpad.net/~doko/+archive/ubuntu/toolchain/+sourcepub/17487487/+listing-archive-extra it looks that the build is progressing further, but it still fails

doko42 avatar Aug 04 '25 09:08 doko42

Sorry for the noise; the linked PR should be good now. I have local dockers running PPC64LE with IBM128 and IEEE128 and both build and run fine with the updated PR.

mborland avatar Aug 04 '25 14:08 mborland

it's running longer, now having a 5.7MB compressed build log, but unfortunately again, without any visible error message. please see https://launchpad.net/~doko/+archive/ubuntu/toolchain/+build/31057161

doko42 avatar Aug 04 '25 16:08 doko42

Any chance you could try building boost from source on that platform using either B2 or Cmake? It should give us the error messages.

mborland avatar Aug 04 '25 16:08 mborland

requested in https://bugs.debian.org/1110432, I'm not the original maintainer

doko42 avatar Aug 05 '25 14:08 doko42

Thanks. In the meantime I pushed another attempt at a fix to the linked PR. Once again it runs fine locally on QEMU ppc64le with Docker, but I have not been able to replicate the original bug.

mborland avatar Aug 05 '25 15:08 mborland

@mborland Perhaps you can try adding "-mabi=ieeelongdouble" to the CFLAGS and CXXFLAGS, and try to compile to see this error. I think by default it is just using the ibmlongdouble and so you are not able to reproduce it.

avithemad avatar Aug 06 '25 05:08 avithemad

https://launchpad.net/ubuntu/+source/boost1.88/1.88.0-1ubuntu4 builds fine

the applied patch is http://launchpadlibrarian.net/809518464/boost1.88_1.88.0-1ubuntu3_1.88.0-1ubuntu4.diff.gz

doko42 avatar Aug 06 '25 06:08 doko42

I have updated the linked PR to match the applied patch.

mborland avatar Aug 06 '25 13:08 mborland

Merged for 1.89 release

mborland avatar Aug 06 '25 18:08 mborland