Skip to content

Fix Solaris buildbot #145737

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

Merged

Conversation

sivadeilra
Copy link
Contributor

#145565 broke the Solaris buildbot, due to a subtlety in how command-lines are parsed, which is different between Windows and non-Windows platforms. The fix is to use -- to force passing the rest of args without interpretation. This is similar to existing tests for %clang_cl, such as clang/test/CodeGen/debug-info-codeview-buildinfo.c.

Currently, CI jobs for PRs do not detect this problem. Fixing that is tracked in issue #145713.

@llvmbot llvmbot added clang Clang issues not falling into any other category backend:X86 labels Jun 25, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 25, 2025

@llvm/pr-subscribers-backend-x86

Author: None (sivadeilra)

Changes

#145565 broke the Solaris buildbot, due to a subtlety in how command-lines are parsed, which is different between Windows and non-Windows platforms. The fix is to use -- to force passing the rest of args without interpretation. This is similar to existing tests for %clang_cl, such as clang/test/CodeGen/debug-info-codeview-buildinfo.c.

Currently, CI jobs for PRs do not detect this problem. Fixing that is tracked in issue #145713.


Full diff: https://github.com/llvm/llvm-project/pull/145737.diff

6 Files Affected:

  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch.c (+1-1)
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c b/clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c
index 839dd44f7ff61..7c8c7d590060d 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c
@@ -3,7 +3,7 @@
 // This verifies that we correctly handle a -fms-secure-hotpatch-functions-file argument that points
 // to a missing file.
 //
-// RUN: not %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%S/this-file-is-intentionally-missing-do-not-create-it.txt /Fo%t.obj %s 2>&1 | FileCheck %s
+// RUN: not %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%S/this-file-is-intentionally-missing-do-not-create-it.txt /Fo%t.obj -- %s 2>&1 | FileCheck %s
 // CHECK: failed to open hotpatch functions file
 
 void this_might_have_side_effects();
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp b/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp
index 3dc75c95d76f7..24e1c2937baac 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp
@@ -3,7 +3,7 @@
 // This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ,
 // and that name mangling works as expected.
 //
-// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=?this_gets_hotpatched@@YAHXZ /Fo%t.obj %s
+// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=?this_gets_hotpatched@@YAHXZ /Fo%t.obj -- %s
 // RUN: llvm-readobj --codeview %t.obj | FileCheck %s
 
 void this_might_have_side_effects();
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp b/clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp
index 69704626c8cb6..66fbc3a950bbf 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp
@@ -2,7 +2,7 @@
 
 // Global constant data such as exception handler tables should not be redirected by Windows Secure Hot-Patching
 //
