Commit 685b7a7 1 parent d2b8c6b commit 685b7a7 Copy full SHA for 685b7a7
File tree 11 files changed +55
-3
lines changed
11 files changed +55
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ NO_UPNP ?=
42
42
NO_USDT ?=
43
43
NO_NATPMP ?=
44
44
MULTIPROCESS ?=
45
+ LTO ?=
45
46
FALLBACK_DOWNLOAD_PATH ?= http://dash-depends-sources.s3-website-us-west-2.amazonaws.com
46
47
47
48
BUILD = $(shell ./config.guess)
@@ -140,8 +141,8 @@ include packages/packages.mk
140
141
# 2. Before including packages/*.mk (excluding packages/packages.mk), since
141
142
# they rely on the build_id variables
142
143
#
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 ) ) ')
145
146
146
147
qrencode_packages_$(NO_QR) = $(qrencode_$(host_os ) _packages )
147
148
@@ -239,6 +240,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
239
240
-e 's|@no_usdt@|$(NO_USDT)|' \
240
241
-e 's|@no_natpmp@|$(NO_NATPMP)|' \
241
242
-e 's|@multiprocess@|$(MULTIPROCESS)|' \
243
+ -e 's|@lto@|$(LTO)|' \
242
244
-e 's|@debug@|$(DEBUG)|' \
243
245
$< > $@
244
246
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`
120
120
- ` LOG ` : Use file-based logging for individual packages. During a package build its log file
121
121
resides in the ` depends ` directory, and the log file is printed out automatically in case
122
122
of build error. After successful build log files are moved along with package archives
123
+ - ` LTO ` : Use LTO when building packages.
123
124
124
125
If some packages are not built, for example ` make NO_WALLET=1 ` , the appropriate
125
126
options 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
78
78
BREW=no
79
79
fi
80
80
81
+ if test -z "$enable_lto" && test -n "@lto@"; then
82
+ enable_lto=yes
83
+ fi
84
+
81
85
PATH="${depends_prefix}/native/bin:${PATH}"
82
86
PKG_CONFIG="$(which pkg-config) --static"
83
87
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# Usage: env [ CC=... ] [ CXX=... ] [ AR=... ] [ RANLIB=... ] [ STRIP=... ] \
4
- # [ DEBUG=... ] ./build-id [ID_SALT]...
4
+ # [ DEBUG=... ] [ LTO=... ] ./build-id [ID_SALT]...
5
5
#
6
6
# Prints to stdout a SHA256 hash representing the current toolset, used by
7
7
# depends/Makefile as a build id for caching purposes (detecting when the
63
63
env | grep ' ^STRIP_'
64
64
echo " END STRIP"
65
65
66
+ echo " BEGIN LTO"
67
+ echo " LTO=${LTO} "
68
+ echo " END LTO"
69
+
66
70
echo " END ALL"
67
71
) | if [ -n " $DEBUG " ] && command -v tee > /dev/null 2>&1 ; then
68
72
# When debugging and `tee` is available, output the preimage to stderr
Original file line number Diff line number Diff line change 5
5
android_CXX =$(ANDROID_TOOLCHAIN_BIN ) /$(HOST )$(ANDROID_API_LEVEL ) -clang++
6
6
android_CC =$(ANDROID_TOOLCHAIN_BIN ) /$(HOST )$(ANDROID_API_LEVEL ) -clang
7
7
endif
8
+
9
+ ifneq ($(LTO ) ,)
10
+ android_CFLAGS += -flto
11
+ android_LDFLAGS += -flto
12
+ endif
13
+
8
14
android_AR =$(ANDROID_TOOLCHAIN_BIN ) /llvm-ar
9
15
android_RANLIB =$(ANDROID_TOOLCHAIN_BIN ) /llvm-ranlib
10
16
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 \
113
113
-Xclang -internal-externc-isystem$(OSX_SDK ) /usr/include
114
114
115
115
darwin_CFLAGS =-pipe
116
+
117
+ ifneq ($(LTO ) ,)
118
+ darwin_CFLAGS += -flto
119
+ darwin_LDFLAGS += -flto
120
+ endif
121
+
116
122
darwin_CXXFLAGS =$(darwin_CFLAGS )
117
123
118
124
darwin_release_CFLAGS =-O2
Original file line number Diff line number Diff line change 1
1
freebsd_CFLAGS =-pipe
2
+
3
+ ifneq ($(LTO ) ,)
4
+ freebsd_CFLAGS += -flto
5
+ freebsd_LDFLAGS += -flto
6
+ endif
7
+
2
8
freebsd_CXXFLAGS =$(freebsd_CFLAGS )
3
9
4
10
freebsd_release_CFLAGS =-O2
Original file line number Diff line number Diff line change 1
1
linux_CFLAGS =-pipe
2
+
3
+ ifneq ($(LTO ) ,)
4
+ linux_CFLAGS += -flto
5
+ linux_LDFLAGS += -flto
6
+ endif
7
+
2
8
linux_CXXFLAGS =$(linux_CFLAGS )
3
9
4
10
linux_release_CFLAGS =-O2
Original file line number Diff line number Diff line change @@ -3,6 +3,12 @@ mingw32_CXX := $(host)-g++-posix
3
3
endif
4
4
5
5
mingw32_CFLAGS =-pipe
6
+
7
+ ifneq ($(LTO ) ,)
8
+ mingw32_CFLAGS += -flto
9
+ mingw32_LDFLAGS += -flto
10
+ endif
11
+
6
12
mingw32_CXXFLAGS =$(mingw32_CFLAGS )
7
13
8
14
mingw32_release_CFLAGS =-O2
Original file line number Diff line number Diff line change 1
1
netbsd_CFLAGS =-pipe
2
+
3
+ ifneq ($(LTO ) ,)
4
+ netbsd_CFLAGS += -flto
5
+ netbsd_LDFLAGS += -flto
6
+ endif
7
+
2
8
netbsd_CXXFLAGS =$(netbsd_CFLAGS )
3
9
4
10
netbsd_release_CFLAGS =-O2
Original file line number Diff line number Diff line change 1
1
openbsd_CFLAGS =-pipe
2
2
openbsd_CXXFLAGS =$(openbsd_CFLAGS )
3
3
4
+ ifneq ($(LTO ) ,)
5
+ openbsd_CFLAGS += -flto
6
+ openbsd_LDFLAGS += -flto
7
+ endif
8
+
4
9
openbsd_release_CFLAGS =-O2
5
10
openbsd_release_CXXFLAGS =$(openbsd_release_CFLAGS )
6
11
You can’t perform that action at this time.
0 commit comments