This is an archive of the discontinued LLVM Phabricator instance.

[HIP] add --offload-add-rpath
ClosedPublic

Authored by yaxunl on Oct 27 2022, 9:12 AM.

Details

Summary

Add an option --[no-]offload-add-rpath to control whether to
pass -rpath to linker for HIP runtime library. By default it
is off to match gcc/clang behavior for not adding -rpath
for runtime library by default.

Diff Detail

Event Timeline

yaxunl created this revision.Oct 27 2022, 9:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 9:12 AM
yaxunl requested review of this revision.Oct 27 2022, 9:12 AM
tra added inline comments.Oct 27 2022, 10:12 AM
clang/include/clang/Driver/Options.td
4156

This could be useful for CUDA, too. Perhaps it could use a more generic name like -foffload-add-rpath ?

I wonder if it should be just --offload-add-rpath, though given that we already using -f for the options with similar purpose, it would be OK, too.

4158

Any reason not to use BoolFOption instead of defining -fno... option separately?

If an option does not affect compilation, I prefer -- to -f

If an option does not affect compilation, I prefer -- to -f

I will rename it as --offload-add-rpath

clang/include/clang/Driver/Options.td
4158

BoolFOption seems to be associated with LangOpts or CodeGenOpts, but this one only affects the options passed to linker and does not have corresponding LangOpts or CodeGenOpts. This is similar to -frtlib-add-rpath.

yaxunl updated this revision to Diff 471289.Oct 27 2022, 1:58 PM

rename to --offload-add-rpath

yaxunl retitled this revision from [HIP] add -fhiplib-add-rpath to [HIP] add --offload-add-rpath.Oct 27 2022, 1:59 PM
yaxunl edited the summary of this revision. (Show Details)
tra accepted this revision.Oct 27 2022, 2:15 PM
This revision is now accepted and ready to land.Oct 27 2022, 2:15 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 8:43 AM