2
0
Fork 0
mirror of https://github.com/bazelbuild/rules_cc synced 2024-11-27 20:43:26 +00:00
Commit graph

12 commits

Author SHA1 Message Date
Googler a2949e206e Fix toolchain argument ordering
BEGIN_PUBLIC

Fix argument ordering

Expected argument ordering should be:

1. Arguments listed in `args`.
2. Legacy/built-in features.
3. User-defined features.

Due to some implementation changes, user-defined arguments were being applied last, reducing the ability for features to properly toggle behaviors dynamically.

This also fixes an issue caught by this change where cc_sysroot was applying flags to actions that had no associated action config.

END_PUBLIC

PiperOrigin-RevId: 683677895
Change-Id: I60e25ca22ffefce717e4e5ce476db0a070ca1993
2024-10-08 10:34:59 -07:00
Keith Smiley b4f54fab89
Allow extra args to cc_sysroot
It's possible for there to be some arguments that are naturally
associated with the sysroot flag, for example on macOS there are
associated framework search paths that should be added with
`-F{sysroot}/Library/Frameworks`. There are also warnings flags you
might want to add such as `-Werror=missing-sysroot`. In this case I
think it's nicer to provide them alongside the sysroot definition,
instead of having to create a custom cc_args for them.
2024-09-22 14:00:13 -07:00
Googler 0d5561bcba Consolidate action labels in toolchain args
BEGIN_PUBLIC

Consolidate action labels in toolchain args

Consolidates action labels used by re-implementation of legacy features to use logical groups rather than individually listing every action. This simplifies the rule definitions slightly.

END_PUBLIC

PiperOrigin-RevId: 673920103
Change-Id: If5453dd5b45d5549ff75d656da8a2873232117ae
2024-09-12 11:05:19 -07:00
Googler b8bb882895 Fix rule-based implementation of runtime_library_search_directories
BEGIN_PUBLIC

Fix rule-based implementation of runtime_library_search_directories

As runtime_library_search_directories was written and reorganized through review, some instances of `$ORIGIN` were unintentionally renamed to `$EXEC_ORIGIN`. This change fixes those instances to correctly mirror CppActionConfigs.java.

END_PUBLIC

BUG: 349427627
PiperOrigin-RevId: 672401255
Change-Id: Ic20f9e77eccca8bc7e7f895aeaeb44f85022df28
2024-09-08 22:14:44 -07:00
Googler 0cd5c640a7 Implement libraries_to_link as cc_args
BEGIN_PUBLIC

Implement libraries_to_link as cc_args

Implements the libraries_to_link feature as libraries_to_link rules.

END_PUBLIC

PiperOrigin-RevId: 671775909
Change-Id: Ie3758e37f3db5c24ed9d757aa7cbeb78aecb153d
2024-09-06 08:56:38 -07:00
Googler 7c2883f3b1 Implement runtime_library_search_directories as cc_args
BEGIN_PUBLIC

Implement runtime_library_search_directories as cc_args

Implements the runtime_library_search_directories feature as cc_args rules.

END_PUBLIC

PiperOrigin-RevId: 671773775
Change-Id: I703824dee8ceb62ac1597e42cc74de0162952386
2024-09-06 08:49:49 -07:00
Googler 4bf8bb1f7d Implement shared_flag as cc_args
BEGIN_PUBLIC

Implement shared_flag as cc_args

Implements the shared_flag feature as cc_args rules.

END_PUBLIC

PiperOrigin-RevId: 671765792
Change-Id: I0c13873ef2b5c19908cbed13c1b88b5fc957c4cd
2024-09-06 08:25:09 -07:00
Googler 98ab8334e7 Implement force_pic_flags as cc_args
BEGIN_PUBLIC

Implement force_pic_flags as cc_args

Implements the force_pic_flags feature as cc_args rules.

END_PUBLIC

PiperOrigin-RevId: 671764316
Change-Id: I7f04bbf46027007fc47d230d49d3334b1a6ddfac
2024-09-06 08:20:51 -07:00
Googler cf6ccb93f4 Implement linker_param_file as cc_args
BEGIN_PUBLIC

Implement linker_param_file as cc_args

Implements the linker_param_file feature as cc_args rules.

END_PUBLIC

PiperOrigin-RevId: 671762576
Change-Id: Ic6bd3ad3b059599c796680cdb4e2b63f6929b8a9
2024-09-06 08:14:11 -07:00
Googler f999a8e23b Implement archiver_flags as cc_args
BEGIN_PUBLIC

Implement archiver_flags as cc_args

This is the first change in a series that will reimplement the legacy
features defined in Bazel's Java code using the new toolchain rules. These implementations are redefined as raw arguments using the new toolchain rules, which allows for the definition shared and reused across different contexts.

This first change implements archiver_flags, which is used to produce the arguments for the archiver tool used by `cc_library`.

This CL also adds a test that compares the feature implementation produced by
the new rules to the feature implementation defined in Bazel's Java
code. This should make it easier to review the final result and ensure it
is functionally equivalent to the Java implementation.

END_PUBLIC

PiperOrigin-RevId: 671403834
Change-Id: I2d4f15b49619a11995a50c86439340ea532e360e
2024-09-05 09:36:58 -07:00
Googler a778282a15 Fix action label evaluation in cc_sysroot
BEGIN_PUBLIC

Fix action label evaluation in cc_sysroot

Explicitly converts action labels in cc_sysroot to Label objects to address issues where the labels were being evaluated as relative to the module instantiating cc_sysroot rules.

END_PUBLIC

PiperOrigin-RevId: 667520654
Change-Id: Ia64306cc172dfaa747ef28a92390bcd90296b109
2024-08-26 03:09:37 -07:00
Googler 2480c90525 Replace sysroot with a cc_sysroot macro.
BEGIN_PUBLIC
Replace sysroot with a cc_sysroot macro.

This is part of what amontanez@ and I discussed about making C++ toolchains less "magic".
I'd like to do the same for cxx_builtin_include_directories, but that will require significantly more effort.

END_PUBLIC

PiperOrigin-RevId: 666607531
Change-Id: Ic9cfb157e892c05a9c875f240c0ed9a1048dea19
2024-08-22 20:36:02 -07:00