lsp-plugins / lsp-dsp-lib

DSP library for signal processing
GNU Lesser General Public License v3.0
68 stars 18 forks source link

Symbols being renamed incorrectly during application build #19

Closed vchernin closed 1 year ago

vchernin commented 1 year ago

lsp_dsp_xyz is becoming lsp_dsp_lsp_dsp_xyz. I see this happening in the zrythm flatpak build I believe since lsp 1.0.12, but I can bisect if needed. 1.0.11 works as expected.

[121/581] Compiling C object src/gui/widgets/libzrythm-widgets-lib.a.p/arranger_draw.c.o
FAILED: src/gui/widgets/libzrythm-widgets-lib.a.p/arranger_draw.c.o 
ccache cc -Isrc/gui/widgets/libzrythm-widgets-lib.a.p -Isrc/gui/widgets -I../src/gui/widgets -I. -I.. -Iinc -I../inc -Iext -I../ext -Iext/kissfft -I../ext/kissfft -Iext/midilib -I../ext/midilib -Iext/whereami -I../ext/whereami -Iext/weakjack -I../ext/weakjack -I../inc/plugins/lv2 -I/app/include/libadwaita-1 -I/app/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/graphene-1.0 -I/usr/lib/x86_64-linux-gnu/graphene-1.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/app/include/appstream -I/usr/include/blkid -I/usr/include/pixman-1 -I/usr/include/libmount -I/usr/include/fribidi -I/usr/include/libpng16 -I/usr/include/sysprof-4 -I/app/include/libpanel-1 -I/usr/include/opus -I/app/include/guile/3.0 -I/app/include/carla -I/app/include/carla/includes -I/app/include/rtaudio -I/app/include/serd-0 -I/app/include/sord-0 -I/app/include/sratom-0 -I/app/include/lilv-0 -I/usr/include/gtksourceview-5 -I/usr/include/libxml2 -I/usr/include/json-glib-1.0 -I/app/include/zix-0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -flto=2 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_74 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_74 -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_10 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_10 -Wno-bad-function-cast -Wno-old-style-declaration -Werror=absolute-value -Wformat=2 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-sequence-point -Wignored-qualifiers -Wno-cast-function-type -Walloca -fno-common -frecord-gcc-switches -ffast-math -freciprocal-math -fsingle-precision-constant -mfpmath=sse -fno-omit-frame-pointer '-DGETTEXT_PACKAGE="zrythm"' -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -fPIC -pthread -DZIX_STATIC -mfpmath=sse -msse -msse2 -D_REENTRANT -mfpmath=sse -msse -msse2 -isystem/usr/include/graphene-1.0 -isystem/usr/lib/x86_64-linux-gnu/graphene-1.0/include -mfpmath=sse -msse -msse2 -isystem/usr/include/glib-2.0 -isystem/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem/usr/include/sysprof-4 -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -Wformat=2 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-sequence-point -Wignored-qualifiers -Wno-cast-function-type -Walloca -fno-common '-DLV2_UI__Gtk4UI="https://lv2plug.in/ns/extensions/ui#Gtk4UI"' '-D__(x)=x' -DG_LOG_USE_STRUCTURED=1 '-DG_LOG_DOMAIN="zrythm"' -DREALTIME= '-DDEPRECATED_MSG(x)=__attribute__((deprecated(x)))' '-DOPTIMIZE(x)=__attribute__((optimize(#x)))' '-DOPTIMIZE_O0=OPTIMIZE(O0)' '-DOPTIMIZE_O1=OPTIMIZE(O1)' '-DOPTIMIZE_O2=OPTIMIZE(O2)' '-DOPTIMIZE_O3=OPTIMIZE(O3)' '-DNOINLINE=__attribute__((noinline))' '-DNONNULL_ARGS(...)=__attribute__((nonnull(__VA_ARGS__)))' '-DACCESS(...)=__attribute__((access(__VA_ARGS__)))' '-DACCESS_READ_ONLY(...)=ACCESS(read_only,__VA_ARGS__)' -frecord-gcc-switches '-DALWAYS_INLINE=__attribute__((always_inline))' '-DCOLD=__attribute__((cold))' '-DHOT=__attribute__((hot))' '-DPURE=__attribute__((pure))' '-DNONNULL=__attribute__((nonnull))' '-DRETURNS_NONNULL=__attribute__((returns_nonnull))' '-DSTACK_PROTECT=__attribute__((stack_protect))' '-DNO_STACK_PROTECTOR=__attribute__((no_stack_protector))' '-DWARN_UNUSED_RESULT=__attribute__((warn_unused_result))' '-DCONST=__attribute__((const))' '-DMALLOC=__attribute__((malloc))' -ffast-math -DPIC -freciprocal-math -fsingle-precision-constant -mfpmath=sse -fno-omit-frame-pointer -MD -MQ src/gui/widgets/libzrythm-widgets-lib.a.p/arranger_draw.c.o -MF src/gui/widgets/libzrythm-widgets-lib.a.p/arranger_draw.c.o.d -o src/gui/widgets/libzrythm-widgets-lib.a.p/arranger_draw.c.o -c ../src/gui/widgets/arranger_draw.c
In file included from ../inc/utils/dsp.h:26,
                 from ../src/gui/widgets/arranger_draw.c:35:
/app/include/lsp-plug.in/dsp/common/bitmap/b1b8.h:31:43: error: unknown type name ‘lsp_dsp_lsp_dsp_bitmap_t’; did you mean ‘lsp_dsp_bitmap_t’?
   31 | LSP_DSP_LIB_SYMBOL(void, bitmap_put_b1b8, LSP_DSP_LIB_TYPE(LSP_DSP_LIB_TYPE(bitmap_t)) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y);
      |                                           ^~~~~~~~~~~~~~~~

The relevant includes (which lead to more files) are these: https://github.com/zrythm/zrythm/blob/7f55342fb80a6d9a9ec0e25dc6cd8348bf787889/src/gui/widgets/arranger_draw.c#L4-L7

To reproduce you can build the zrythm flatpak after modifying these lines to a newer version, and then the zrythm build later on will fail (lsp builds fine): https://github.com/flathub/org.zrythm.Zrythm/blob/7e074ab925420920617fdfe591c755ba20b88448/org.zrythm.Zrythm.json#L389-L390

However I would not recommend it as it is a very slow build (at least initially) due to various other dependencies. Most likely this is reproducible in a non flatpak environment anyhow.

sadko4u commented 1 year ago

Whoops, seems to be a problem of LSP DSP library (double macro call).

sadko4u commented 1 year ago

This patch should fix the problem:

https://github.com/lsp-plugins/lsp-dsp-lib/commit/d9d18aa6113686e950133feab03fe956cd890fc6

sadko4u commented 1 year ago

Updated the code and add test for C header compatibility:

https://github.com/lsp-plugins/lsp-dsp-lib/commit/2c10f16fb1db9841a9e68c7dd1acaec823aeba48

vchernin commented 1 year ago

Thanks, I can confirm in 1.0.16 the issue is fixed.