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 #94

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

Build fails with LTO #94

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

Comments

@eli-schwartz
Copy link

I tried to build with these flags: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing

I got this compile error:

x86_64-pc-linux-gnu-g++  -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 -fno-rtti -fno-exceptions -W -Wall  -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -o nullmailer-smtpd smtpd.o ../lib/libnullmailer.a 
../lib/cli++/cli++.h:35:20: error: ‘cli_program’ violates the C++ One Definition Rule [-Werror=odr]
   35 | extern const char* cli_program;
      |                    ^
smtpd.cc:55:19: note: ‘cli_program’ was previously declared here
   55 | extern const char cli_program[] = "nullmailer-smtpd";
      |                   ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status

Downstream report: https://bugs.gentoo.org/859529
Full build logs: 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