aboutsummaryrefslogtreecommitdiff
path: root/depends/hosts
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-11-16 10:01:38 +0800
committerfanquake <fanquake@gmail.com>2022-06-14 12:08:27 +0100
commit094772656d71b3f5022ae292094e878da035de9e (patch)
tree25e0ef7721c5dc5a4970324a48f892141d8c3541 /depends/hosts
parent9e4fbebcc8e497016563e46de4c64fa094edab2d (diff)
downloadbitcoin-094772656d71b3f5022ae292094e878da035de9e.tar.xz
build: support LTO in depends
No Qt for now.
Diffstat (limited to 'depends/hosts')
-rw-r--r--depends/hosts/android.mk6
-rw-r--r--depends/hosts/darwin.mk6
-rw-r--r--depends/hosts/freebsd.mk6
-rw-r--r--depends/hosts/linux.mk6
-rw-r--r--depends/hosts/mingw32.mk6
-rw-r--r--depends/hosts/netbsd.mk6
-rw-r--r--depends/hosts/openbsd.mk5
7 files changed, 41 insertions, 0 deletions
diff --git a/depends/hosts/android.mk b/depends/hosts/android.mk
index fcc1c4f5c3..9029355460 100644
--- a/depends/hosts/android.mk
+++ b/depends/hosts/android.mk
@@ -5,6 +5,12 @@ 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
diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk
index bf9b7625f2..a564613cb6 100644
--- a/depends/hosts/darwin.mk
+++ b/depends/hosts/darwin.mk
@@ -110,6 +110,12 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
-Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
darwin_CFLAGS=-pipe
+
+ifneq ($(LTO),)
+darwin_CFLAGS += -flto
+darwin_LDFLAGS += -flto
+endif
+
darwin_CXXFLAGS=$(darwin_CFLAGS)
darwin_release_CFLAGS=-O2
diff --git a/depends/hosts/freebsd.mk b/depends/hosts/freebsd.mk
index 0a62347b57..853fa0f457 100644
--- a/depends/hosts/freebsd.mk
+++ b/depends/hosts/freebsd.mk
@@ -1,4 +1,10 @@
freebsd_CFLAGS=-pipe
+
+ifneq ($(LTO),)
+freebsd_CFLAGS += -flto
+freebsd_LDFLAGS += -flto
+endif
+
freebsd_CXXFLAGS=$(freebsd_CFLAGS)
freebsd_release_CFLAGS=-O2
diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk
index 07da752492..5322520e6f 100644
--- a/depends/hosts/linux.mk
+++ b/depends/hosts/linux.mk
@@ -1,4 +1,10 @@
linux_CFLAGS=-pipe
+
+ifneq ($(LTO),)
+linux_CFLAGS += -flto
+linux_LDFLAGS += -flto
+endif
+
linux_CXXFLAGS=$(linux_CFLAGS)
linux_release_CFLAGS=-O2
diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk
index 48020d71af..979280b5cb 100644
--- a/depends/hosts/mingw32.mk
+++ b/depends/hosts/mingw32.mk
@@ -3,6 +3,12 @@ mingw32_CXX := $(host)-g++-posix
endif
mingw32_CFLAGS=-pipe
+
+ifneq ($(LTO),)
+mingw32_CFLAGS += -flto
+mingw32_LDFLAGS += -flto
+endif
+
mingw32_CXXFLAGS=$(mingw32_CFLAGS)
mingw32_release_CFLAGS=-O2
diff --git a/depends/hosts/netbsd.mk b/depends/hosts/netbsd.mk
index b3e4545a64..9e48248b7e 100644
--- a/depends/hosts/netbsd.mk
+++ b/depends/hosts/netbsd.mk
@@ -1,4 +1,10 @@
netbsd_CFLAGS=-pipe
+
+ifneq ($(LTO),)
+netbsd_CFLAGS += -flto
+netbsd_LDFLAGS += -flto
+endif
+
netbsd_CXXFLAGS=$(netbsd_CFLAGS)
netbsd_release_CFLAGS=-O2
diff --git a/depends/hosts/openbsd.mk b/depends/hosts/openbsd.mk
index 5988f24bff..c4a629e021 100644
--- a/depends/hosts/openbsd.mk
+++ b/depends/hosts/openbsd.mk
@@ -1,6 +1,11 @@
openbsd_CFLAGS=-pipe
openbsd_CXXFLAGS=$(openbsd_CFLAGS)
+ifneq ($(LTO),)
+openbsd_CFLAGS += -flto
+openbsd_LDFLAGS += -flto
+endif
+
openbsd_release_CFLAGS=-O2
openbsd_release_CXXFLAGS=$(openbsd_release_CFLAGS)