Bug 15634 - fluidsynths refers to missing libgomp.so.1
Summary: fluidsynths refers to missing libgomp.so.1
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2023.05
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: Vincent Fazio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-18 16:30 UTC by stsp
Modified: 2023-08-31 14:43 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
defconfig (2.55 KB, application/octet-stream)
2023-06-18 19:47 UTC, stsp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stsp 2023-06-18 16:30:33 UTC
$ ldd /lib64/libfluidsynth.so
libgomp.so.1 => not found
<list of other deps that are not missing>
Comment 1 Yann E. MORIN 2023-06-18 19:36:39 UTC
stsp, All,

Can you provide your Buildroot defconfig file, please?

Regards,
Yann E. MORIN.
Comment 2 stsp 2023-06-18 19:47:24 UTC
Created attachment 9610 [details]
defconfig

Sure thing, here it is.
Comment 3 Vincent Fazio 2023-06-19 12:13:42 UTC
When I `make olddefconfig` with your defconfig, it looks like it's using bootlin's bleeding edge toolchain.

Bootlin recently (last year) enabled OpenMP support in the toolchain: https://github.com/bootlin/toolchains-builder/commit/93f88ed30a4fd13ada7e2debf0d035855a690585

FluidSynth _tests_ for OpenMP support:

https://github.com/FluidSynth/fluidsynth/blob/master/CMakeLists.txt#L734

Unfortunately, the default configured Bootlin external toolchains to not accurately reflect that OpenMP is supported due to a small issue with generating the fragments:

https://github.com/bootlin/toolchains-builder/issues/60

Those fragments are used by a parser to add the external toolchain entries to BR, but since they're not accurate, the selected toolchain features are also not accurate. Most importantly here is they're missing `BR2_TOOLCHAIN_EXTERNAL_OPENMP=y`.

This flag drives whether or not OpenMP libraries will be copied into the resulting rootfs. 

So the library tests for support (and it is supported by the toolchain), but since BR doesn't think it's enabled, the dependent libraries aren't copied in.

The quickest short term solutions are to:

1. Update your defconfig to use a "Custom Toolchain" and to manually point it to the bootlin toolchain and flag OpenMP support

2. Update your defconfig to use a Buildroot generated toolchain and decide if it should have OpenMP support.

This has actually been a recent discussion in IRC and we're contemplating a more resilient check here.
Comment 4 stsp 2023-06-19 16:05:39 UTC
Thanks for all the investigations!
I subscribed to the toolchain bug
you opened, and I am not in a rush
about fluidsynth. I can wait.
#15637 is what actually bothers me...
Comment 5 Vincent Fazio 2023-06-25 15:39:52 UTC
I lied, the "easiest" option is probably to use `BR2_TOOLCHAIN_EXTRA_LIBS` to copy in libgomp.

I've pushed a PR to bootlin to fix one of the root causes: https://github.com/bootlin/toolchains-builder/pull/61

I'm also working on a series of patches on https://gitlab.com/vfazio/buildroot/-/commits/vfazio-openmp-packages that will:

1: update known packages that use OpenMP to be sensitive to this issue
2. fix the flags for the bootlin toolchains
3. make our toolchain "supported libraries" check a bit more robust to catch the reverse condition of "support available but not flagged"
Comment 6 Peter Korsgaard 2023-08-31 14:43:14 UTC
Fixed by https://gitlab.com/buildroot.org/buildroot/-/commit/746ac56850664aa3e21902723f2e05570088ea26 (in 2023.08-rc1) and backported to (the upcoming) 2023.05.2 and 2023.02.4.