Skip to content

Conversation

@slydiman
Copy link
Contributor

Fixed the error unable to create target: 'No available targets are compatible with triple "x86_64-apple-macosx10.4.0"' running clang --target=x86_64-apple-macosx -c -gdwarf -o %t %s.

@llvmbot
Copy link
Member

llvmbot commented Oct 10, 2024

@llvm/pr-subscribers-lldb

Author: Dmitry Vasilyev (slydiman)

Changes

Fixed the error unable to create target: 'No available targets are compatible with triple "x86_64-apple-macosx10.4.0"' running clang --target=x86_64-apple-macosx -c -gdwarf -o %t %s.


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

1 Files Affected:

  • (modified) lldb/test/Shell/SymbolFile/DWARF/no_unique_address-with-bitfields.cpp (+2)
diff --git a/lldb/test/Shell/SymbolFile/DWARF/no_unique_address-with-bitfields.cpp b/lldb/test/Shell/SymbolFile/DWARF/no_unique_address-with-bitfields.cpp
index 980180e7be9aef..2d7316cf11bdc4 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/no_unique_address-with-bitfields.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/no_unique_address-with-bitfields.cpp
@@ -8,6 +8,8 @@
 // RUN:   -o "image dump ast" \
 // RUN:   -o exit | FileCheck %s
 
+// REQUIRES: system-darwin
+
 // CHECK:      (lldb) image dump ast
 // CHECK:      CXXRecordDecl {{.*}} struct Foo definition
 // CHECK:      |-FieldDecl {{.*}} data 'char[5]'

@labath
Copy link
Collaborator

labath commented Oct 11, 2024

Running on Darwin is not required for --target=x86_64-apple-macosx to work. What's required is that the X86 llvm target is configured. The right fix is to move this test into the x86 subdir.

Fixed the error `unable to create target: 'No available targets are compatible with triple "x86_64-apple-macosx10.4.0"'`.
@slydiman slydiman force-pushed the lldb-fix-no_unique_address-with-bitfields branch from 0bb01d3 to 7827659 Compare October 11, 2024 08:31
@slydiman
Copy link
Contributor Author

The right fix is to move this test into the x86 subdir.

Done.

@slydiman slydiman merged commit b222f31 into llvm:main Oct 11, 2024
7 checks passed
@Michael137
Copy link
Member

Can we do this for all the no_unique_address-... tests? Would be nice if they were all in the same place. I'm not sure I added --target in all of them, but probably should?

@labath
Copy link
Collaborator

labath commented Oct 14, 2024

I would recommend that -- then you wouldn't need to worry about how to spell [[no_unique_address]] on windows.

Michael137 added a commit to Michael137/llvm-project that referenced this pull request Oct 16, 2024
Follow up to llvm#111902.

Makes sure all the `no_unique_address` tests are in the same
place and we don't rely on the host compiler.

Now that we don't compile with the host compiler, this patch
also adds `-c` to the compilation command since we don't actually
need the linked binary in the test anyway (and on Darwin linking
through Clang requires the `xcrun` prefix to set up the SDK paths,
etc.). We already do this in `no_unique_address-with-bitfields.cpp`
anyway.
@Michael137
Copy link
Member

I would recommend that -- then you wouldn't need to worry about how to spell [[no_unique_address]] on windows.

#112523

Michael137 added a commit that referenced this pull request Oct 16, 2024
…tests (#112523)

Follow up to #111902.

Makes sure all the `no_unique_address` tests are in the same place and
we don't rely on the host target triple (which means we don't need to
account for `[[msvc::no_unique_address]]` on Windows).

Now that we don't compile with the host compiler, this patch also adds
`-c` to the compilation command since we don't actually need the linked
binary in the test anyway (and on Darwin linking through Clang requires
the `xcrun` prefix to set up the SDK paths, etc.). We already do this in
`no_unique_address-with-bitfields.cpp` anyway.
DanielCChen pushed a commit to DanielCChen/llvm-project that referenced this pull request Oct 16, 2024
…111902)

Fixed the error `unable to create target: 'No available targets are
compatible with triple "x86_64-apple-macosx10.4.0"'` running `clang
--target=x86_64-apple-macosx -c -gdwarf -o %t %s`.
@slydiman slydiman deleted the lldb-fix-no_unique_address-with-bitfields branch April 18, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants