File tree Expand file tree Collapse file tree 11 files changed +55
-3
lines changed
Expand file tree Collapse file tree 11 files changed +55
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ NO_UPNP ?=
4242NO_USDT ?=
4343NO_NATPMP ?=
4444MULTIPROCESS ?=
45+ LTO ?=
4546FALLBACK_DOWNLOAD_PATH ?= http://dash-depends-sources.s3-website-us-west-2.amazonaws.com
4647
4748BUILD = $(shell ./config.guess)
@@ -140,8 +141,8 @@ include packages/packages.mk
140141# 2. Before including packages/*.mk (excluding packages/packages.mk), since
141142# they rely on the build_id variables
142143#
143- build_id: =$(shell env CC='$(build_CC ) ' CXX='$(build_CXX ) ' AR='$(build_AR ) ' RANLIB='$(build_RANLIB ) ' STRIP='$(build_STRIP ) ' SHA256SUM='$(build_SHA256SUM ) ' DEBUG='$(DEBUG ) ' ./gen_id '$(BUILD_ID_SALT ) ' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT ) ) ')
144- $(host_arch)_$(host_os)_id: =$(shell env CC='$(host_CC ) ' CXX='$(host_CXX ) ' AR='$(host_AR ) ' RANLIB='$(host_RANLIB ) ' STRIP='$(host_STRIP ) ' SHA256SUM='$(build_SHA256SUM ) ' DEBUG='$(DEBUG ) ' ./gen_id '$(HOST_ID_SALT ) ' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT ) ) ')
144+ build_id: =$(shell env CC='$(build_CC ) ' CXX='$(build_CXX ) ' AR='$(build_AR ) ' RANLIB='$(build_RANLIB ) ' STRIP='$(build_STRIP ) ' SHA256SUM='$(build_SHA256SUM ) ' DEBUG='$(DEBUG ) ' LTO=' $( LTO ) ' ./gen_id '$(BUILD_ID_SALT ) ' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT ) ) ')
145+ $(host_arch)_$(host_os)_id: =$(shell env CC='$(host_CC ) ' CXX='$(host_CXX ) ' AR='$(host_AR ) ' RANLIB='$(host_RANLIB ) ' STRIP='$(host_STRIP ) ' SHA256SUM='$(build_SHA256SUM ) ' DEBUG='$(DEBUG ) ' LTO=' $( LTO ) ' ./gen_id '$(HOST_ID_SALT ) ' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT ) ) ')
145146
146147qrencode_packages_$(NO_QR) = $(qrencode_$(host_os ) _packages )
147148
@@ -239,6 +240,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
239240 -e 's|@no_usdt@|$(NO_USDT)|' \
240241 -e 's|@no_natpmp@|$(NO_NATPMP)|' \
241242 -e 's|@multiprocess@|$(MULTIPROCESS)|' \
243+ -e 's|@lto@|$(LTO)|' \
242244 -e 's|@debug@|$(DEBUG)|' \
243245 $< > $@
244246 touch $@
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ The following can be set when running make: `make FOO=bar`
120120- ` LOG ` : Use file-based logging for individual packages. During a package build its log file
121121 resides in the ` depends ` directory, and the log file is printed out automatically in case
122122 of build error. After successful build log files are moved along with package archives
123+ - ` LTO ` : Use LTO when building packages.
123124
124125If some packages are not built, for example ` make NO_WALLET=1 ` , the appropriate
125126options will be passed to Dash Core's configure. In this case, ` --disable-wallet ` .
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ if test "@host_os@" = darwin; then
7878 BREW=no
7979fi
8080
81+ if test -z "$enable_lto" && test -n "@lto@"; then
82+ enable_lto=yes
83+ fi
84+
8185PATH="${depends_prefix}/native/bin:${PATH}"
8286PKG_CONFIG="$(which pkg-config) --static"
8387
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33# Usage: env [ CC=... ] [ CXX=... ] [ AR=... ] [ RANLIB=... ] [ STRIP=... ] \
4- # [ DEBUG=... ] ./build-id [ID_SALT]...
4+ # [ DEBUG=... ] [ LTO=... ] ./build-id [ID_SALT]...
55#
66# Prints to stdout a SHA256 hash representing the current toolset, used by
77# depends/Makefile as a build id for caching purposes (detecting when the
6363 env | grep ' ^STRIP_'
6464 echo " END STRIP"
6565
66+ echo " BEGIN LTO"
67+ echo " LTO=${LTO} "
68+ echo " END LTO"
69+
6670 echo " END ALL"
6771) | if [ -n " $DEBUG " ] && command -v tee > /dev/null 2>&1 ; then
6872 # When debugging and `tee` is available, output the preimage to stderr
Original file line number Diff line number Diff line change 55android_CXX =$(ANDROID_TOOLCHAIN_BIN ) /$(HOST )$(ANDROID_API_LEVEL ) -clang++
66android_CC =$(ANDROID_TOOLCHAIN_BIN ) /$(HOST )$(ANDROID_API_LEVEL ) -clang
77endif
8+
9+ ifneq ($(LTO ) ,)
10+ android_CFLAGS += -flto
11+ android_LDFLAGS += -flto
12+ endif
13+
814android_AR =$(ANDROID_TOOLCHAIN_BIN ) /llvm-ar
915android_RANLIB =$(ANDROID_TOOLCHAIN_BIN ) /llvm-ranlib
1016
Original file line number Diff line number Diff line change @@ -113,6 +113,12 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
113113 -Xclang -internal-externc-isystem$(OSX_SDK ) /usr/include
114114
115115darwin_CFLAGS =-pipe
116+
117+ ifneq ($(LTO ) ,)
118+ darwin_CFLAGS += -flto
119+ darwin_LDFLAGS += -flto
120+ endif
121+
116122darwin_CXXFLAGS =$(darwin_CFLAGS )
117123
118124darwin_release_CFLAGS =-O2
Original file line number Diff line number Diff line change 11freebsd_CFLAGS =-pipe
2+
3+ ifneq ($(LTO ) ,)
4+ freebsd_CFLAGS += -flto
5+ freebsd_LDFLAGS += -flto
6+ endif
7+
28freebsd_CXXFLAGS =$(freebsd_CFLAGS )
39
410freebsd_release_CFLAGS =-O2
Original file line number Diff line number Diff line change 11linux_CFLAGS =-pipe
2+
3+ ifneq ($(LTO ) ,)
4+ linux_CFLAGS += -flto
5+ linux_LDFLAGS += -flto
6+ endif
7+
28linux_CXXFLAGS =$(linux_CFLAGS )
39
410linux_release_CFLAGS =-O2
Original file line number Diff line number Diff line change @@ -3,6 +3,12 @@ mingw32_CXX := $(host)-g++-posix
33endif
44
55mingw32_CFLAGS =-pipe
6+
7+ ifneq ($(LTO ) ,)
8+ mingw32_CFLAGS += -flto
9+ mingw32_LDFLAGS += -flto
10+ endif
11+
612mingw32_CXXFLAGS =$(mingw32_CFLAGS )
713
814mingw32_release_CFLAGS =-O2
Original file line number Diff line number Diff line change 11netbsd_CFLAGS =-pipe
2+
3+ ifneq ($(LTO ) ,)
4+ netbsd_CFLAGS += -flto
5+ netbsd_LDFLAGS += -flto
6+ endif
7+
28netbsd_CXXFLAGS =$(netbsd_CFLAGS )
39
410netbsd_release_CFLAGS =-O2
You can’t perform that action at this time.
0 commit comments