Skip to content

Commit 5abc45b

Browse files
kkolur76meta-codesync[bot]
authored andcommitted
Replace arch_preprocessor_flags with selects in preprocessor_flags
Summary: Migrate all BUCK file usages of `arch_preprocessor_flags` to `select()` in `preprocessor_flags`. Architecture mapping: - `"x86_64"` → `"ovr_config//cpu:x86_64"` - `"aarch64"` → `"ovr_config//cpu:arm64"` For targets with existing `preprocessor_flags`, the select is merged via `+`. Reviewed By: dtolnay Differential Revision: D92610949 fbshipit-source-id: 3af7311cbfe0992101415ef8615aa1bd5ff7bb98
1 parent bcb1bb4 commit 5abc45b

File tree

4 files changed

+44
-35
lines changed

4 files changed

+44
-35
lines changed

folly/BUCK

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4797,12 +4797,13 @@ fbcode_target(
47974797
}),
47984798
auto_headers = AutoHeaders.NONE,
47994799
headers = [],
4800-
arch_preprocessor_flags = {
4801-
"x86_64": [
4800+
modular_headers = False,
4801+
preprocessor_flags = select({
4802+
"DEFAULT": [],
4803+
"ovr_config//cpu:x86_64": [
48024804
"-mavx2",
48034805
],
4804-
},
4805-
modular_headers = False,
4806+
}),
48064807
exported_deps = select({
48074808
"DEFAULT": [],
48084809
"ovr_config//os:linux-arm64": [
@@ -4838,17 +4839,18 @@ fbcode_target(
48384839
}),
48394840
auto_headers = AutoHeaders.NONE,
48404841
headers = [],
4841-
arch_preprocessor_flags = {
4842-
"aarch64": [
4842+
link_whole = True, # Set link_whole to force linker to use __folly_memset
4843+
modular_headers = False,
4844+
preprocessor_flags = select({
4845+
"DEFAULT": [],
4846+
"ovr_config//cpu:arm64": [
48434847
"-DFOLLY_MEMSET_IS_MEMSET",
48444848
],
4845-
"x86_64": [
4849+
"ovr_config//cpu:x86_64": [
48464850
"-DFOLLY_MEMSET_IS_MEMSET",
48474851
"-mavx2",
48484852
],
4849-
},
4850-
link_whole = True, # Set link_whole to force linker to use __folly_memset
4851-
modular_headers = False,
4853+
}),
48524854
exported_deps = select({
48534855
"DEFAULT": [],
48544856
"ovr_config//os:linux-arm64": [
@@ -4873,12 +4875,13 @@ fbcode_target(
48734875
}),
48744876
auto_headers = AutoHeaders.NONE,
48754877
headers = [],
4876-
arch_preprocessor_flags = {
4877-
"x86_64": [
4878+
modular_headers = False,
4879+
preprocessor_flags = select({
4880+
"DEFAULT": [],
4881+
"ovr_config//cpu:x86_64": [
48784882
"-mavx2",
48794883
],
4880-
},
4881-
modular_headers = False,
4884+
}),
48824885
exported_deps = select({
48834886
"DEFAULT": [],
48844887
"ovr_config//os:linux-arm64": [
@@ -4914,18 +4917,19 @@ fbcode_target(
49144917
}),
49154918
auto_headers = AutoHeaders.NONE,
49164919
headers = [],
4917-
arch_preprocessor_flags = {
4918-
"aarch64": [
4920+
link_whole = True, # Set link_whole to force linker to use __folly_memcpy
4921+
modular_headers = False,
4922+
preprocessor_flags = select({
4923+
"DEFAULT": [],
4924+
"ovr_config//cpu:arm64": [
49194925
"-DFOLLY_MEMCPY_IS_MEMCPY",
49204926
],
4921-
"x86_64": [
4927+
"ovr_config//cpu:x86_64": [
49224928
"-DFOLLY_MEMCPY_IS_MEMCPY",
49234929
"-mavx2",
49244930
"-march=haswell",
49254931
],
4926-
},
4927-
link_whole = True, # Set link_whole to force linker to use __folly_memcpy
4928-
modular_headers = False,
4932+
}),
49294933
exported_deps = select({
49304934
"DEFAULT": [],
49314935
"ovr_config//os:linux-arm64": [

folly/detail/BUCK

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -987,13 +987,14 @@ fbcode_target(
987987
name = "traponavx512",
988988
srcs = ["TrapOnAvx512.cpp"],
989989
headers = ["TrapOnAvx512.h"],
990-
arch_preprocessor_flags = {
991-
"x86_64": [
990+
compiler_flags = select({
991+
"DEFAULT": [],
992+
"ovr_config//cpu:x86_64": [
992993
"-msse4.2",
993994
"-mavx512f",
994995
"-mavx512vl",
995996
],
996-
},
997+
}),
997998
deps = [
998999
"//folly:portability",
9991000
],

folly/external/aor/BUCK

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ fbcode_target(
3434
headers = [
3535
"asmdefs.h",
3636
],
37-
arch_preprocessor_flags = {
38-
"aarch64": [
37+
preprocessor_flags = select({
38+
"DEFAULT": [],
39+
"ovr_config//cpu:arm64": [
3940
"-DFOLLY_MEMCPY_IS_MEMCPY",
4041
],
41-
},
42+
}),
4243
target_compatible_with = [
4344
"ovr_config//os:linux-arm64",
4445
],
@@ -69,11 +70,12 @@ fbcode_target(
6970
headers = [
7071
"asmdefs.h",
7172
],
72-
arch_preprocessor_flags = {
73-
"aarch64": [
73+
preprocessor_flags = select({
74+
"DEFAULT": [],
75+
"ovr_config//cpu:arm64": [
7476
"-DFOLLY_MEMSET_IS_MEMSET",
7577
],
76-
},
78+
}),
7779
target_compatible_with = [
7880
"ovr_config//os:linux-arm64",
7981
],

folly/external/fast-crc32/BUCK

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ fbcode_target(
1212
headers = [
1313
"avx512_crc32c_v8s3x4.h",
1414
],
15-
arch_preprocessor_flags = {
16-
"x86_64": [
15+
compiler_flags = select({
16+
"DEFAULT": [],
17+
"ovr_config//cpu:x86_64": [
1718
"-mavx512f",
1819
"-mavx512vl",
1920
"-mpclmul",
2021
],
21-
},
22+
}),
2223
exported_deps = [
2324
"//folly:portability",
2425
],
@@ -47,11 +48,12 @@ fbcode_target(
4748
headers = [
4849
"neon_crc32c_v3s4x2e_v2.h",
4950
],
50-
arch_preprocessor_flags = {
51-
"aarch64": [
51+
compiler_flags = select({
52+
"DEFAULT": [],
53+
"ovr_config//cpu:arm64": [
5254
"-march=armv8-a+crypto+crc",
5355
],
54-
},
56+
}),
5557
deps = [
5658
"//folly:portability",
5759
"//folly/system:aux_vector",

0 commit comments

Comments
 (0)