Closed Ra2-IFV closed 3 months ago
Could you share diffconfig?
What should I compare my config with?
it should has nothing to do with custom config file. just LTO problems.
My suggestion is simply append no-lto
to BUILD_PKG_FLAGS
in Makefile as a workaround, since it's not important at all, and it may take developers a long time to make git compatible with LTO.
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 -O3
and LTO in make menuconfig
So may I ask, how to run diffconfig? It's not a standard command. It's in the scripts dir, sorry
GCC13, LTO enabled, diffconfig ouput:
CONFIG_TARGET_rockchip=y
CONFIG_TARGET_rockchip_armv8=y
CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y
CONFIG_DEVEL=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_EXTRA_OPTIMIZATION="-Ofast -fno-caller-saves -fno-plt -pipe"
# CONFIG_GDB is not set
CONFIG_LIBCURL_COOKIES=y
CONFIG_LIBCURL_FILE=y
CONFIG_LIBCURL_FTP=y
CONFIG_LIBCURL_HTTP=y
CONFIG_LIBCURL_MBEDTLS=y
CONFIG_LIBCURL_NGHTTP2=y
CONFIG_LIBCURL_NO_SMB="!"
CONFIG_LIBCURL_PROXY=y
CONFIG_LIBCURL_UNIX_SOCKETS=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_IDEA=y
CONFIG_OPENSSL_WITH_MDC2=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SEED=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_OPENSSL_WITH_WHIRLPOOL=y
CONFIG_PACKAGE_git=m
CONFIG_PACKAGE_git-http=m
CONFIG_PACKAGE_libcurl=m
CONFIG_PACKAGE_libnghttp2=m
CONFIG_PACKAGE_libopenssl=m
CONFIG_PACKAGE_zlib=m
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -march=armv8-a -mtune=cortex-a72.cortex-a53"
CONFIG_TARGET_OPTIONS=y
# CONFIG_TARGET_ROOTFS_EXT4FS is not set
CONFIG_USE_GC_SECTIONS=y
CONFIG_USE_LTO=y
CONFIG_USE_MOLD=y
make package/feeds/packages/git/{clean,prepare,compile} -j1 V=s
output: git.log
/openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.1.0_musl/include/stdio.h
Yeah, gcc13, maybe even gcc12....
wtf I did ran make dirclean
before...
/home/debian/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/stdio.h: In function 'process_curl_messages': /home/debian/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.3.0_musl/include/stdio.h:90:8: error: inlining failed in call to 'always_inline' 'fwrite': function body can be overwritten at link time
oh I did it right. Still complaining errors on GCC13.
or alternatively submit a PR.
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:
CONFIG_TARGET_rockchip=y
CONFIG_TARGET_rockchip_armv8=y
CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y
CONFIG_DEVEL=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_EXTRA_OPTIMIZATION="-fno-caller-saves -fno-plt -pipe"
# CONFIG_GDB is not set
CONFIG_LIBCURL_COOKIES=y
CONFIG_LIBCURL_FILE=y
CONFIG_LIBCURL_FTP=y
CONFIG_LIBCURL_HTTP=y
CONFIG_LIBCURL_MBEDTLS=y
CONFIG_LIBCURL_NGHTTP2=y
CONFIG_LIBCURL_NO_SMB="!"
CONFIG_LIBCURL_PROXY=y
CONFIG_LIBCURL_UNIX_SOCKETS=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_IDEA=y
CONFIG_OPENSSL_WITH_MDC2=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SEED=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_OPENSSL_WITH_WHIRLPOOL=y
CONFIG_PACKAGE_git=m
CONFIG_PACKAGE_git-http=m
CONFIG_PACKAGE_libcurl=m
CONFIG_PACKAGE_libnghttp2=m
CONFIG_PACKAGE_libopenssl=m
CONFIG_PACKAGE_zlib=m
CONFIG_TARGET_OPTIMIZATION="-pipe -march=armv8-a -mtune=cortex-a72.cortex-a53 -O3"
CONFIG_TARGET_OPTIONS=y
# CONFIG_TARGET_ROOTFS_EXT4FS is not set
CONFIG_USE_GC_SECTIONS=y
CONFIG_USE_LTO=y
CONFIG_USE_MOLD=y
build log: git.log
Must both use (-O3
or -Ofast
) and LTO to reproduce this error. Test passed with -O2
.
Close this issue?
Yep, O3/Ofast is excessive optimization . Like 1.0*(2+3)/4
can evaluate in any order ignoring parens
Issue template (remove lines from top till here)
Maintainer: @neheb
Environment: aarch64 generic 2b01007dd47b438222332bd64b75304ea5ed5ff6
Description: Enabling LTO for
git
will cause build to fail, the error log is here