Skip to content

Commit 75abd6d

Browse files
authored
Use CMAKE_POSITION_INDEPENDENT_CODE=ON instead of -fPIE or -pie (#2125)
1 parent cfbcdb4 commit 75abd6d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.evergreen/generated_configs/legacy-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ tasks:
246246
shell: bash
247247
script: |-
248248
set -o errexit
249-
env CFLAGS="-fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE -O" LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" SNAPPY="OFF" ZLIB="OFF" ZSTD="OFF" .evergreen/scripts/compile.sh
249+
env CFLAGS="-fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-all -O" EXTRA_CONFIGURE_FLAGS="CMAKE_POSITION_INDEPENDENT_CODE=ON" LDFLAGS="-Wl,-z,relro -Wl,-z,now" SNAPPY="OFF" ZLIB="OFF" ZSTD="OFF" .evergreen/scripts/compile.sh
250250
- func: upload-build
251251
- name: debug-compile-compression-zlib
252252
tags:

.evergreen/legacy_config_generator/evergreen_config_lib/tasks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ def __init__(
182182
'hardened-compile',
183183
tags=['hardened'],
184184
compression=None,
185-
CFLAGS='-fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE -O',
186-
LDFLAGS='-pie -Wl,-z,relro -Wl,-z,now',
185+
CFLAGS='-fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-all -O',
186+
LDFLAGS='-Wl,-z,relro -Wl,-z,now',
187+
EXTRA_CONFIGURE_FLAGS='CMAKE_POSITION_INDEPENDENT_CODE=ON',
187188
),
188189
CompileTask('debug-compile-compression-zlib', tags=['zlib', 'compression'], compression='zlib'),
189190
CompileTask('debug-compile-compression-snappy', tags=['snappy', 'compression'], compression='snappy'),

0 commit comments

Comments
 (0)