Skip to content

Commit 13894db

Browse files
committed
[features] Fix minsize feature list order
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 <yhdeng@google.com>
1 parent 3eeb4b8 commit 13894db

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

features/common/BUILD.bazel

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ feature(
208208
enabled = False,
209209
flag_sets = [
210210
flag_set(
211-
actions = C_ALL_COMPILE_ACTIONS + CPP_ALL_COMPILE_ACTIONS + LD_ALL_ACTIONS,
211+
actions = C_ALL_COMPILE_ACTIONS + CPP_ALL_COMPILE_ACTIONS,
212212
flag_groups = [
213213
flag_group(
214214
flags = [
@@ -219,6 +219,17 @@ feature(
219219
),
220220
],
221221
),
222+
flag_set(
223+
actions = LD_ALL_ACTIONS,
224+
flag_groups = [
225+
flag_group(
226+
flags = [
227+
# Inline slightly more which is actually smaller.
228+
"-Wl,-mllvm", "-Wl,--inline-threshold=10",
229+
],
230+
),
231+
],
232+
),
222233
],
223234
)
224235

@@ -364,11 +375,15 @@ feature_set(
364375
":exceptions",
365376
":use_lld",
366377
":lto",
367-
":minsize",
368378
":symbol_garbage_collection",
369379
":dbg",
370380
":fastbuild",
371381
":opt",
382+
383+
# To overwrite the level to minsize with feature flags, it needs to be
384+
# listed after the compilation modes.
385+
":minsize",
386+
372387
":output_format",
373388
":misc",
374389
":coverage",

0 commit comments

Comments
 (0)