Skip to content

Commit

Permalink
[features] Fix minsize feature list order
Browse files Browse the repository at this point in the history
Only the last optimization level is effective.
To overwrite the level to minsize with the minsize feature flag,
the feature needs to be listed after the compilation modes.

Change-Id: I63ff18f0b6ae450441708e80abbf7228f031913f
Signed-off-by: Yi-Hsuan Deng <[email protected]>
  • Loading branch information
sasdf committed Dec 17, 2024
1 parent 3eeb4b8 commit 13894db
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions features/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ feature(
enabled = False,
flag_sets = [
flag_set(
actions = C_ALL_COMPILE_ACTIONS + CPP_ALL_COMPILE_ACTIONS + LD_ALL_ACTIONS,
actions = C_ALL_COMPILE_ACTIONS + CPP_ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
Expand All @@ -219,6 +219,17 @@ feature(
),
],
),
flag_set(
actions = LD_ALL_ACTIONS,
flag_groups = [
flag_group(
flags = [
# Inline slightly more which is actually smaller.
"-Wl,-mllvm", "-Wl,--inline-threshold=10",
],
),
],
),
],
)

Expand Down Expand Up @@ -364,11 +375,15 @@ feature_set(
":exceptions",
":use_lld",
":lto",
":minsize",
":symbol_garbage_collection",
":dbg",
":fastbuild",
":opt",

# To overwrite the level to minsize with feature flags, it needs to be
# listed after the compilation modes.
":minsize",

":output_format",
":misc",
":coverage",
Expand Down

0 comments on commit 13894db

Please sign in to comment.