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

cmd/go: allow -fsanitize-undefined-strip-path-components #72842

Closed
zecke opened this issue Mar 13, 2025 · 3 comments
Closed

cmd/go: allow -fsanitize-undefined-strip-path-components #72842

zecke opened this issue Mar 13, 2025 · 3 comments

Comments

@zecke
Copy link

zecke commented Mar 13, 2025

Go version

go version go1.23.3 darwin/arm64

Output of go env in your module/workspace:

<snip>

What did you do?

I am using bazel with the rules_go, gazelle and hermetic_cc_toolchain bazel modules (bzlmod) to build an application. The application is allowed to rely on cgo (e.g. os/user)

What did you see happen?

The final binary was linked with the linker provided by hermetic_cc_toolchain and not Go's internal linker.

What did you expect to see?

I expected this to be linked with Go's linker. In this case it matters as there is a significant difference in linking speed.

@zecke
Copy link
Author

zecke commented Mar 13, 2025

The relevant flag leading to this behavior appears to be -fsanitize-undefined-strip-path-components=N and it controls stripping path information from the internal UndefinedBehaviorSanitizer

@seankhliao
Copy link
Member

This looks like an issue for hermetic_cc_toolchain, not Go.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/657575 mentions this issue: cmd/go: permit additional cflags when compiling

@seankhliao seankhliao reopened this Mar 13, 2025
@seankhliao seankhliao changed the title cmd/go: Uses external linker when using the hermetic_cc_toolchain bzlmod as C/C++ toolchain cmd/go: allow -fsanitize-undefined-strip-path-components Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants