Wayfire failed to build from source in AUR
In the AUR it is not possible to rebuild and I am still checking the possible causes for this since I am just getting to know this software. See the log below.
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wayfire
FAILED: test/geometry/geometry_test
c++ -o test/geometry/geometry_test test/geometry/geometry_test.p/geometry_test.cpp.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--whole-archive -Wl,--start-group src/liblibwayfire.a -Wl,--no-whole-archive -rdynamic -Wl,-E -lstdc++fs -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/home/arch/git/archlinux/aur/wayfire/src=/usr/src/debug/wayfire -flto=auto '-Wl,-rpath,$ORIGIN/../../subprojects/wf-utils:/usr/lib/wlroots0.17' -Wl,-rpath-link,/home/arch/git/archlinux/aur/wayfire/src/build/subprojects/wf-utils -Wl,-rpath-link,/usr/lib/wlroots0.17 proto/libwl_protos.a subprojects/wf-utils/libwf-utils.so.0.4.0 subprojects/wf-touch/libwftouch.a /usr/lib/libwayland-server.so /usr/lib/wlroots0.17/libwlroots.so /usr/lib/libxkbcommon.so /usr/lib/libinput.so /usr/lib/libpixman-1.so /usr/lib/libdrm.so /usr/lib/libEGL.so /usr/lib/libGLESv2.so /usr/lib/libglm.a -ldl /usr/lib/libwf-config.so /usr/lib/libxcb.so /usr/lib/libjpeg.so /usr/lib/libpng16.so /usr/lib/libwayland-client.so -Wl,--end-group
{standard input}: Assembler messages:
{standard input}:239949: Error: invalid operands (*UND* and .text sections) for `-'
make: *** [/tmp/ccBCARGH.mk:50: /tmp/ccCglFsp.ltrans16.ltrans.o] Error 1
make: ** Esperando que outros processos terminem.
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/bin/ld: erro: lto-wrapper failed
collect2: error: ld returned 1 exit status
[476/476] Linking target test/misc/tracking_allocator
ninja: build stopped: subcommand failed.
The same problem occurs when trying wayfire-git as well which is having issues with the build.
https://aur.archlinux.org/cgit/aur.git/tree/?h=wayfire-git
This seems like a system or compiler problem. Does it happen to work with -Dtests=disabled?
This seems like a system or compiler problem. Does it happen to work with
-Dtests=disabled?
This solves it, but it would be interesting to fix the code to compile on the latest versions of the compiler in question. It serves as a momentary solution.
I notice that the build output indicates using link time optimizations. I tested building wayfire with -Db_lto=true locally and the build succeeded with tests enabled and -flto=auto using g++ 13.3.0 on x86_64. I'm not sure if this is related to the problem, but does it help if you try -Db_lto=false instead of disabling tests? What compiler and version are you using? Is the target x86_64 or aarch64?
I notice that the build output indicates using link time optimizations. I tested building wayfire with
-Db_lto=truelocally and the build succeeded with tests enabled and-flto=autousing g++ 13.3.0 on x86_64. I'm not sure if this is related to the problem, but does it help if you try-Db_lto=falseinstead of disabling tests? What compiler and version are you using? Is the target x86_64 or aarch64?
I detected problems with link-time optimization (LTO) before and sorry for not warning. But it would be an x86_64 machine and I even looked into that in the makepkg settings.
But I want to continue analyzing this problem in time.
See https://gcc.gnu.org/wiki/LinkTimeOptimization
https://github.com/ssfdust/wayfire-pkgbuild Could you have a try with this? @leandrocunha526
Closing as this is either an issue with the reporter's setup or a bug in the compiler/linker.