waifu2x-converter-qt
waifu2x-converter-qt copied to clipboard
Fails to link with `plugin needed to handle lto object` with LTO enabled.
For me, it fails while linking:
g++ -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -pipe -g0 -march=x86-64 -mtune=native -O3 -flto -ffat-lto-objects -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC -fpermissive -Og -fno-lto -gdwarf-5 -ggdb -gno-strict-dwarf -g3 -gpubnames -grecord-gcc-switches -fno-eliminate-unused-debug-symbols -fvar-tracking -fvar-tracking-assignments -fdebug-types-section -fno-stack-protector -fno-omit-frame-pointer -D_FORTIFY_SOURCE=0 -DDEBUG -ffile-prefix-map=/tmp/makepkg/build/waifu2x-converter-qt-git/src=/usr/src/debug/waifu2x-converter-qt-git -std=gnu++11 -pthread -flto=4 -fno-fat-lto-objects -fuse-linker-plugin -fPIC -o waifu2x-converter-qt libnotifyhandler.o main.o mainwindow.o waifu2xconverterqtsettings.o processdialog.o droplabel.o preferencesdialog.o aboutdialog.o optionpreferencesform.o waifu2xconvertercppoptions.o processmodemodel.o qrc_icons.o moc_mainwindow.o moc_processdialog.o moc_droplabel.o moc_preferencesdialog.o moc_aboutdialog.o moc_optionpreferencesform.o -lnotify -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
/usr/bin/ld: libnotifyhandler.o: plugin needed to handle lto object
/usr/bin/ld: libnotifyhandler.o: plugin needed to handle lto object
/usr/bin/ld: main.o: plugin needed to handle lto object
/usr/bin/ld: main.o: plugin needed to handle lto object
/usr/bin/ld: mainwindow.o: plugin needed to handle lto object
/usr/bin/ld: mainwindow.o: plugin needed to handle lto object
/usr/bin/ld: waifu2xconverterqtsettings.o: plugin needed to handle lto object
/usr/bin/ld: waifu2xconverterqtsettings.o: plugin needed to handle lto object
/usr/bin/ld: processdialog.o: plugin needed to handle lto object
/usr/bin/ld: processdialog.o: plugin needed to handle lto object
/usr/bin/ld: droplabel.o: plugin needed to handle lto object
/usr/bin/ld: droplabel.o: plugin needed to handle lto object
/usr/bin/ld: preferencesdialog.o: plugin needed to handle lto object
/usr/bin/ld: preferencesdialog.o: plugin needed to handle lto object
/usr/bin/ld: aboutdialog.o: plugin needed to handle lto object
/usr/bin/ld: aboutdialog.o: plugin needed to handle lto object
/usr/bin/ld: optionpreferencesform.o: plugin needed to handle lto object
/usr/bin/ld: optionpreferencesform.o: plugin needed to handle lto object
/usr/bin/ld: waifu2xconvertercppoptions.o: plugin needed to handle lto object
/usr/bin/ld: waifu2xconvertercppoptions.o: plugin needed to handle lto object
/usr/bin/ld: processmodemodel.o: plugin needed to handle lto object
/usr/bin/ld: processmodemodel.o: plugin needed to handle lto object
/usr/bin/ld: qrc_icons.o: plugin needed to handle lto object
/usr/bin/ld: qrc_icons.o: plugin needed to handle lto object
/usr/bin/ld: moc_mainwindow.o: plugin needed to handle lto object
/usr/bin/ld: moc_mainwindow.o: plugin needed to handle lto object
/usr/bin/ld: moc_processdialog.o: plugin needed to handle lto object
/usr/bin/ld: moc_processdialog.o: plugin needed to handle lto object
/usr/bin/ld: moc_droplabel.o: plugin needed to handle lto object
/usr/bin/ld: moc_droplabel.o: plugin needed to handle lto object
/usr/bin/ld: moc_preferencesdialog.o: plugin needed to handle lto object
/usr/bin/ld: moc_preferencesdialog.o: plugin needed to handle lto object
/usr/bin/ld: moc_aboutdialog.o: plugin needed to handle lto object
/usr/bin/ld: moc_aboutdialog.o: plugin needed to handle lto object
/usr/bin/ld: moc_optionpreferencesform.o: plugin needed to handle lto object
/usr/bin/ld: moc_optionpreferencesform.o: plugin needed to handle lto object
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../lib/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:456: waifu2x-converter-qt] Error 1
- Operating system: Artix GNU/Linux (= Arch Linux without systemd)
- GCC version: 13.1.1
-
ld
(GNU binutils) version: 2.40.0 -
$CFLAGS
:
-g0 -march=x86-64 -mtune=native -O3 -flto -ffat-lto-objects -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC
-
$CXXFLAGS
:
-g0 -march=x86-64 -mtune=native -O3 -flto -ffat-lto-objects -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC -fpermissive
-
$LDFLAGS
:
-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu
- Built according to ↗ this recipe.
Build succeeds if -fno-lto -fno-fat-lto-objects
is removed from $CFLAGS
/ $CXXFLAGS
.
Regards!