ECP-VeloC / AXL

Asynchronous Transfer Library
MIT License
2 stars 8 forks source link

LTO build failure #130

Open Alessandro-Barbieri opened 1 year ago

Alessandro-Barbieri commented 1 year ago

gentoo CI had a failure while trying to build with LTO log https://860525.bugs.gentoo.org/attachment.cgi?id=793904 see https://bugs.gentoo.org/860525

[6/6] : && /usr/bin/x86_64-pc-linux-gnu-gcc -fPIC -O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wall  -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -shared -Wl,-soname,libaxl.so -o src/libaxl.so src/CMakeFiles/axl_o.dir/axl.c.o src/CMakeFiles/axl_o.dir/axl_sync.c.o src/CMakeFiles/axl_o.dir/axl_err.c.o src/CMakeFiles/axl_o.dir/axl_io.c.o src/CMakeFiles/axl_o.dir/axl_util.c.o  -Wl,-rpath,::::::::::  -lkvtree_base  -lz && :
FAILED: src/libaxl.so 
: && /usr/bin/x86_64-pc-linux-gnu-gcc -fPIC -O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wall  -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -shared -Wl,-soname,libaxl.so -o src/libaxl.so src/CMakeFiles/axl_o.dir/axl.c.o src/CMakeFiles/axl_o.dir/axl_sync.c.o src/CMakeFiles/axl_o.dir/axl_err.c.o src/CMakeFiles/axl_o.dir/axl_io.c.o src/CMakeFiles/axl_o.dir/axl_util.c.o  -Wl,-rpath,::::::::::  -lkvtree_base  -lz && :
/var/tmp/portage/sys-cluster/AXL-0.7.0/work/AXL-0.7.0/src/axl_sync.h:10:5: error: type of ‘axl_sync_start’ does not match original declaration [-Werror=lto-type-mismatch]
   10 | int axl_sync_start(int id);
      |     ^
/var/tmp/portage/sys-cluster/AXL-0.7.0/work/AXL-0.7.0/src/axl_sync.c:72:5: note: type mismatch in parameter 2
   72 | int axl_sync_start (int id, int resume)
      |     ^
/var/tmp/portage/sys-cluster/AXL-0.7.0/work/AXL-0.7.0/src/axl_sync.c:72:5: note: type ‘int’ should match type ‘void’
/var/tmp/portage/sys-cluster/AXL-0.7.0/work/AXL-0.7.0/src/axl_sync.c:72:5: note: ‘axl_sync_start’ was previously declared here
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
adammoody commented 1 year ago

@Alessandro-Barbieri , thank you for the report. This commit should fix the problem:

https://github.com/ECP-VeloC/AXL/commit/087b3be3ac4f4240a54f87e52044af43ddf4ad4c

We'll pick that up in the next release.