Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with LTO #21

Open
eli-schwartz opened this issue Mar 4, 2024 · 0 comments
Open

Build fails with LTO #21

eli-schwartz opened this issue Mar 4, 2024 · 0 comments

Comments

@eli-schwartz
Copy link

I tried building with this in *FLAGS: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing

I got this error:

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  -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -o pngcp pngcp.o pngread.o pngwrite.o inflateraster.o -lpng -lm -lpng -lm 
pngcp.h:4:7: error: type of ‘readimage’ does not match original declaration [-Werror=lto-type-mismatch]
    4 | char *readimage(char *filename, unsigned long *width, unsigned long *height,
      |       ^
pngread.c:10:7: note: ‘readimage’ was previously declared here
   10 | char *readimage(char *filename, png_uint_32 *width, png_uint_32 *height,
      |       ^
pngread.c:10:7: 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
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:430: pngcp] Error 1

Downstream bug report: https://bugs.gentoo.org/875371
Full build log: build.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant