gsequencer / gsequencer

Advanced Gtk+ Sequencer
http://nongnu.org/gsequencer/
GNU General Public License v3.0
19 stars 2 forks source link

Build fais with clang: version script assignment of 'global' to symbol 'ags_vst3_conversion_get_type' failed: symbol not defined #60

Closed yurivict closed 2 weeks ago

yurivict commented 2 weeks ago

With clang build fails:

ld: error: version script assignment of 'global' to symbol 'ags_vst3_conversion_get_type' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_conversion_new' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_get_type' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_get_audio_output_bus_count' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_get_audio_input_bus_count' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_get_event_output_bus_count' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_get_event_input_bus_count' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_get_audio_output_port_count' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_get_audio_input_port_count' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_process_data_lookup' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_process_data_insert' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_process_data_remove' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_plugin_new' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_manager_get_type' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_manager_get_default_path' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_manager_set_default_path' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_manager_get_filenames' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_manager_find_vst3_plugin' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_manager_find_vst3_plugin_with_fallback' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'ags_vst3_manager_load_blacklist' failed: symbol not defined
ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)

The core reason is that you have these symbol names in .sym files but they don't appear in any built binaries. The GCC toolchain appears to be forgiving with this problem, but clang is more rigorous.

Version: 6.12.5 clang-18.1.5 FreeBSD 14.0

joelkraehemann commented 2 weeks ago

Hi @yurivict

Check this commit:

https://github.com/gsequencer/gsequencer/commit/cedf2b40d13e1f8eab191f95c9b9ddde0ec021eb

You should be able to generate symbols like this:

make gen-symbols-all
make fix-symbols-all-bsd

I am just building another tarball.

joelkraehemann commented 2 weeks ago

https://github.com/gsequencer/gsequencer/releases/tag/6.12.6

yurivict commented 2 weeks ago

@joelkraehemann

Hi Joel,

I am curious, why are the symbols different on BSD? Does something fail to build or is something disabled that isn't disabled on Liux?

Thanks, Yuri

joelkraehemann commented 2 weeks ago

I am bit confused about sed and its use in Makefiles. Do you know a good resource about using sed with automake?

yurivict commented 2 weeks ago

sed in automake? No, I avoid automake as much as I can.

yurivict commented 2 weeks ago

I get this failure:

$ gmake fix-symbols-all-bsd
gmake[1]: Entering directory '/usr/ports/audio/gsequencer/work/gsequencer-6.12.6'
Makefile:37228: warning: overriding recipe for target 'rm-symbols-ags-audio-vst3-bsd'
Makefile:37222: warning: ignoring old recipe for target 'rm-symbols-ags-audio-vst3-bsd'
rm -f libags.sym.in
touch libags.sym.in
cat license-notice-gnu-gpl-3-0+-sym.txt >> libags.sym.in
echo -e -n "\n" >> libags.sym.in
find ags/util -name "*.h" | xargs grep --no-filename -o -P "(?<=\s)(ags_[a-z0-9_]+)(?=[\s]*\()" >> libags.sym.in
grep: invalid option -- P
usage: grep [-abcDEFGHhIiLlmnOopqRSsUVvwxz] [-A num] [-B num] [-C num]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context=num] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
gmake[1]: *** [Makefile:37179: gen-symbols-ags] Error 1
yurivict commented 2 weeks ago

These commands don't solve the problem:

make gen-symbols-all
make fix-symbols-all-bsd
joelkraehemann commented 2 weeks ago

Is perl an option?

find ags/util -name ".h" -exec perl -ne 'while(/(?<=\s)(ags[a-z0-9]+)(?=[\s]()/g){print "$&\n";}' '{}' \;

yurivict commented 2 weeks ago

perl is possible.

joelkraehemann commented 2 weeks ago

FYI, I have just added the perl script to generate symbols:

https://github.com/gsequencer/gsequencer/blob/6.12.x/gen-symbols-all.pl

Note, if you modify symbols file run configure again because of these m4 macros:

https://github.com/gsequencer/gsequencer/blob/6.12.x/m4/ags-symbols.m4

joelkraehemann commented 2 weeks ago

You can do now following to generate symbols files:

./configure
make gen-symbols-all-bsd
make fix-symbols-all-bsd
./configure
make
make install

Fix included in 6.12.7

https://github.com/gsequencer/gsequencer/releases/tag/6.12.7