git: Set PKG_FORTIFY_SOURCE to 0 when lto enabled
authorRyan Keane <the.ra2.ifv@gmail.com>
Wed, 13 Nov 2024 11:14:03 +0000 (03:14 -0800)
committerRosen Penev <rosenp@gmail.com>
Wed, 22 Jan 2025 02:35:44 +0000 (18:35 -0800)
commitb7bbd4259456ae3e881701b95a17aed6b64d44a4
tree007c9f2760277d8a13d5d2ddcc023b1744b7d101
parent59db1470314a4a3f5c78ad805fa8381de0231936
git: Set PKG_FORTIFY_SOURCE to 0 when lto enabled

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 #13016 .
This commit set PKG_FORTIFY_SOURCE to 0 if CONFIG_USE_LTO is y.

Close #24366

Link: https://lore.kernel.org/git/CAHfWF5mjquES-nocQaK+CAEsqWgdy-_OYdGtN82heYs0eJP3eQ@mail.gmail.com/T/#t
Link: https://github.com/openwrt/openwrt/issues/13016
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834
Signed-off-by: Ryan Keane <the.ra2.ifv@gmail.com>
net/git/Makefile