Skip to content

Commit

Permalink
[Android] Enable LTO on arm64
Browse files Browse the repository at this point in the history
On armeabi-v7a it's broken in two ways.
Also simplify the LTCG determination code and print the result.
  • Loading branch information
Vogtinator committed Dec 5, 2022
1 parent 97dc203 commit 6d33cce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion firebird.pro
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ QMAKE_CXXFLAGS_RELEASE = -O3 -DNDEBUG
# with Qt's -reduce-relocations option (QTBUG-86173).
# MinGW fails with
# lto1.exe: internal compiler error: in gen_subprogram_die, at dwarf2out.c:22668
!clang | !if(linux|freebsd): !win32: CONFIG += ltcg
# On 32bit ARM, Qt adds -Oz by default but that breaks LTO with NDK r21
# (https://github.com/android/ndk/issues/721). Can be worked around with
# CONFIG -= optimize size, but the resulting binary has random crashes.
if(android:contains(QT_ARCH, "arm64.*")) | if(linux:!clang): CONFIG += ltcg

# noexecstack is not supported by MinGW's as
!win32 {
Expand Down Expand Up @@ -137,6 +140,8 @@ else: DEFINES += NO_TRANSLATION
message("FB_ARCH: $$FB_ARCH")
message("TRANSLATION_ENABLED: $$TRANSLATION_ENABLED")
message("SUPPORT_LINUX: $$SUPPORT_LINUX")
ltcg: message("LTCG: true")
else: message("LTCG: false")

equals(SUPPORT_LINUX, true) {
DEFINES += SUPPORT_LINUX
Expand Down

0 comments on commit 6d33cce

Please sign in to comment.