-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[flang][Driver] Support -Xlinker in flang #107472
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
Conversation
@llvm/pr-subscribers-flang-driver @llvm/pr-subscribers-clang Author: Tarun Prabhu (tarunprabhu) ChangesPartially addresses: #89888 Full diff: https://github.com/llvm/llvm-project/pull/107472.diff 2 Files Affected:
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 1b9b3f2c6600a3..136d979ed7200e 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1051,6 +1051,7 @@ def z : Separate<["-"], "z">, Flags<[LinkerInput]>,
def offload_link : Flag<["--"], "offload-link">, Group<Link_Group>,
HelpText<"Use the new offloading linker to perform the link job.">;
def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput, RenderAsInput]>,
+ Visibility<[ClangOption, CLOption, FlangOption, DXCOption]>,
HelpText<"Pass <arg> to the linker">, MetaVarName<"<arg>">,
Group<Link_Group>;
def Xoffload_linker : JoinedAndSeparate<["-"], "Xoffload-linker">,
diff --git a/flang/test/Driver/xlinker.f90 b/flang/test/Driver/xlinker.f90
new file mode 100644
index 00000000000000..8bb1f7e99ae238
--- /dev/null
+++ b/flang/test/Driver/xlinker.f90
@@ -0,0 +1,6 @@
+! RUN: %flang -### -o /dev/null %s -Xlinker -rpath=/not/a/real/path 2>&1 | FileCheck %s
+
+! CHECK: "-fc1"
+! CHECK-NEXT: "-rpath=/not/a/real/path"
+
+end program
|
…tances of -Xlinker options
…ensure that the passed arguments are present on that line. Test this for a variety of linkers and targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates. LGTM
Thanks for the reviews, Tom :-) |
Partially addresses: #89888