Skip to content

Commit f5aab43

Browse files
illwieckzslipher
authored andcommitted
external_deps: use -O2 and -fPIC for all packages
1 parent 0230485 commit f5aab43

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

external_deps/build.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ LIBS_STATIC='ON'
8080
CMAKE_TOOLCHAIN=''
8181
# Always reset flags, we heavily cross-compile and must not inherit any stray flag
8282
# from environment.
83-
CFLAGS=''
84-
CXXFLAGS=''
8583
CPPFLAGS=''
86-
LDFLAGS=''
84+
CFLAGS='-O2 -fPIC'
85+
CXXFLAGS='-O2 -fPIC'
86+
LDFLAGS='-O2 -fPIC'
8787

8888
log() {
8989
level="${1}"; shift
@@ -227,8 +227,7 @@ build_pkgconfig() {
227227

228228
cd "${dir_name}"
229229

230-
# The default -O2 is dropped when there's user-provided CFLAGS.
231-
CFLAGS="${CFLAGS} -O2 -Wno-error=int-conversion" configure_build --with-internal-glib
230+
CFLAGS="${CFLAGS} -Wno-error=int-conversion" configure_build --with-internal-glib
232231
}
233232

234233
# Build NASM
@@ -314,8 +313,7 @@ build_gmp() {
314313

315314
cd "${dir_name}"
316315

317-
# The default -O2 is dropped when there's user-provided CFLAGS.
318-
CFLAGS="${CFLAGS} -O2" configure_build "${gmp_configure_args[@]}"
316+
configure_build "${gmp_configure_args[@]}"
319317

320318
case "${PLATFORM}" in
321319
windows-*-msvc)
@@ -338,8 +336,7 @@ build_nettle() {
338336

339337
cd "${dir_name}"
340338

341-
# The default -O2 is dropped when there's user-provided CFLAGS.
342-
CFLAGS="${CFLAGS} -O2" configure_build
339+
configure_build
343340
}
344341

345342
# Build cURL
@@ -808,8 +805,7 @@ build_opusfile() {
808805

809806
cd "${dir_name}"
810807

811-
# The default -O2 is dropped when there's user-provided CFLAGS.
812-
CFLAGS="${CFLAGS} -O2" configure_build --disable-http
808+
configure_build --disable-http
813809
}
814810

815811
# Build ncurses

0 commit comments

Comments
 (0)