Skip to content

Commit 3107f31

Browse files
authored
[Flang, Clang] Enable and test 'rdynamic' flag (#75598)
Enable and test 'rdynamic' flag
1 parent 2fe94ce commit 3107f31

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5308,7 +5308,8 @@ def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[NoXarchOption]>,
53085308
def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">,
53095309
Flags<[NoXarchOption]>,
53105310
HelpText<"Rewrite Legacy Objective-C source to C++">;
5311-
def rdynamic : Flag<["-"], "rdynamic">, Group<Link_Group>;
5311+
def rdynamic : Flag<["-"], "rdynamic">, Group<Link_Group>,
5312+
Visibility<[ClangOption, FlangOption]>;
53125313
def resource_dir : Separate<["-"], "resource-dir">,
53135314
Flags<[NoXarchOption, HelpHidden]>,
53145315
Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,

flang/test/Driver/dynamic-linker.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
! RUN: %flang -### --target=x86_64-windows-msvc -rpath /path/to/dir -shared \
88
! RUN: -static %s 2>&1 | FileCheck \
99
! RUN: --check-prefixes=MSVC-LINKER-OPTIONS %s
10+
! RUN: %flang -### --target=aarch64-linux-none -rdynamic %s 2>&1 | FileCheck --check-prefixes=RDYNAMIC-LINKER-OPTION %s
1011

1112
! TODO: Could the linker have an extension or a suffix?
1213
! GNU-LINKER-OPTIONS: "{{.*}}ld{{(.exe)?}}"
1314
! GNU-LINKER-OPTIONS-SAME: "-shared"
1415
! GNU-LINKER-OPTIONS-SAME: "-static"
1516
! GNU-LINKER-OPTIONS-SAME: "-rpath" "/path/to/dir"
1617

18+
! RDYNAMIC-LINKER-OPTION: "{{.*}}ld"
19+
! RDYNAMIC-LINKER-OPTION-SAME: "-export-dynamic"
20+
1721
! For MSVC, adding -static does not add any additional linker options.
1822
! MSVC-LINKER-OPTIONS: "{{.*}}link{{(.exe)?}}"
1923
! MSVC-LINKER-OPTIONS-SAME: "-dll"

0 commit comments

Comments
 (0)