bazel-contrib / bazel-contrib/rules_foreign_cc

--sysroot parameter should probably be included in CPPFLAGS

Open
#985 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

I'm investigating a build break that happens when `configure_make` target is built using custom toolchain with `builtin_sysroot`

`--sysroot` parameter is passed to the external project int `CFLAGS`, `CXXFLAGS` and `LDFLAGS` but not in `CPPFLAGS` that only contains include-related flags in my case.

Makefile in question contains pre-processor-only step that references `$(CPPFLAGS)`. This step fails because correct sysroot value is not passed to the gcc.

The fix should probably be adding `--sysroot` parameter to `CPPFLAGS` env variable.

Contributor guide

Open the contributing guide

Research direction

Start from the configure_make target and trace how builtin_sysroot is mapped into the external project's CFLAGS, CXXFLAGS, LDFLAGS, and CPPFLAGS. Reproduce the pre-processor-only Makefile step with the custom toolchain, then verify that the step receives the correct sysroot through CPPFLAGS.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.