-// RUN: %clang_cl -c --target=x86_64-windows-msvc /EHsc -O2 -fms-secure-hotpatch-functions-list=this_gets_hotpatched /Fo%t.obj /clang:-S /clang:-o- %s 2>& 1 | FileCheck %s
+// RUN: %clang_cl -c --target=x86_64-windows-msvc /EHsc -O2 -fms-secure-hotpatch-functions-list=this_gets_hotpatched /Fo%t.obj /clang:-S /clang:-o- -- %s 2>& 1 | FileCheck %s
 
 class Foo {
 public:
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c b/clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c
index d76d2aa6d8acc..ff3a1a47288a6 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c
@@ -4,7 +4,7 @@
 //
 // RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 \
 // RUN:   -fms-secure-hotpatch-functions-list=hp1,hp2,hp3,hp4,hp5_phi_ptr_mixed,hp_phi_ptr_both,hp_const_ptr_sub \
-// RUN:   /clang:-S /clang:-o- %s | FileCheck %s
+// RUN:   /clang:-S /clang:-o- -- %s | FileCheck %s
 
 #ifdef __clang__
 #define NO_TAIL __attribute__((disable_tail_calls))
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c b/clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c
index 6adb0b1818e31..cbf19adb4739f 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c
@@ -2,7 +2,7 @@
 
 // This verifies that hotpatch function attributes are correctly propagated through LLVM IR when compiling with LTO.
 //
-// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=this_gets_hotpatched -flto /Fo%t.bc %s
+// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=this_gets_hotpatched -flto /Fo%t.bc -- %s
 // RUN: llvm-dis %t.bc -o - | FileCheck %s
 //
 // CHECK-LABEL: define dso_local noundef i32 @this_gets_hotpatched()
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch.c b/clang/test/CodeGen/X86/ms-secure-hotpatch.c
index b829e5acc5c83..9bc8c2cf364bf 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch.c
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch.c
@@ -3,7 +3,7 @@
 // This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ.
 //
 // RUN: echo this_gets_hotpatched > %t.patch-functions.txt
-// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%t.patch-functions.txt /Fo%t.obj %s
+// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%t.patch-functions.txt /Fo%t.obj -- %s
 // RUN: llvm-readobj --codeview %t.obj | FileCheck %s
 
 void this_might_have_side_effects();

@llvmbot
Copy link
Member

llvmbot commented Jun 25, 2025

@llvm/pr-subscribers-clang

Author: None (sivadeilra)

Changes

#145565 broke the Solaris buildbot, due to a subtlety in how command-lines are parsed, which is different between Windows and non-Windows platforms. The fix is to use -- to force passing the rest of args without interpretation. This is similar to existing tests for %clang_cl, such as clang/test/CodeGen/debug-info-codeview-buildinfo.c.

Currently, CI jobs for PRs do not detect this problem. Fixing that is tracked in issue #145713.


Full diff: https://github.com/llvm/llvm-project/pull/145737.diff

6 Files Affected:

  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c (+1-1)
  • (modified) clang/test/CodeGen/X86/ms-secure-hotpatch.c (+1-1)
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c b/clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c
index 839dd44f7ff61..7c8c7d590060d 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c
@@ -3,7 +3,7 @@
 // This verifies that we correctly handle a -fms-secure-hotpatch-functions-file argument that points
 // to a missing file.
 //
-// RUN: not %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%S/this-file-is-intentionally-missing-do-not-create-it.txt /Fo%t.obj %s 2>&1 | FileCheck %s
+// RUN: not %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%S/this-file-is-intentionally-missing-do-not-create-it.txt /Fo%t.obj -- %s 2>&1 | FileCheck %s
 // CHECK: failed to open hotpatch functions file
 
 void this_might_have_side_effects();
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp b/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp
index 3dc75c95d76f7..24e1c2937baac 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp
@@ -3,7 +3,7 @@
 // This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ,
 // and that name mangling works as expected.
 //
-// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=?this_gets_hotpatched@@YAHXZ /Fo%t.obj %s
+// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=?this_gets_hotpatched@@YAHXZ /Fo%t.obj -- %s
 // RUN: llvm-readobj --codeview %t.obj | FileCheck %s
 
 void this_might_have_side_effects();
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp b/clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp
index 69704626c8cb6..66fbc3a950bbf 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp
@@ -2,7 +2,7 @@
 
 // Global constant data such as exception handler tables should not be redirected by Windows Secure Hot-Patching
 //
-// RUN: %clang_cl -c --target=x86_64-windows-msvc /EHsc -O2 -fms-secure-hotpatch-functions-list=this_gets_hotpatched /Fo%t.obj /clang:-S /clang:-o- %s 2>& 1 | FileCheck %s
+// RUN: %clang_cl -c --target=x86_64-windows-msvc /EHsc -O2 -fms-secure-hotpatch-functions-list=this_gets_hotpatched /Fo%t.obj /clang:-S /clang:-o- -- %s 2>& 1 | FileCheck %s
 
 class Foo {
 public:
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c b/clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c
index d76d2aa6d8acc..ff3a1a47288a6 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c
@@ -4,7 +4,7 @@
 //
 // RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 \
 // RUN:   -fms-secure-hotpatch-functions-list=hp1,hp2,hp3,hp4,hp5_phi_ptr_mixed,hp_phi_ptr_both,hp_const_ptr_sub \
-// RUN:   /clang:-S /clang:-o- %s | FileCheck %s
+// RUN:   /clang:-S /clang:-o- -- %s | FileCheck %s
 
 #ifdef __clang__
 #define NO_TAIL __attribute__((disable_tail_calls))
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c b/clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c
index 6adb0b1818e31..cbf19adb4739f 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c
@@ -2,7 +2,7 @@
 
 // This verifies that hotpatch function attributes are correctly propagated through LLVM IR when compiling with LTO.
 //
-// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=this_gets_hotpatched -flto /Fo%t.bc %s
+// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=this_gets_hotpatched -flto /Fo%t.bc -- %s
 // RUN: llvm-dis %t.bc -o - | FileCheck %s
 //
 // CHECK-LABEL: define dso_local noundef i32 @this_gets_hotpatched()
diff --git a/clang/test/CodeGen/X86/ms-secure-hotpatch.c b/clang/test/CodeGen/X86/ms-secure-hotpatch.c
index b829e5acc5c83..9bc8c2cf364bf 100644
--- a/clang/test/CodeGen/X86/ms-secure-hotpatch.c
+++ b/clang/test/CodeGen/X86/ms-secure-hotpatch.c
@@ -3,7 +3,7 @@
 // This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ.
 //
 // RUN: echo this_gets_hotpatched > %t.patch-functions.txt
-// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%t.patch-functions.txt /Fo%t.obj %s
+// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%t.patch-functions.txt /Fo%t.obj -- %s
 // RUN: llvm-readobj --codeview %t.obj | FileCheck %s
 
 void this_might_have_side_effects();

@sivadeilra sivadeilra force-pushed the user/ardavis/hotpatch-fix-solaris-buildbot branch from 79d1d1a to 731e940 Compare June 25, 2025 18:05
@dpaoliello dpaoliello merged commit 7aeb1a1 into llvm:main Jun 25, 2025
7 checks passed
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
llvm#145565 broke the Solaris buildbot, due to a subtlety in how
command-lines are parsed, which is different between Windows and
non-Windows platforms. The fix is to use `--` to force passing the rest
of args without interpretation. This is similar to existing tests for
`%clang_cl`, such as
`clang/test/CodeGen/debug-info-codeview-buildinfo.c`.

Currently, CI jobs for PRs do not detect this problem. Fixing that is
tracked in issue llvm#145713.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants