Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Linking the executable calfmakerdf against the loadable module #156

Closed
yurivict opened this issue Nov 19, 2017 · 13 comments · Fixed by #332
Closed

Warning: Linking the executable calfmakerdf against the loadable module #156

yurivict opened this issue Nov 19, 2017 · 13 comments · Fixed by #332

Comments

@yurivict
Copy link

Getting this failure on FreeBSD (with clang-40 compiler):

--- calfmakerdf ---
/bin/sh ../libtool  --tag=CXX    --mode=link c++ -ffast-math -finline-limit=80 -I/usr/local/include  -I/usr/local/include -I/usr/local/include/gtk-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -D_THREAD_SAFE -pthread -I/usr/local/include  -I/usr/local/include/lash-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -pthread  -O2 -pipe -fno-omit-frame-pointer  -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -fno-omit-frame-pointer  -isystem /usr/local/include -std=c++11 -O3 -finline-functions -finline-functions-called-once -Wall  -fstack-protector -o calfmakerdf makerdf.o calf.la -L/usr/local/lib
*** Warning: Linking the executable calfmakerdf against the loadable module
*** calf.so is not portable!
libtool: link: c++ -ffast-math -finline-limit=80 -I/usr/local/include -I/usr/local/include -I/usr/local/include/gtk-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -D_THREAD_SAFE -pthread -I/usr/local/include -I/usr/local/include/lash-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -pthread -O2 -pipe -fno-omit-frame-pointer -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -fno-omit-frame-pointer -isystem /usr/local/include -std=c++11 -O3 -finline-functions -finline-functions-called-once -Wall -fstack-protector -o .libs/calfmakerdf makerdf.o  ./.libs/calf.so -L/usr/local/lib -lexpat -lfluidsynth -lgthread-2.0 -lglib-2.0 -lintl -pthread -Wl,-rpath -Wl,/usr/local/lib/calf
@falkTX
Copy link
Collaborator

falkTX commented Nov 19, 2017

I see no error here...

@yurivict
Copy link
Author

I included an incomplete set sorry.

It always breaks shortly after this warning:

--- calfbenchmark ---
*** Warning: Linking the executable calfbenchmark against the loadable module
*** calf.so is not portable!
libtool: link: c++ -ffast-math -finline-limit=80 -I/usr/local/include -I/usr/local/include -I/usr/local/include/gtk-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -D_THREAD_SAFE -pthread -I/usr/local/include -I/usr/local/include/lash-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -pthread -O2 -pipe -fno-omit-frame-pointer -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -fno-omit-frame-pointer -isystem /usr/local/include -std=c++11 -O3 -finline-functions -finline-functions-called-once -Wall -msse -mfpmath=sse -fstack-protector -o .libs/calfbenchmark benchmark.o  ./.libs/calf.so -L/usr/local/lib -lexpat -lfluidsynth -lgthread-2.0 -lglib-2.0 -lintl -pthread -Wl,-rpath -Wl,/usr/local/lib/calf
--- calfmakerdf ---
makerdf.o: In function `make_ttl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*)':
makerdf.cpp:(.text+0xc2): undefined reference to `calf_plugins::plugin_registry::instance()'
makerdf.cpp:(.text+0x66c): undefined reference to `calf_plugins::get_builtin_presets()'
makerdf.cpp:(.text+0x680): undefined reference to `calf_plugins::preset_list::load_defaults(bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*)'

@AngryPenguinPL
Copy link

Hi, sorry for writing in old bug but this is still a valid case.

Trying to build Calf 0.9.3 on OpenMandriva Cooker with LLVM/Clang 11 and I see same error:

ld: error: undefined symbol: calf_plugins::plugin_registry::instance()
DEBUG util.py:621:  >>> referenced by makerdf.cpp:234
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  >>> referenced by makerdf.cpp:519
DEBUG util.py:621:  >>>               makerdf.o:(make_gui(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >))
DEBUG util.py:621:  ld: error: undefined symbol: calf_utils::i2s[abi:cxx11](int)
DEBUG util.py:621:  >>> referenced by makerdf.cpp:306
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  >>> referenced by makerdf.cpp:348
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  >>> referenced by makerdf.cpp:491
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  >>> referenced 1 more times
DEBUG util.py:621:  ld: error: undefined symbol: calf_plugins::get_builtin_presets()
DEBUG util.py:621:  >>> referenced by makerdf.cpp:430
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  >>> referenced by makerdf.cpp:431
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  ld: error: undefined symbol: calf_plugins::preset_list::load_defaults(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*)
DEBUG util.py:621:  >>> referenced by makerdf.cpp:430
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  ld: error: undefined symbol: calf_plugins::plugin_preset::get_safe_name[abi:cxx11]()
DEBUG util.py:621:  >>> referenced by makerdf.cpp:451
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  ld: error: undefined symbol: calf_utils::ff2s[abi:cxx11](double)
DEBUG util.py:621:  >>> referenced by makerdf.cpp:467
DEBUG util.py:621:  >>>               makerdf.o:(make_ttl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*))
DEBUG util.py:621:  clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
DEBUG util.py:621:  make[3]: *** [Makefile:696: calfmakerdf] Error 1
DEBUG util.py:621:  make[3]: *** Waiting for unfinished jobs....
DEBUG util.py:621:  ld: error: undefined symbol: dsp::reverb::update_times()
DEBUG util.py:621:  >>> referenced by audio_fx.h:384 (./calf/audio_fx.h:384)
DEBUG util.py:621:  >>>               benchmark.o:(reverbir_calc())
DEBUG util.py:621:  >>> referenced by audio_fx.h:384 (./calf/audio_fx.h:384)
DEBUG util.py:621:  >>>               benchmark.o:(reverbir_calc())
DEBUG util.py:621:  >>> referenced by audio_fx.h:384 (./calf/audio_fx.h:384)
DEBUG util.py:621:  >>>               benchmark.o:(dsp::reverb::setup(int))
DEBUG util.py:621:  >>> referenced 1 more times
DEBUG util.py:621:  ld: error: undefined symbol: dsp::reverb::reset()

Worth to add, If I switch compiler to GCC, then all is compiled fine.
and here is also bug on Gentoo https://bugs.gentoo.org/740158

@yurivict
Copy link
Author

Any solution to this?

@yurivict
Copy link
Author

Any hope to fix build with clang? The FreeBSD Calf port is broken because of this.

@vimproved
Copy link
Contributor

Digging deeper here, this issue seems to be caused by the -export-symbols-regex "lv2_descriptor" in libcalf_la_LDFLAGS. Removing it makes calf link completely fine with LLD.

@vimproved
Copy link
Contributor

Removing this doesn't seem to cause any issues but I'd like to defer to someone who knows more about why this was added in the first place.

@vimproved
Copy link
Contributor

Specifically, this seems to stem from LLD handling -retain-symbols-file differently from GNU ld. GNU ld doesn't discard any symbols when using -retain-symbols-file, however LLD does.

@vimproved
Copy link
Contributor

Removing the export-symbols-regex shouldn't break anything since libtool exports all symbols by default.

vimproved added a commit to vimproved/calf that referenced this issue Sep 21, 2023
LLVM's LLD handles the -retain-symbols-file option (used by
-export-symbols-regex in libtool) differently from GNU ld, causing
undefined references during link. This commit removes the
-export-symbols-regex option from libcalf_la_LDFLAGS since by default
libtool exports all symbols anyway, so it should not be necessary.

Fixes calf-studio-gear#156.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
@yurivict
Copy link
Author

The FreeBSD had this problem, and it has -module removed from the link lines, likely for the same reason.

@vimproved
Copy link
Contributor

The FreeBSD had this problem, and it has -module removed from the link lines, likely for the same reason.

Odd. That doesn't fix it for me on Linux.

@yurivict
Copy link
Author

Here are all the patches from the FreeBSD port: https://cgit.freebsd.org/ports/tree/audio/calf-lv2/files

Maybe if you would apply all of them this would help.

It was a long time ago that I solved this problem on FreeBSD, and I unfortunately don't remember the details now.

@vimproved
Copy link
Contributor

Here are all the patches from the FreeBSD port: https://cgit.freebsd.org/ports/tree/audio/calf-lv2/files

Maybe if you would apply all of them this would help.

It was a long time ago that I solved this problem on FreeBSD, and I unfortunately don't remember the details now.

Nevermind, it seems like the FreeBSD fix does the same thing as my PR of removing -export-symbols-regex. It does compile with all the FreeBSD patches applied.

vimproved added a commit to vimproved/calf that referenced this issue Oct 10, 2023
LLVM's LLD handles the -retain-symbols-file option (used by
-export-symbols-regex in libtool) differently from GNU ld, causing
undefined references during link. This commit removes the
-export-symbols-regex option from libcalf_la_LDFLAGS since by default
libtool exports all symbols anyway, so it should not be necessary.

Fixes calf-studio-gear#156.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
JohannesLorenz pushed a commit that referenced this issue Oct 19, 2023
LLVM's LLD handles the -retain-symbols-file option (used by
-export-symbols-regex in libtool) differently from GNU ld, causing
undefined references during link. This commit removes the
-export-symbols-regex option from libcalf_la_LDFLAGS since by default
libtool exports all symbols anyway, so it should not be necessary.

Fixes #156.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants