Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 770913 - media-libs/simage-1.8.0-r1[-sndfile] with libsndfile installed: undefined reference to `sf_open'
Summary: media-libs/simage-1.8.0-r1[-sndfile] with libsndfile installed:
Status: RESOLVED DUPLICATE of bug 708894
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Maciej Mrozowski
Depends on:
Reported: 2021-02-16 09:32 UTC by Robert G. Siebeck
Modified: 2021-02-21 03:01 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Robert G. Siebeck 2021-02-16 09:32:06 UTC
Emerging media-gfx/freecad-0.19_pre20201231 fails with the following error:

FAILED: bin/FreeCAD 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -Wall -Wextra -Wno-write-strings -O2 -pipe -march=znver2 -mtune=native -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 src/Main/CMakeFiles/FreeCADMain.dir/MainGui.cpp.o -o bin/FreeCAD  -Wl,-rpath,/var/tmp/portage/media-gfx/freecad-0.19_pre20201231/work/freecad-0.19_pre20201231_build/lib:  -lmpi_cxx  -lmpi  lib/  lib/  lib/  -lmpi_cxx  -lmpi  /usr/lib64/  -lz  /usr/lib64/  -lutil  -ldl  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/  -lpthread  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/libQt5UiTools.a  /usr/lib64/  /usr/lib64/  /usr/lib64//  /usr/lib64//  /usr/lib64//  /usr/lib64//  /usr/lib64//  /usr/lib64//  /usr/lib64/  -lpthread  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/  /usr/lib64/ && :
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ undefined reference to `sf_open'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ undefined reference to `sf_seek'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ undefined reference to `sf_close'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ undefined reference to `sf_read_double'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ undefined reference to `sf_command'
collect2: error: ld returned 1 exit status

Updating media-libs/simage from 1.8.0 to 1.8.1 fixed the problem.

Reproducible: Always
Comment 1 Ionen Wolkens gentoo-dev 2021-02-16 10:02:50 UTC
Looks like a bug in =simage-1.8.0-r1 rather than freecad.

sf_open and the like are from libsndfile which should, in theory, only be used with simage[sndfile].

However, despite USE=-sndfile, if =simage-1.8.0-r1 is built while libsndfile was available on the system it still references symbols from it (without linking):
$ gcc -o test test.c `pkg-config --cflags --libs simage` -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/ undefined reference to `sf_open'

So anything using it will fail, not just freecad.

No problems if I rebuild simage without libsndfile on the system.
Comment 2 Ionen Wolkens gentoo-dev 2021-02-16 21:14:30 UTC
Changing summary given it's 1.8.0-r1 that's affected and 1.8.1 fixes the issue.

Then again I'd argue it should instead read as:
"media-libs/simage-1.8.1 stabilization"
Comment 3 Bernd 2021-02-16 21:16:25 UTC
The issue has been know for <simage-1.8.1 for some time, see for example for discussion on that topic and for fixes in 1.8.1 of this issue.

We could either stabilize 1.8.1, IMO it's been around long enough, or explicitly depend freecad on >=media-libs/simage-1.8.1.
Comment 4 Maciej Mrozowski gentoo-dev 2021-02-21 03:01:08 UTC

*** This bug has been marked as a duplicate of bug 708894 ***