Author: Tuur Martens
Date: 2026-08-28T23:54:40-07:00
New Revision: ec53c6ead45cbdaf778f0404ceb462988e54fde3

URL: 
https://github.com/llvm/llvm-project/commit/ec53c6ead45cbdaf778f0404ceb462988e54fde3
DIFF: 
https://github.com/llvm/llvm-project/commit/ec53c6ead45cbdaf778f0404ceb462988e54fde3.diff

LOG: [clang] Fix --entry command line option (#69114)

Fixes: #68355

Added: 
    

Modified: 
    clang/include/clang/Options/Options.td
    clang/test/Driver/linker-opts.c

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Options/Options.td 
b/clang/include/clang/Options/Options.td
index c383265e9f092..d4faaaeaf0b43 100644
--- a/clang/include/clang/Options/Options.td
+++ b/clang/include/clang/Options/Options.td
@@ -1689,7 +1689,7 @@ def emit_pretty_sgf: Flag<["--"], "pretty-sgf">,
 def emit_sgf_symbol_labels_for_testing: Flag<["--"], 
"emit-sgf-symbol-labels-for-testing">,
    Visibility<[CC1Option]>,
    MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraphSymbolLabelsForTesting">>;
-def e : Separate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
+def e : JoinedOrSeparate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
 def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>,
   Visibility<[ClangOption, CC1Option]>,
   HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
@@ -7057,7 +7057,8 @@ def _dyld_prefix_EQ : Joined<["--"], "dyld-prefix=">;
 def _dyld_prefix : Separate<["--"], "dyld-prefix">, Alias<_dyld_prefix_EQ>;
 def _encoding_EQ : Joined<["--"], "encoding=">, Alias<fencoding_EQ>;
 def _encoding : Separate<["--"], "encoding">, Alias<fencoding_EQ>;
-def _entry : Flag<["--"], "entry">, Alias<e>;
+def : Joined<["--"], "entry=">, Alias<e>;
+def : Separate<["--"], "entry">, Alias<e>;
 def _extdirs_EQ : Joined<["--"], "extdirs=">, Alias<fextdirs_EQ>;
 def _extdirs : Separate<["--"], "extdirs">, Alias<fextdirs_EQ>;
 def _extra_warnings : Flag<["--"], "extra-warnings">, Alias<W_Joined>;

diff  --git a/clang/test/Driver/linker-opts.c b/clang/test/Driver/linker-opts.c
index 181aeadb8dc97..a2939cb1708a7 100644
--- a/clang/test/Driver/linker-opts.c
+++ b/clang/test/Driver/linker-opts.c
@@ -20,3 +20,9 @@
 // Make sure that we do warn in other cases.
 // RUN: %clang %s -lfoo -c -o %t/tmp2.o -### 2>&1 | FileCheck %s 
--check-prefix=UNUSED
 // UNUSED: warning:{{.*}}unused
+
+// Make sure -e and its aliases --entry and --entry= are properly passed on.
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu --entry test %s 2>&1 | 
FileCheck --check-prefix=ENTRY %s
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu --entry=test %s 2>&1 | 
FileCheck --check-prefix=ENTRY %s
+
+// ENTRY: "-e" "test"


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to