Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong link flags when compiling with Bazel and clang-cl #10007

Closed
oakad opened this issue May 20, 2022 · 0 comments · Fixed by #16741
Closed

Wrong link flags when compiling with Bazel and clang-cl #10007

oakad opened this issue May 20, 2022 · 0 comments · Fixed by #16741

Comments

@oakad
Copy link

oakad commented May 20, 2022

When compiling with clang-cl toolchain (@bazel_tools//tools/cpp:clang-cl), wrong link flags will be set.

clang-cl is an important toolchain in particular for deep nested schemas, because it does not suffer from MAX_PATH limitations the normal cl toolchain has.

LINK_OPTS = select({
"//build_defs:config_android": [],
"//build_defs:config_android-stlport": [],
"//build_defs:config_android-libcpp": [],
"//build_defs:config_android-gnu-libstdcpp": [],
"//build_defs:config_android-default": [],
"//build_defs:config_msvc": [
# Suppress linker warnings about files with no symbols defined.
"-ignore:4221",
],
"//conditions:default": [
"-lpthread",
"-lm",
],
})

copybara-service bot pushed a commit that referenced this issue May 4, 2024
The idea here is to set the existing config "config_msvc" not only
when "msvc-cl" is specified but also when "clang-cl" is specified.

Supporting clang-cl should be a quick workaround for those who look for
a quick solution to cl.exe's path limitation e.g.

 * bazelbuild/bazel#18683

PiperOrigin-RevId: 630590450
copybara-service bot pushed a commit that referenced this issue May 4, 2024
The idea here is to set the existing config "config_msvc" not only
when "msvc-cl" is specified but also when "clang-cl" is specified.

Supporting clang-cl should be a quick workaround for those who look for
a quick solution to cl.exe's path limitation e.g.

 * bazelbuild/bazel#4149
 * bazelbuild/bazel#18683

PiperOrigin-RevId: 630590450
copybara-service bot pushed a commit that referenced this issue May 6, 2024
The idea here is to set the existing config "config_msvc" not only
when "msvc-cl" is specified but also when "clang-cl" is specified.

Keep in mind that clang-cl support in protobuf remains to be only
best-effort and untested for now.

PiperOrigin-RevId: 630590450
deannagarcia pushed a commit to deannagarcia/protobuf that referenced this issue Jun 20, 2024
…l with Bazel

The idea here is to set the existing config "config_msvc" not only
when "msvc-cl" is specified but also when "clang-cl" is specified.

Keep in mind that clang-cl support in protobuf remains to be only
best-effort and untested for now.

PiperOrigin-RevId: 631195504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants