dash/depends/hosts/android.mk
laanwj 685b7a7a1b
Merge bitcoin/bitcoin#23611: build: add LTO option to depends
094772656d71b3f5022ae292094e878da035de9e build: support LTO in depends (fanquake)

Pull request description:

  This adds an `LTO` option to depends, i.e `make -C depends LTO=1`, which passes `-flto` when building packages (not currently qt), and automatically configures with `--enable-lto` when doing a build using a `CONFIG_SITE`.

  The following tables comapres the size (in bytes) of the stripped `x86_64` Linux binaries produced with master and this PR (full depends build):

  | Binary | stripped master | stripped LTO=1 | saving |
  | -------- | ----------------: | -------------: | --------: |
  | bitcoin-cli | 1178632 | 469872 | 60% |
  | bitcoin-tx  | 2710584 | 1866504 | 31% |
  | bitcoin-util | 952880 | 240104 | 74% |
  | bitcoin-wallet | 7992888 | 5365984 | 32% |
  | bitcoind | 13421336 | 11868592 | 12% |
  | bitcoin-qt | 37680496 | 31640976 | 16% |

ACKs for top commit:
  laanwj:
    Tested ACK 094772656d71b3f5022ae292094e878da035de9e

Tree-SHA512: 6b8483ea490e57a153105ad8c38b25fb1af5d55b1af22db398c7c2573612aaf71b4d2b4cf09c18fd6331b1358dba01641eeaa03e5018a925392e1937118d984a
2024-09-27 12:52:15 -05:00

18 lines
540 B
Makefile

ifeq ($(HOST),armv7a-linux-android)
android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)eabi$(ANDROID_API_LEVEL)-clang++
android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)eabi$(ANDROID_API_LEVEL)-clang
else
android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang++
android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang
endif
ifneq ($(LTO),)
android_CFLAGS += -flto
android_LDFLAGS += -flto
endif
android_AR=$(ANDROID_TOOLCHAIN_BIN)/llvm-ar
android_RANLIB=$(ANDROID_TOOLCHAIN_BIN)/llvm-ranlib
android_cmake_system=Android