-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
git: build fails with LTO enabled #24366
Comments
Could you share diffconfig? |
What should I compare my config with? |
it should has nothing to do with custom config file. just LTO problems. |
Default is gcc13, it is imperative that you show diffconfig that leads to error, or alternatively submit a PR. |
yeah, I'm using GCC14 for testing purpose, enabled
|
Yeah, gcc13, maybe even gcc12.... |
oh I did it right. Still complaining errors on GCC13.
I don't know if submiting a workaround PR would be accepted. |
Make coinciding error and diffconfig. Without -ofast which is guaranteed to miscompile |
diffconfig:
build log: git.log Must both use ( |
Close this issue? |
Yep, O3/Ofast is excessive optimization . Like |
Git doen't support lto with gcc flag -O3 and -Ofast. This is discussed in openwrt#24366. If CONFIG_USE_LTO=y, filter -O% from CPPFLAGS and set to -O2. Signed-off-by: Ryan Keane <[email protected]>
Git doen't support lto with gcc flag -O3 and -Ofast. This is discussed in openwrt#24366. If CONFIG_USE_LTO=y, filter -O% from CPPFLAGS and set to -O2. Signed-off-by: Ryan Keane <[email protected]>
Git doen't support lto with gcc flag -O3 and -Ofast. This is discussed in openwrt#24366. If CONFIG_USE_LTO=y, filter -O% from CPPFLAGS and set to -O2. Signed-off-by: Ryan Keane <[email protected]>
New update on this: |
If has FORTIFY_SOURCE=y and CONFIG_USE_LTO=y in build config, git will fail to compile with the following example error: /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h: In function 'process_curl_messages': /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h:90:8: error: inlining failed in call to 'always_inline' 'fwrite': function body can be overwritten at link time 90 | size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict); | ^ http.c:355:33: note: called from here 355 | fprintf(stderr, "Received DONE message for unknown request!\n"); | ^ A related issue is openwrt#13016 . This commit set PKG_FORTIFY_SOURCE to 0 if CONFIG_USE_LTO is y. Close: openwrt#24366 Link: https://lore.kernel.org/git/CAHfWF5mjquES-nocQaK+CAEsqWgdy-_OYdGtN82heYs0eJP3eQ@mail.gmail.com/T/#t Link: openwrt/openwrt#13016 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834 Signed-off-by: Ryan Keane <[email protected]>
If has FORTIFY_SOURCE=y and CONFIG_USE_LTO=y in build config, git will fail to compile with the following example error: /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h: In function 'process_curl_messages': /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h:90:8: error: inlining failed in call to 'always_inline' 'fwrite': function body can be overwritten at link time 90 | size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict); | ^ http.c:355:33: note: called from here 355 | fprintf(stderr, "Received DONE message for unknown request!\n"); | ^ A related issue is openwrt#13016 . This commit set PKG_FORTIFY_SOURCE to 0 if CONFIG_USE_LTO is y. Close: openwrt#24366 Link: https://lore.kernel.org/git/CAHfWF5mjquES-nocQaK+CAEsqWgdy-_OYdGtN82heYs0eJP3eQ@mail.gmail.com/T/#t Link: openwrt/openwrt#13016 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834 Signed-off-by: Ryan Keane <[email protected]>
If PKG_FORTIFY_SOURCE is not 0 and lto is enabled for package git, git will fail to compile with the following example error: /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h: In function 'process_curl_messages': /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h:90:8: error: inlining failed in call to 'always_inline' 'fwrite': function body can be overwritten at link time 90 | size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict); | ^ http.c:355:33: note: called from here 355 | fprintf(stderr, "Received DONE message for unknown request!\n"); | ^ A related issue is openwrt#13016 . This commit set PKG_FORTIFY_SOURCE to 0 if CONFIG_USE_LTO is y. Close: openwrt#24366 Link: https://lore.kernel.org/git/CAHfWF5mjquES-nocQaK+CAEsqWgdy-_OYdGtN82heYs0eJP3eQ@mail.gmail.com/T/#t Link: openwrt/openwrt#13016 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834 Signed-off-by: Ryan Keane <[email protected]>
If PKG_FORTIFY_SOURCE is not 0 and lto is enabled for package git, it will fail to compile with the following example error: /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h: In function 'process_curl_messages': /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h:90:8: error: inlining failed in call to 'always_inline' 'fwrite': function body can be overwritten at link time 90 | size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict); | ^ http.c:355:33: note: called from here 355 | fprintf(stderr, "Received DONE message for unknown request!\n"); | ^ A related issue is openwrt#13016 . This commit set PKG_FORTIFY_SOURCE to 0 if CONFIG_USE_LTO is y. Close openwrt#24366 Link: https://lore.kernel.org/git/CAHfWF5mjquES-nocQaK+CAEsqWgdy-_OYdGtN82heYs0eJP3eQ@mail.gmail.com/T/#t Link: openwrt/openwrt#13016 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834 Signed-off-by: Ryan Keane <[email protected]>
If PKG_FORTIFY_SOURCE is not 0 and lto is enabled for package git, it will fail to compile with the following example error: /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h: In function 'process_curl_messages': /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h:90:8: error: inlining failed in call to 'always_inline' 'fwrite': function body can be overwritten at link time 90 | size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict); | ^ http.c:355:33: note: called from here 355 | fprintf(stderr, "Received DONE message for unknown request!\n"); | ^ A related issue is openwrt#13016 . This commit set PKG_FORTIFY_SOURCE to 0 if CONFIG_USE_LTO is y. Close openwrt#24366 Link: https://lore.kernel.org/git/CAHfWF5mjquES-nocQaK+CAEsqWgdy-_OYdGtN82heYs0eJP3eQ@mail.gmail.com/T/#t Link: openwrt/openwrt#13016 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834 Signed-off-by: Ryan Keane <[email protected]>
If PKG_FORTIFY_SOURCE is not 0 and lto is enabled for package git, it will fail to compile with the following example error: /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h: In function 'process_curl_messages': /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h:90:8: error: inlining failed in call to 'always_inline' 'fwrite': function body can be overwritten at link time 90 | size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict); | ^ http.c:355:33: note: called from here 355 | fprintf(stderr, "Received DONE message for unknown request!\n"); | ^ A related issue is openwrt#13016 . This commit set PKG_FORTIFY_SOURCE to 0 if CONFIG_USE_LTO is y. Close openwrt#24366 Link: https://lore.kernel.org/git/CAHfWF5mjquES-nocQaK+CAEsqWgdy-_OYdGtN82heYs0eJP3eQ@mail.gmail.com/T/#t Link: openwrt/openwrt#13016 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834 Signed-off-by: Ryan Keane <[email protected]>
If PKG_FORTIFY_SOURCE is not 0 and lto is enabled for package git, it will fail to compile with the following example error: /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h: In function 'process_curl_messages': /openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h:90:8: error: inlining failed in call to 'always_inline' 'fwrite': function body can be overwritten at link time 90 | size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict); | ^ http.c:355:33: note: called from here 355 | fprintf(stderr, "Received DONE message for unknown request!\n"); | ^ A related issue is openwrt#13016 . This commit set PKG_FORTIFY_SOURCE to 0 if CONFIG_USE_LTO is y. Close openwrt#24366 Link: https://lore.kernel.org/git/CAHfWF5mjquES-nocQaK+CAEsqWgdy-_OYdGtN82heYs0eJP3eQ@mail.gmail.com/T/#t Link: openwrt/openwrt#13016 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834 Signed-off-by: Ryan Keane <[email protected]>
Issue template (remove lines from top till here)
Maintainer: @neheb
Environment: aarch64 generic 2b01007
Description:
Enabling LTO for
git
will cause build to fail, the error log is hereThe text was updated successfully, but these errors were encountered: