Move hardcoded -L linker flags to CROSSTOOL This cl introduces another build variable: library_search_directories, removes hardcoded -L generation from blaze and updates all the affected crosstools (those which started using action_configs, because the defaults from CppLinkActionConfigs are not applied then). -- PiperOrigin-RevId: 142738674 MOS_MIGRATED_REVID=142738674
diff --git a/tools/cpp/CROSSTOOL.tpl b/tools/cpp/CROSSTOOL.tpl index 36a7b1b..54caf33 100644 --- a/tools/cpp/CROSSTOOL.tpl +++ b/tools/cpp/CROSSTOOL.tpl
@@ -440,6 +440,19 @@ feature { name: 'input_param_flags' flag_set { + expand_if_all_available: 'library_search_directories' + action: 'c++-link-executable' + action: 'c++-link-dynamic-library' + action: 'c++-link-static-library' + action: 'c++-link-alwayslink-static-library' + action: 'c++-link-pic-static-library' + action: 'c++-link-alwayslink-pic-static-library' + flag_group { + iterate_over: 'library_search_directories' + flag: "-L%{library_search_directories}" + } + } + flag_set { expand_if_all_available: 'libopts' action: 'c++-link-executable' action: 'c++-link-dynamic-library'