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

Always use -Wl,--warn-unresolved-symbols in MSAN builds #48835

Merged
merged 2 commits into from
Mar 1, 2023

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Feb 28, 2023

One of the two ways I could think of to fix #48732. The other one is to use -Wl,--warn-unresolved-symbols in suitesparse only when doing the MSAN build, but I figured that this flag might be useful for other packages as well.

CC: @fxcoudert.

@giordano giordano added building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries labels Feb 28, 2023
@giordano giordano requested a review from Keno February 28, 2023 22:15
@giordano giordano added the backport 1.9 Change should be backported to release-1.9 label Feb 28, 2023
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Feb 28, 2023
@fxcoudert
Copy link
Contributor

I'm not sure I understand. --warn-unresolved-symbols is not recognised by macOS ld, so it's not clear why we should pass it to more makefiles? Unless SANITIZE_MEMORY is never defined on macOS?

@giordano
Copy link
Contributor Author

Unless SANITIZE_MEMORY is never defined on macOS?

I think MSAN builds (somewhat) work only on x86_64 linux. @gbaraldi is that correct?

@gbaraldi
Copy link
Member

MSAN only exists on linux currently so yeah.

@giordano
Copy link
Contributor Author

giordano commented Feb 28, 2023

Ok, according to the docs builds with sanitizer might work also on macOS. I change it to add -Wl,--warn-unresolved-symbols only on Linux and FreeBSD. On macOS I get

% make SANITIZE=1 SANITIZE_MEMORY=1 print-SANITIZE_LDFLAGS
SANITIZE_LDFLAGS=  -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer

which looks good.

@gbaraldi
Copy link
Member

gbaraldi commented Feb 28, 2023

Sanitizers work on macos fine. Specifically ASAN and TSAN, but MSAN is Linux and some BSDs only. At least currently. But that looks fine.

@giordano giordano merged commit a07f512 into JuliaLang:master Mar 1, 2023
@giordano giordano deleted the mg/msan-ldflags branch March 1, 2023 15:44
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Mar 1, 2023
KristofferC pushed a commit that referenced this pull request Mar 3, 2023
* Always use `-Wl,--warn-unresolved-symbols` in MSAN builds

* Use `-Wl,--warn-unresolved-symbols` only on Linux and FreeBSD

(cherry picked from commit a07f512)
@KristofferC KristofferC mentioned this pull request Mar 3, 2023
50 tasks
KristofferC pushed a commit that referenced this pull request Mar 3, 2023
* Always use `-Wl,--warn-unresolved-symbols` in MSAN builds

* Use `-Wl,--warn-unresolved-symbols` only on Linux and FreeBSD

(cherry picked from commit a07f512)
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build from source of 1.9.0-beta1 to beta4 broken due to suite-sparse
5 participants