Skip to content

Commit f439a2f

Browse files
illwieckzslipher
authored andcommitted
external_deps: use -O2 and -fPIC for all packages
1 parent 56b6135 commit f439a2f

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
@@ -226,8 +226,7 @@ build_pkgconfig() {
226226

227227
cd "${dir_name}"
228228

229-
# The default -O2 is dropped when there's user-provided CFLAGS.
230-
CFLAGS="${CFLAGS} -O2" configure_build --with-internal-glib
229+
configure_build --with-internal-glib
231230
}
232231

233232
# Build NASM
@@ -313,8 +312,7 @@ build_gmp() {
313312

314313
cd "${dir_name}"
315314

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

319317
case "${PLATFORM}" in
320318
windows-*-msvc)
@@ -337,8 +335,7 @@ build_nettle() {
337335

338336
cd "${dir_name}"
339337

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

344341
# Build cURL
@@ -800,8 +797,7 @@ build_opusfile() {
800797

801798
cd "${dir_name}"
802799

803-
# The default -O2 is dropped when there's user-provided CFLAGS.
804-
CFLAGS="${CFLAGS} -O2" configure_build --disable-http
800+
configure_build --disable-http
805801
}
806802

807803
# Build ncurses

0 commit comments

Comments
 (0)