From 13894db7d3a8d2aaf9e552832642af1dbb1d0f22 Mon Sep 17 00:00:00 2001 From: Yi-Hsuan Deng Date: Tue, 17 Dec 2024 10:18:48 +0000 Subject: [PATCH] [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 --- features/common/BUILD.bazel | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/features/common/BUILD.bazel b/features/common/BUILD.bazel index 8014593..49ab7f3 100644 --- a/features/common/BUILD.bazel +++ b/features/common/BUILD.bazel @@ -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 = [ @@ -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", + ], + ), + ], + ), ], ) @@ -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",