This is an archive of the discontinued LLVM Phabricator instance.

[clang][Fuchsia] Ensure static sanitizer libs are only linked in after the -nostdlib check
ClosedPublic

Authored by leonardchan on Feb 7 2022, 4:08 PM.

Diff Detail

Event Timeline

leonardchan created this revision.Feb 7 2022, 4:08 PM
leonardchan requested review of this revision.Feb 7 2022, 4:08 PM
mcgrathr added inline comments.Feb 7 2022, 4:10 PM
clang/lib/Driver/ToolChains/Fuchsia.cpp
129–130

I think all these runtime additions need to be conditional. There must be no kinds of implicit link inputs at all when using -nostdlib.
I'm not sure what matters or doesn't wrt their relative order vs AddLinkerInputs.

mcgrathr added inline comments.Feb 7 2022, 4:13 PM
clang/lib/Driver/ToolChains/Fuchsia.cpp
153–156

This function is a no-op because it tests for fuchsia targets. So it probably makes more sense not to call it and to remove its fuchsia special-case.

leonardchan marked 2 inline comments as done.
phosek added a comment.Feb 7 2022, 6:58 PM

Have you checked if all the tests are still passing?

clang/lib/Driver/ToolChains/Fuchsia.cpp
162

This shouldn't move, these are linker inputs provided by the used and should be always passed to the linker.

leonardchan marked an inline comment as done.

Have you checked if all the tests are still passing?

All the clang tests seem to be passing, but I'll run the llvm and runtimes tests also.

phosek accepted this revision.Feb 8 2022, 9:50 AM

LGTM

clang/lib/Driver/ToolChains/Fuchsia.cpp
158–160

I think this can be dropped as well.

This revision is now accepted and ready to land.Feb 8 2022, 9:50 AM
This revision was landed with ongoing or failed builds.Feb 8 2022, 10:53 AM
This revision was automatically updated to reflect the committed changes.
leonardchan marked an inline comment as done.