conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
966 stars 1.78k forks source link

[bug] Pulseaudio installation fail #18951

Open etiennebonnafoux opened 1 year ago

etiennebonnafoux commented 1 year ago

Environment details

Steps to reproduce

I try to install sdl 2 so my conanfile.txt is

[requires]
sdl/2.26.5

[generators]
CMakeDeps
CMakeToolchain

Then I do the command conan install . --output-folder=build --build=missing .

Sdl depends on Pulseaudio and when it comes to this library the installation bugs.

Logs

here is the end of the log where the bug seems to be. The full log is here


/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-libmpg123.o): in function `mpg123_eq_change':
libmpg123.c:(.text+0xe6d): undefined reference to `__exp_finite'
/usr/bin/ld: libmpg123.c:(.text+0x1045): undefined reference to `__exp_finite'
/usr/bin/ld: libmpg123.c:(.text+0x1220): undefined reference to `__exp_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-frame.o): in function `INT123_do_rva':
frame.c:(.text+0x18ee): undefined reference to `__exp_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-frame.o): in function `mpg123_volume_change_db':
frame.c:(.text+0x1a8a): undefined reference to `__exp_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-tabinit.o): in function `INT123_make_conv16to8_table':
tabinit.c:(.text+0xfab): undefined reference to `__log_finite'
/usr/bin/ld: tabinit.c:(.text+0x1009): undefined reference to `__log_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-layer3.o): in function `INT123_init_layer3_gainpow2_mmx':
layer3.c:(.text+0x3fdb): undefined reference to `__exp2_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-layer3.o): in function `INT123_init_layer3_gainpow2':
layer3.c:(.text+0x402b): undefined reference to `__exp2_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-libmpg123.o): in function `mpg123_eq_change':
libmpg123.c:(.text+0xe6d): undefined reference to `__exp_finite'
/usr/bin/ld: libmpg123.c:(.text+0x1045): undefined reference to `__exp_finite'
/usr/bin/ld: libmpg123.c:(.text+0x1220): undefined reference to `__exp_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-frame.o): in function `INT123_do_rva':
frame.c:(.text+0x18ee): undefined reference to `__exp_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-frame.o): in function `mpg123_volume_change_db':
frame.c:(.text+0x1a8a): undefined reference to `__exp_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-tabinit.o): in function `INT123_make_conv16to8_table':
tabinit.c:(.text+0xfab): undefined reference to `__log_finite'
/usr/bin/ld: tabinit.c:(.text+0x1009): undefined reference to `__log_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-layer3.o): in function `INT123_init_layer3_gainpow2_mmx':
layer3.c:(.text+0x3fdb): undefined reference to `__exp2_finite'
/usr/bin/ld: /home/etienne/.conan2/p/mpg120f2357dca7957/p/lib/libmpg123.a(libmpg123_la-layer3.o): in function `INT123_init_layer3_gainpow2':
layer3.c:(.text+0x402b): undefined reference to `__exp2_finite'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:7211 : pacat] Erreur 1
make[3]: *** Attente des tâches non terminées....
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:7229 : pactl] Erreur 1
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
make[3] : on quitte le répertoire « /home/etienne/.conan2/p/b/pulse672b857ab2150/b/build-release/src »
make[2]: *** [Makefile:5398 : all] Erreur 2
make[2] : on quitte le répertoire « /home/etienne/.conan2/p/b/pulse672b857ab2150/b/build-release/src »
make[1]: *** [Makefile:832 : all-recursive] Erreur 1
make[1] : on quitte le répertoire « /home/etienne/.conan2/p/b/pulse672b857ab2150/b/build-release »
make: *** [Makefile:647 : all] Erreur 2

pulseaudio/14.2: ERROR: 
Package '8cbe13a46946620a9a894d9f1850dca80d619f0b' build failed
pulseaudio/14.2: WARN: Build folder /home/etienne/.conan2/p/b/pulse672b857ab2150/b/build-release
*********************************************************
Recipe 'pulseaudio/14.2' cannot build its binary
It is possible that this recipe is not Conan 2.0 ready
If the recipe comes from ConanCenter check: https://conan.io/cci-v2.html
If it is your recipe, check if it is updated to 2.0
*********************************************************

ERROR: pulseaudio/14.2: Error in build() method, line 128
    autotools.make()
    ConanException: Error 2 while executing```
franramirez688 commented 1 year ago

Hi @etiennebonnafoux

Thanks for reporting this! Let me transfer this issue to Conan-center-index repository because it sounds like a problem in the recipe and not in the Conan client per se.

memsharded commented 1 year ago

The first step would be to try to isolate the issue. Please try to reproduce with conan install --requires=pulseaudio/14.2 --build=missing, and report the results here.

etiennebonnafoux commented 1 year ago

Hello,

Following your instruction I get the same kind of bug, it has something to do with undefined reference to __exp2_finite Here is the pastebin of the logs.

valgur commented 1 year ago

Related:

valgur commented 1 year ago

After doing some digging, it's clear this issue is caused by an ABI change introduced in glibc 2.31, which removed __*_finite math functions. The reason for the change can be found in the glibc mailing list:

For some of the functions in this file; pow, powf, log, logf, log2, log2f, exp, expf, exp2, and exp2f; the default implementations have been improved to handle the special cases and the *_finite names are just aliases of the normal name and so the asm attribute isn't accomplishing anything.

This itself should not have been a problem due to the functions not actually being a part of the public glibc API. However, both GCC and Clang apparently incorrectly relied on the private functions (https://reviews.llvm.org/D74712). This bug has been fixed in Clang since v10.0.0, but is still present in GCC.

They were only ever an ABI (selected by use of -ffinite-math-only or options implying it, which resulted in the headers using "asm" to redirect calls to some libm functions), not an API. The change means that ABI has turned into compat symbols (only available for existing binaries, not for anything newly linked, not included in static libm at all, not included in shared libm for future glibc ports such as RV32), so, yes, in any case where tools generate direct calls to those functions (rather than just following the "asm" annotations on function declarations in the headers), they need to stop doing so.

This issue only affects libraries that have -ffast-math and in turn -ffinite-math-only set, so the fix should be very simple: add -fno-finite-math-only to the compiler flags (as done here and suggested in this helpful blog post).

Of course, the root cause of this problem is the timeless issue of handling libc compatibility correctly in distributed binaries: https://github.com/conan-io/conan/issues/3972

etiennebonnafoux commented 1 year ago

Sorry for the late answer. It seems to be a solution but as I am a beginner with Conan and more generally in C++, I am not sure to understand how to fix it. Should I had -fno-finite-math-only somewhere in my conanfile.txt ? Thanks again for your precious help.

valgur commented 1 year ago

Sorry for the late answer. It seems to be a solution but as I am a beginner with Conan and more generally in C++, I am not sure to understand how to fix it. Should I had -fno-finite-math-only somewhere in my conanfile.txt ? Thanks again for your precious help.

The simplest workaround as a consumer should be to add --build=mpg123 to the conan install or conan create command. As long as you build the problematic packages locally, instead of relying on the binaries provided by the repo, you should be fine.

etiennebonnafoux commented 1 year ago

Sorry to bother you again but with the same configuration as detail above and with the command conan install . --output-folder=build --build=mpg123 --build=missing I get the same error. What I am missing ? Thank you for your help.