Skip to content

Commit f1e2b54

Browse files
CDRIVER-2813 remove BSON_EXTRA_ALIGNMENT option (#1942)
* remove `ENABLE_EXTRA_ALIGNMENT` CMake option * remove `ENABLE_EXTRA_ALIGNMENT` from test scripts * remove over-alignment of `bson_t` and `bson_iter_t` * remove `debug-compile-no-align` task * remove alignment requirement from `bson_impl_alloc_t` * add a static assert to ensure that `bson_t` and the implementations have matching alignment. * remove alignment requirement on `bson_iter_t` * align `bson_error_t` to size of a pointer * remove alignment specifier for `bson_value_t` * remove alignment specifier for `bson_visitor_t` --------- Co-authored-by: Ezra Chung <[email protected]>
1 parent b266c16 commit f1e2b54

File tree

17 files changed

+26
-103
lines changed

17 files changed

+26
-103
lines changed

.evergreen/config_generator/components/loadbalanced.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def tasks():
8383
env={
8484
'CC': _COMPILER,
8585
'CFLAGS': '-fno-omit-frame-pointer',
86-
'EXTRA_CONFIGURE_FLAGS': '-DENABLE_EXTRA_ALIGNMENT=OFF',
8786
'SSL': 'OPENSSL'
8887
},
8988
working_dir='mongoc',

.evergreen/config_generator/components/mock_server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def variants():
4242
'CC': 'gcc',
4343
'ASAN': 'on',
4444
'CFLAGS': '-fno-omit-frame-pointer',
45-
'EXTRA_CONFIGURE_FLAGS': '-DENABLE_EXTRA_ALIGNMENT=OFF',
4645
'SANITIZE': 'address,undefined',
4746
}
4847
),

.evergreen/config_generator/components/sanitizers/asan.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ def variants():
1010
'ASAN': 'on',
1111
'CFLAGS': '-fno-omit-frame-pointer',
1212
'CHECK_LOG': 'ON',
13-
'EXTRA_CONFIGURE_FLAGS': '-DENABLE_EXTRA_ALIGNMENT=OFF',
1413
'SANITIZE': 'address,undefined',
1514
}
1615

.evergreen/config_generator/components/sanitizers/tsan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def variants():
99
expansions = {
1010
'CFLAGS': '-fno-omit-frame-pointer',
1111
'CHECK_LOG': 'ON',
12-
'EXTRA_CONFIGURE_FLAGS': '-DENABLE_EXTRA_ALIGNMENT=OFF -DENABLE_SHM_COUNTERS=OFF',
12+
'EXTRA_CONFIGURE_FLAGS': '-DENABLE_SHM_COUNTERS=OFF',
1313
'SANITIZE': 'thread',
1414
}
1515

.evergreen/generated_configs/legacy-config.yml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -355,21 +355,6 @@ tasks:
355355
set -o errexit
356356
env SNAPPY="OFF" ZLIB="OFF" ZSTD="ON" .evergreen/scripts/compile.sh
357357
- func: upload-build
358-
- name: debug-compile-no-align
359-
tags:
360-
- debug-compile
361-
commands:
362-
- func: find-cmake-latest
363-
- command: shell.exec
364-
type: test
365-
params:
366-
working_dir: mongoc
367-
add_expansions_to_env: true
368-
shell: bash
369-
script: |-
370-
set -o errexit
371-
env EXTRA_CONFIGURE_FLAGS="-DENABLE_EXTRA_ALIGNMENT=OFF" SNAPPY="OFF" ZLIB="BUNDLED" ZSTD="OFF" .evergreen/scripts/compile.sh
372-
- func: upload-build
373358
- name: debug-compile-nosasl-nossl
374359
tags:
375360
- debug-compile
@@ -1311,7 +1296,7 @@ tasks:
13111296
shell: bash
13121297
script: |-
13131298
set -o errexit
1314-
env SANITIZE=address SASL=AUTO SSL=OPENSSL EXTRA_CONFIGURE_FLAGS='-DENABLE_EXTRA_ALIGNMENT=OFF' .evergreen/scripts/compile.sh
1299+
env SANITIZE=address SASL=AUTO SSL=OPENSSL .evergreen/scripts/compile.sh
13151300
- func: prepare-kerberos
13161301
- func: run auth tests
13171302
vars:
@@ -16373,7 +16358,6 @@ buildvariants:
1637316358
tasks:
1637416359
- release-compile
1637516360
- debug-compile-nosasl-nossl
16376-
- debug-compile-no-align
1637716361
- .debug-compile !.sspi .nossl .nosasl
1637816362
- .latest .nossl .nosasl
1637916363
- name: gcc82rhel
@@ -16417,7 +16401,6 @@ buildvariants:
1641716401
tasks:
1641816402
- release-compile
1641916403
- debug-compile-nosasl-nossl
16420-
- debug-compile-no-align
1642116404
- .latest .nossl .nosasl
1642216405
- name: gcc94
1642316406
display_name: GCC 9.4 (Ubuntu 20.04)
@@ -16429,7 +16412,6 @@ buildvariants:
1642916412
- debug-compile-nosrv
1643016413
- release-compile
1643116414
- debug-compile-nosasl-nossl
16432-
- debug-compile-no-align
1643316415
- debug-compile-sasl-openssl
1643416416
- debug-compile-nosasl-openssl
1643516417
- .authentication-tests .openssl
@@ -16449,7 +16431,6 @@ buildvariants:
1644916431
- .compression !.snappy
1645016432
- release-compile
1645116433
- debug-compile-nosasl-nossl
16452-
- debug-compile-no-align
1645316434
- debug-compile-nosrv
1645416435
- debug-compile-sasl-darwinssl
1645516436
- debug-compile-nosasl-nossl
@@ -16507,13 +16488,6 @@ buildvariants:
1650716488
tasks:
1650816489
- debug-compile-nosasl-nossl
1650916490
- .latest .nossl .nosasl .server
16510-
- name: mingw
16511-
display_name: MinGW-W64
16512-
expansions:
16513-
CC: mingw
16514-
run_on: windows-vsCurrent-large
16515-
tasks:
16516-
- debug-compile-no-align
1651716491
- name: rhel8-power
1651816492
display_name: Power (ppc64le) (RHEL 8)
1651916493
expansions:
@@ -16534,7 +16508,6 @@ buildvariants:
1653416508
run_on: ubuntu2004-arm64-large
1653516509
tasks:
1653616510
- .compression !.snappy !.zstd
16537-
- debug-compile-no-align
1653816511
- release-compile
1653916512
- debug-compile-nosasl-nossl
1654016513
- debug-compile-nosasl-openssl
@@ -16550,7 +16523,6 @@ buildvariants:
1655016523
run_on: rhel8-zseries-large
1655116524
tasks:
1655216525
- release-compile
16553-
- debug-compile-no-align
1655416526
- debug-compile-nosasl-nossl
1655516527
- debug-compile-nosasl-openssl
1655616528
- debug-compile-sasl-openssl

.evergreen/generated_configs/tasks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2949,7 +2949,6 @@ tasks:
29492949
env:
29502950
CC: gcc
29512951
CFLAGS: -fno-omit-frame-pointer
2952-
EXTRA_CONFIGURE_FLAGS: -DENABLE_EXTRA_ALIGNMENT=OFF
29532952
SSL: OPENSSL
29542953
args:
29552954
- -c

.evergreen/generated_configs/variants.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ buildvariants:
180180
ASAN: "on"
181181
CC: gcc
182182
CFLAGS: -fno-omit-frame-pointer
183-
EXTRA_CONFIGURE_FLAGS: -DENABLE_EXTRA_ALIGNMENT=OFF
184183
SANITIZE: address,undefined
185184
tasks:
186185
- name: mock-server-test
@@ -194,7 +193,6 @@ buildvariants:
194193
ASAN: "on"
195194
CFLAGS: -fno-omit-frame-pointer
196195
CHECK_LOG: "ON"
197-
EXTRA_CONFIGURE_FLAGS: -DENABLE_EXTRA_ALIGNMENT=OFF
198196
SANITIZE: address,undefined
199197
tasks:
200198
- name: .sanitizers-matrix-asan
@@ -203,7 +201,7 @@ buildvariants:
203201
expansions:
204202
CFLAGS: -fno-omit-frame-pointer
205203
CHECK_LOG: "ON"
206-
EXTRA_CONFIGURE_FLAGS: -DENABLE_EXTRA_ALIGNMENT=OFF -DENABLE_SHM_COUNTERS=OFF
204+
EXTRA_CONFIGURE_FLAGS: -DENABLE_SHM_COUNTERS=OFF
207205
SANITIZE: thread
208206
tasks:
209207
- name: .sanitizers-matrix-tsan

