salsaman / LiVES

LiVES is a feature rich application which combines elements of VJ and video editing software. The current version runs on Linux / BSD. Check_out_the_new_discussion_area https://github.com/salsaman/LiVES/discussions
http://lives-video.com
GNU General Public License v3.0
89 stars 11 forks source link

Issue with GCC-10 (-fcommon flag) #21

Closed sagitter closed 3 years ago

sagitter commented 3 years ago

libweed-utils.so is not correctly linked when GCC-10+ is used:

libtool: link: gcc -fPIE -Wstrict-aliasing=0 -Wall -DHAVE_YUV4MPEG=1 -DHAVE_LDVGRAB=1 -I libavc1394/avc1394.h -I libraw1394/raw1394.h -I libraw1394/rom1394.h -I/usr/include/liboil-0.3 -DENABLE_OIL=1 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -pthread -DHAVE_WAYLAND=1 -DLIBAV_TRANSCODE=1 -DIS_LINUX_GNU=1 -DENABLE_OSC=1 -DALSA_MIDI=1 -I/usr/include/libpng16 -DUSE_LIBPNG=1 -I/usr/include/ffmpeg -I/usr/include/ffmpeg -DUSE_SWSCALE=1 -DENABLE_JACK=1 -DENABLE_JACK_TRANSPORT=1 -D_REENTRANT -DHAVE_PULSE_AUDIO=1 -DHAVE_PA_STREAM_BEGIN_WRITE=1 -DENABLE_GIW=1 -DHAVE_UNICAP=1 -DNEED_LOCAL_WEED=1 -DNEED_LOCAL_WEED_UTILS=1 -DNEED_LOCAL_WEED_COMPAT=1 -DLIVES_LIBDIR=\"/usr/lib64\" -DHAVE_FREI0R=1 -DHAVE_LADSPA=1 -DHAVE_WEBM=1 -DHAVE_LINUX_JOYSTICK_H=1 -DHAVE_PRCTL=1 -pg -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -pthread -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o .libs/lives-exe rpmalloc.o widget-helper.o main.o support.o effects.o lsd-tab.o plugins.o effects-weed.o effects-data.o framedraw.o interface.o paramspecial.o paramwindow.o rfx-builder.o lives-yuv4mpeg.o preferences.o rte_window.o gui.o ce_thumbs.o htmsocket.o merge.o dialogs.o saveplay.o audio.o events.o resample.o osc.o omc-learn.o callbacks.o colourspace.o keyboard.o utils.o multitrack.o stream.o cvirtual.o startup.o pangotext.o machinestate.o weed-effects-utils.o diagnostics.o transcode.o videodev.o jack.o pulse.o ldvgrab.o ldvcallbacks.o ldvinterface.o giw/giwknob.o giw/giwvslider.o giw/giwled.o giw/giwtimeline.o  -lgtk-3 -latk-1.0 -lgio-2.0 -loil-0.3 -lX11 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lgobject-2.0 -lmjpegutils ../libOSC/.libs/libOSC.a ../libOSC/client/.libs/libOSC_client.a -ljack -L/usr/lib64 -ljackserver -lavc1394 -lraw1394 -lrom1394 -lasound -lpulse -lpng16 -lz -lswscale -lavutil /builddir/build/BUILD/LiVES-3.2.0-pre8/libweed/.libs/libweed_gslice.so -lglib-2.0 /builddir/build/BUILD/LiVES-3.2.0-pre8/libweed/.libs/libweed-utils.so -lm -lunicap -lrt -ldl -pthread
/usr/bin/ld: main.o (symbol from plugin): in function `defer_sigint':
(.text+0x0): multiple definition of `prefs'; widget-helper.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: main.o (symbol from plugin): in function `defer_sigint':
(.text+0x0): multiple definition of `capable'; widget-helper.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: main.o (symbol from plugin): in function `defer_sigint':
(.text+0x0): multiple definition of `widget_opts'; widget-helper.o (symbol from plugin):(.text+0x0): first defined here
...

A temporarily fix is to force the -fcommon flag. See Porting to GCC-10 Full build log: http://koji.rpmfusion.org/kojifiles/work/tasks/5947/445947/build.log

salsaman commented 3 years ago

Does adding "extern" before the symbol definitions in e.g. main.h, widget-helper.h work ?

Edit: no, forget this, it breaks older gcc.

Will add -fcommon in src/Makefile.am