Build fails with LTO
eli-schwartz opened this issue · comments
x86_64-pc-linux-gnu-gcc -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -Wall -Wno-unused-function -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 bwashm.o bwase.o bwaseqio.o bwtgap.o bwtaln.o bamlite.o bwape.o kopen.o pemerge.o maxk.o bwtsw2_core.o bwtsw2_main.o bwtsw2_aux.o bwt_lite.o bwtsw2_chain.o fastmap.o bwtsw2_pair.o main.o -o bwa -L. -lbwa -lm -lz -lpthread -lrt
bwamem.c:1207:21: error: type of ‘kt_for’ does not match original declaration [-Werror=lto-type-mismatch]
1207 | extern void kt_for(int n_threads, void (*func)(void*,int,int), void *data, int n);
| ^
kthread.c:49:6: note: type mismatch in parameter 4
49 | void kt_for(int n_threads, void (*func)(void*,long,int), void *data, long n)
| ^
kthread.c:49:6: note: type ‘long int’ should match type ‘int’
kthread.c:49:6: note: ‘kt_for’ was previously declared here
kthread.c:49:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gcc returned 1 exit status
Full logs: build.log
Downstream report: https://bugs.gentoo.org/862255