.evergreen/legacy_config_generator/evergreen_config_lib/tasks.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ class CompileWithClientSideEncryptionAsan(CompileTask):
151151
CFLAGS="-fno-omit-frame-pointer",
152152
COMPILE_LIBMONGOCRYPT="ON",
153153
CHECK_LOG="ON",
154-
EXTRA_CONFIGURE_FLAGS="-DENABLE_EXTRA_ALIGNMENT=OFF",
155154
PATH="/usr/lib/llvm-3.8/bin:$PATH",
156155
)
157156
cls_tags: ClassVar[Sequence[str]] = ["client-side-encryption"]
@@ -187,12 +186,6 @@ def __init__(
187186
CompileTask("debug-compile-compression-zlib", tags=["zlib", "compression"], compression="zlib"),
188187
CompileTask("debug-compile-compression-snappy", tags=["snappy", "compression"], compression="snappy"),
189188
CompileTask("debug-compile-compression-zstd", tags=["zstd", "compression"], compression="zstd"),
190-
CompileTask(
191-
"debug-compile-no-align",
192-
tags=["debug-compile"],
193-
compression="zlib",
194-
EXTRA_CONFIGURE_FLAGS="-DENABLE_EXTRA_ALIGNMENT=OFF",
195-
),
196189
CompileTask("debug-compile-nosasl-nossl", tags=["debug-compile", "nosasl", "nossl"], SSL="OFF"),
197190
CompileTask("debug-compile-lto", CFLAGS="-flto"),
198191
CompileTask("debug-compile-lto-thin", CFLAGS="-flto=thin"),
@@ -697,7 +690,7 @@ def pre_commands(self) -> Iterable[Value]:
697690
func("find-cmake-latest"),
698691
shell_mongoc(
699692
"""
700-
env SANITIZE=address SASL=AUTO SSL=OPENSSL EXTRA_CONFIGURE_FLAGS='-DENABLE_EXTRA_ALIGNMENT=OFF' .evergreen/scripts/compile.sh
693+
env SANITIZE=address SASL=AUTO SSL=OPENSSL .evergreen/scripts/compile.sh
701694
""",
702695
add_expansions_to_env=True,
703696
),

.evergreen/legacy_config_generator/evergreen_config_lib/variants.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def days(n: int) -> int:
111111
[
112112
"release-compile",
113113
"debug-compile-nosasl-nossl",
114-
"debug-compile-no-align",
115114
".debug-compile !.sspi .nossl .nosasl",
116115
".latest .nossl .nosasl",
117116
],
@@ -151,7 +150,7 @@ def days(n: int) -> int:
151150
"gcc94-i686",
152151
"GCC 9.4 (i686) (Ubuntu 20.04)",
153152
"ubuntu2004-test",
154-
["release-compile", "debug-compile-nosasl-nossl", "debug-compile-no-align", ".latest .nossl .nosasl"],
153+
["release-compile", "debug-compile-nosasl-nossl", ".latest .nossl .nosasl"],
155154
{"CC": "gcc", "MARCH": "i686"},
156155
),
157156
Variant(
@@ -163,7 +162,6 @@ def days(n: int) -> int:
163162
"debug-compile-nosrv",
164163
"release-compile",
165164
"debug-compile-nosasl-nossl",
166-
"debug-compile-no-align",
167165
"debug-compile-sasl-openssl",
168166
"debug-compile-nosasl-openssl",
169167
".authentication-tests .openssl",
@@ -185,7 +183,6 @@ def days(n: int) -> int:
185183
".compression !.snappy",
186184
"release-compile",
187185
"debug-compile-nosasl-nossl",
188-
"debug-compile-no-align",
189186
"debug-compile-nosrv",
190187
"debug-compile-sasl-darwinssl",
191188
"debug-compile-nosasl-nossl",
@@ -250,7 +247,6 @@ def days(n: int) -> int:
250247
["debug-compile-nosasl-nossl", ".latest .nossl .nosasl .server"],
251248
{"CC": "mingw"},
252249
),
253-
Variant("mingw", "MinGW-W64", "windows-vsCurrent-large", ["debug-compile-no-align"], {"CC": "mingw"}),
254250
Variant(
255251
"rhel8-power",
256252
"Power (ppc64le) (RHEL 8)",
@@ -272,7 +268,6 @@ def days(n: int) -> int:
272268
"ubuntu2004-arm64-large",
273269
[
274270
".compression !.snappy !.zstd",
275-
"debug-compile-no-align",
276271
"release-compile",
277272
"debug-compile-nosasl-nossl",
278273
"debug-compile-nosasl-openssl",
@@ -291,7 +286,6 @@ def days(n: int) -> int:
291286
[
292287
"release-compile",
293288
# '.compression', --> TODO: waiting on ticket CDRIVER-3258
294-
"debug-compile-no-align",
295289
"debug-compile-nosasl-nossl",
296290
"debug-compile-nosasl-openssl",
297291
"debug-compile-sasl-openssl",

CMakeLists.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,6 @@ mongo_bool_setting(
185185
]]
186186
)
187187

188-
# Deprecated options:
189-
mongo_bool_setting(
190-
ENABLE_EXTRA_ALIGNMENT
191-
"[Deprecated] Enable extra alignment on libbson types"
192-
DEFAULT VALUE ON
193-
DEVEL VALUE OFF
194-
VALIDATE CODE [[
195-
if(ENABLE_EXTRA_ALIGNMENT AND MONGO_SANITIZE MATCHES "undefined")
196-
message(WARNING "ENABLE_EXTRA_ALIGNMENT=“${ENABLE_EXTRA_ALIGNMENT}” will create conflicts with UndefinedBehaviorSanitizer")
197-
endif()
198-
]]
199-
)
200-
201188
# Announce the build configuration. Used by `mlib_build_config_is()` in `mlib/config.h`
202189
add_compile_definitions(_MLIB_BUILD_CONFIG=$<CONFIG>)
203190

@@ -302,8 +289,6 @@ if ( (ENABLE_BUILD_DEPENDECIES STREQUAL OFF) AND (NOT CMAKE_CURRENT_SOURCE_DIR S
302289
set (ENABLE_BUILD_DEPENDECIES ON)
303290
endif ()
304291

305-
mongo_pick(BSON_EXTRA_ALIGN 1 0 ENABLE_EXTRA_ALIGNMENT)
306-
307292
mongo_pick(MONGOC_ENABLE_RDTSCP 1 0 ENABLE_RDTSCP)
308293

309294
mongo_pick(MONGOC_ENABLE_STATIC_BUILD 1 0 ENABLE_STATIC)

0 commit comments

Comments
 (0)