Skip to content

Commit d9f7aa7

Browse files
committed
update default env (shouldn't we pass -fpic to default c flags on macos?)
1 parent 01ab0d3 commit d9f7aa7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

config/env.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ AR=${SPC_LINUX_DEFAULT_AR}
6969
LD=ld.gold
7070
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
7171
SPC_DEFAULT_C_FLAGS="-fpic -Os"
72-
SPC_DEFAULT_CXX_FLAGS="fpic -Os"
72+
SPC_DEFAULT_CXX_FLAGS="-fpic -Os"
7373
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
7474
SPC_EXTRA_LIBS=
7575
; upx executable path
@@ -91,13 +91,13 @@ SPC_CMD_VAR_PHP_EMBED_TYPE="static"
9191
; CFLAGS for configuring php
9292
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fpie"
9393
; CPPFLAGS for configuring php
94-
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
94+
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="${SPC_DEFAULT_CXX_FLAGS} -I${BUILD_INCLUDE_PATH} -fpie"
9595
; LDFLAGS for configuring php
9696
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
9797
; LIBS for configuring php
9898
SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm"
9999
; EXTRA_CFLAGS for `make` php
100-
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -Os -fno-ident -fpic -fpie"
100+
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fpie ${SPC_DEFAULT_C_FLAGS}"
101101
; EXTRA_LIBS for `make` php
102102
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm"
103103
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
@@ -133,7 +133,7 @@ SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
133133
; LDFLAGS for configuring php
134134
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
135135
; EXTRA_CFLAGS for `make` php
136-
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Os"
136+
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie ${SPC_DEFAULT_C_FLAGS}"
137137
; EXTRA_LIBS for `make` php
138138
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-lresolv"
139139
; embed type for php, static (libphp.a) or shared (libphp.dylib)

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function proveLibs(array $sorted_libraries): void
151151
protected function sanityCheck(int $build_target): void
152152
{
153153
// sanity check for php-cli
154-
if (($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI || file_exists(BUILD_BIN_PATH . '/php')) {
154+
if (($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) {
155155
logger()->info('running cli sanity check');
156156
[$ret, $output] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n -r "echo \"hello\";"');
157157
$raw_output = implode('', $output);

0 commit comments

Comments
 (0)