# \#clang

**URL:** https://forums.swift.org/tag/clang/247.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [How to enable new CPU architectures for Swift?](https://forums.swift.org/t/how-to-enable-new-cpu-architectures-for-swift/87736)

<div class="topic-metadata">

**Author:** [@ColemanCDA](https://forums.swift.org/u/ColemanCDA)\
**Replies:** 2\
**Last updated:** [June 26, 2026, 5:22pm UTC](https://forums.swift.org/t/how-to-enable-new-cpu-architectures-for-swift/87736 "2026-06-26T17:22:32Z")

</div>

I am creating this post to document my experience trying to enable additional CPU architectures for Swift since 2022, and to request clarification or guidelines for future development. Back in 2022, as part of my Swift …

---

## [Swift main toolchain missing LLVM realtime sanitizer libraries](https://forums.swift.org/t/swift-main-toolchain-missing-llvm-realtime-sanitizer-libraries/82820)

<div class="topic-metadata">

**Author:** [@jcavar](https://forums.swift.org/u/jcavar)\
**Replies:** 1\
**Last updated:** [March 19, 2026, 8:31am UTC](https://forums.swift.org/t/swift-main-toolchain-missing-llvm-realtime-sanitizer-libraries/82820 "2026-03-19T08:31:33Z")

</div>

I am not sure if this is the right place to ask this question. Please redirect me if not. I downloaded the latest main Swift toolchain (org.swift.62202510171a) and tried to compile a simple C++ program with the new LLVM…

---

## [Xcode fails to build app for testing when depending on transient Swift Packages](https://forums.swift.org/t/xcode-fails-to-build-app-for-testing-when-depending-on-transient-swift-packages/83665)

<div class="topic-metadata">

**Author:** [@cmitteldorf](https://forums.swift.org/u/cmitteldorf)\
**Replies:** 0\
**Last updated:** [December 11, 2025, 3:38am UTC](https://forums.swift.org/t/xcode-fails-to-build-app-for-testing-when-depending-on-transient-swift-packages/83665 "2025-12-11T03:38:09Z")

</div>

Hello team! We have had a curious problem in the past few days where Xcode fails to build our app for testing when depending on transient Swift Packages. When building for testing, our project fails with error: "clang: …

---

## [How to use system libraries in a Clang target?](https://forums.swift.org/t/how-to-use-system-libraries-in-a-clang-target/81371)

<div class="topic-metadata">

**Author:** [@Lancelotbronner](https://forums.swift.org/u/Lancelotbronner)\
**Replies:** 0\
**Last updated:** [July 29, 2025, 1:57pm UTC](https://forums.swift.org/t/how-to-use-system-libraries-in-a-clang-target/81371 "2025-07-29T13:57:05Z")

</div>

I have a Swift target RaylibKit wrapping a C library target raylib which depends on a system library X11. I can make the system target and use it in Swift but raylib still can't find the headers (or PC file). Here's the…

---

## [Swift/C++ interoperability: SWIFT\_PRIVATE\_ATTR compilation error on Ubuntu](https://forums.swift.org/t/swift-c-interoperability-swift-private-attr-compilation-error-on-ubuntu/71461)

<div class="topic-metadata">

**Author:** [@tony-go](https://forums.swift.org/u/tony-go)\
**Replies:** 7\
**Last updated:** [February 15, 2025, 9:06pm UTC](https://forums.swift.org/t/swift-c-interoperability-swift-private-attr-compilation-error-on-ubuntu/71461 "2025-02-15T21:06:33Z")

</div>

Hi There :wave: I'm trying to tame Swift and C++ interoperability with CMake. On macOS, everything works fine, but I have an issue on Ubuntu: \[3/4\] /usr/bin/clang++-15 -I/home/runner/work/eat-swift-from-cpp/eat-swift…

---

## [Can't get c++ library to use the correct compiler](https://forums.swift.org/t/cant-get-c-library-to-use-the-correct-compiler/73573)

<div class="topic-metadata">

**Author:** [@hbaker](https://forums.swift.org/u/hbaker)\
**Replies:** 2\
**Last updated:** [August 1, 2024, 1:57pm UTC](https://forums.swift.org/t/cant-get-c-library-to-use-the-correct-compiler/73573 "2024-08-01T13:57:16Z")

</div>

I’m trying to use a system library written in C++ in my swift app on linux. Every time I try to build I get an error saying that the header “functional” does not exist. I’ve made a simple example package with a c++ modul…

---

## [Code compiles but fails with non-Apple compiler](https://forums.swift.org/t/code-compiles-but-fails-with-non-apple-compiler/70484)

<div class="topic-metadata">

**Author:** [@RandomHashTags](https://forums.swift.org/u/RandomHashTags)\
**Replies:** 2\
**Last updated:** [March 7, 2024, 4:42am UTC](https://forums.swift.org/t/code-compiles-but-fails-with-non-apple-compiler/70484 "2024-03-07T04:42:37Z")

</div>

Some code in one of my projects has a significant performance regression and outright fails (compiles, no errors) when using clang 16.0.6 (arch linux & raspberry pi os), but works as expected when running on dev machine …

---

## [Getting a better understanding of how the swift calling convention impacts the AVR ABI](https://forums.swift.org/t/getting-a-better-understanding-of-how-the-swift-calling-convention-impacts-the-avr-abi/69397)

<div class="topic-metadata">

**Author:** [@carlos42421](https://forums.swift.org/u/carlos42421)\
**Replies:** 3\
**Last updated:** [January 13, 2024, 3:07am UTC](https://forums.swift.org/t/getting-a-better-understanding-of-how-the-swift-calling-convention-impacts-the-avr-abi/69397 "2024-01-13T03:07:23Z")

</div>

Hi, I've prodded around at this topic with PRs and discussions to do with calling conventions generally and the SwiftABIInfo in clang, but I realised I didn't really understand it properly. I wanted to ask some basic que…

---

## [Error: file not found with \<angled\> include; use "quotes" instead](https://forums.swift.org/t/error-file-not-found-with-angled-include-use-quotes-instead/69310)

<div class="topic-metadata">

**Author:** [@felixfxu](https://forums.swift.org/u/felixfxu)\
**Replies:** 0\
**Last updated:** [January 7, 2024, 3:02am UTC](https://forums.swift.org/t/error-file-not-found-with-angled-include-use-quotes-instead/69310 "2024-01-07T03:02:01Z")

</div>

Hi, I'm using swift 5.9.1 on Windows and trying with swift package manger to create a clang module, but I'm having a strange error: error file not found with \<angled\> include; use "quotes" instead I uploaed my project…

---

## [128bit types on Windows](https://forums.swift.org/t/128bit-types-on-windows/65013)

<div class="topic-metadata">

**Author:** [@STREGAsGate](https://forums.swift.org/u/STREGAsGate)\
**Replies:** 6\
**Last updated:** [December 4, 2023, 3:27pm UTC](https://forums.swift.org/t/128bit-types-on-windows/65013 "2023-12-04T15:27:44Z")

</div>

I need to use C++ on Windows to do Audio without distributing a binary as there is no supported C API. When trying to use WinSDK.DirectX.XAudio29 (XAudio.h) a shared header is imported containing 128 bit suffixes that S…

---

## [Definition of clang's Default Flags](https://forums.swift.org/t/definition-of-clangs-default-flags/67840)

<div class="topic-metadata">

**Author:** [@thekief](https://forums.swift.org/u/thekief)\
**Replies:** 0\
**Last updated:** [October 13, 2023, 2:43pm UTC](https://forums.swift.org/t/definition-of-clangs-default-flags/67840 "2023-10-13T14:43:00Z")

</div>

I am currently debugging some stuff and I noticed that on macOS the clang version provided by Xcode has quite a lot of flags set by default. For example, following flags are set by default: ... -Wno-reorder-init-list \\…

---

## [Need help with SwiftPM Clang search paths](https://forums.swift.org/t/need-help-with-swiftpm-clang-search-paths/62566)

<div class="topic-metadata">

**Author:** [@STREGAsGate](https://forums.swift.org/u/STREGAsGate)\
**Replies:** 1\
**Last updated:** [January 15, 2023, 1:04am UTC](https://forums.swift.org/t/need-help-with-swiftpm-clang-search-paths/62566 "2023-01-15T01:04:19Z")

</div>

I'm trying to modify some of my C/C++ packages to use git submodules and not change any source code to make them more maintainable. I have a package that is made up of several repositories and I'm having trouble getting…

---

## [Can CF\_RETURNS\_RETAINED be used on C function pointer return values bridged to Swift?](https://forums.swift.org/t/can-cf-returns-retained-be-used-on-c-function-pointer-return-values-bridged-to-swift/53079)

<div class="topic-metadata">

**Author:** [@vanvoorden](https://forums.swift.org/u/vanvoorden)\
**Replies:** 0\
**Last updated:** [October 26, 2021, 9:33pm UTC](https://forums.swift.org/t/can-cf-returns-retained-be-used-on-c-function-pointer-return-values-bridged-to-swift/53079 "2021-10-26T21:33:25Z")

</div>

https://developer.apple.com/documentation/swift/imported\_c\_and\_objective-c\_apis/working\_with\_core\_foundation\_types If we define a C function that returns a CFType, Swift can (sometimes) bridge the memory management sema…

---

## [Importing a function with a struct ret seems to produce invalid code](https://forums.swift.org/t/importing-a-function-with-a-struct-ret-seems-to-produce-invalid-code/52086)

<div class="topic-metadata">

**Author:** [@carlos42421](https://forums.swift.org/u/carlos42421)\
**Replies:** 3\
**Last updated:** [September 16, 2021, 11:24am UTC](https://forums.swift.org/t/importing-a-function-with-a-struct-ret-seems-to-produce-invalid-code/52086 "2021-09-16T11:24:24Z")

</div>

I'm not sure exactly what is causing the problem (swift, the clang importer or the llvm back end) in my case, but somehow a call to a C function that returns a struct is not lowering correctly. In my imported C header, …

---

## [Weak-linking in Swift Package Manager (plugin architecture)](https://forums.swift.org/t/weak-linking-in-swift-package-manager-plugin-architecture/49821)

<div class="topic-metadata">

**Author:** [@WilsonGramer](https://forums.swift.org/u/WilsonGramer)\
**Replies:** 5\
**Last updated:** [August 23, 2021, 6:57am UTC](https://forums.swift.org/t/weak-linking-in-swift-package-manager-plugin-architecture/49821 "2021-08-23T06:57:09Z")

</div>

I'm implementing a project that uses a plugin architecture, where plugins are shared libraries (.dylibs/.sos) that are dynamically loaded at runtime using dlopen. I want to distribute the main ("host") application as a s…

---

## [Bug/limitation in clang importer with typecast #defines](https://forums.swift.org/t/bug-limitation-in-clang-importer-with-typecast-defines/39421)

<div class="topic-metadata">

**Author:** [@carlos42421](https://forums.swift.org/u/carlos42421)\
**Replies:** 8\
**Last updated:** [August 17, 2020, 8:54am UTC](https://forums.swift.org/t/bug-limitation-in-clang-importer-with-typecast-defines/39421 "2020-08-17T08:54:17Z")

</div>

It looks to me like there is a limitation in the clang importer when importing simple constants defined like #define X\_STD\_SIZE 78. If they are typecast like this... #define X\_STD\_SIZE (char)78 ...then it works fine b…

---

## [\[ClangImporter\] what compiler code effects the mapping of C types to stdlib types?](https://forums.swift.org/t/clangimporter-what-compiler-code-effects-the-mapping-of-c-types-to-stdlib-types/38186)

<div class="topic-metadata">

**Author:** [@carlos42421](https://forums.swift.org/u/carlos42421)\
**Replies:** 7\
**Last updated:** [July 5, 2020, 11:25pm UTC](https://forums.swift.org/t/clangimporter-what-compiler-code-effects-the-mapping-of-c-types-to-stdlib-types/38186 "2020-07-05T23:25:48Z")

</div>

I'm having some unusual results with the ClangImporter. This declaration... #define uint32 unsigned long void \_setupSerial(uint32 baudRate); Seems to be read wrong by my ClangImporter. Compiling this function... pub…

---

## [Clang API Notes JSON schema](https://forums.swift.org/t/clang-api-notes-json-schema/36884)

<div class="topic-metadata">

**Author:** [@Stuart\_Carnie](https://forums.swift.org/u/Stuart_Carnie)\
**Replies:** 0\
**Last updated:** [May 26, 2020, 2:31pm UTC](https://forums.swift.org/t/clang-api-notes-json-schema/36884 "2020-05-26T14:31:59Z")

</div>

Hi all, I created a gist which includes a complete definition of the schema for .apinotes files. Some IDEs will validate on the fly and also provide auto-completion. Hope it is helpful to others. Cheers, Stuart

---

## [Embedding libswiftFrontEnd](https://forums.swift.org/t/embedding-libswiftfrontend/33437)

<div class="topic-metadata">

**Author:** [@tdermendjiev](https://forums.swift.org/u/tdermendjiev)\
**Replies:** 0\
**Last updated:** [February 4, 2020, 8:56pm UTC](https://forums.swift.org/t/embedding-libswiftfrontend/33437 "2020-02-04T20:56:26Z")

</div>

I am building a command line tool in C++ which I need to link against libswiftFrontEnd (and not only). Of course it depends on other libraries that are not linked so I am getting "Undefined symbols..." error. Is there so…

---

## [Swift build problem x86\_64, arm64, arm7 (Swift 5.1)](https://forums.swift.org/t/swift-build-problem-x86-64-arm64-arm7-swift-5-1/27595)

<div class="topic-metadata">

**Author:** [@SpectralDragon](https://forums.swift.org/u/SpectralDragon)\
**Replies:** 2\
**Last updated:** [August 4, 2019, 9:28pm UTC](https://forums.swift.org/t/swift-build-problem-x86-64-arm64-arm7-swift-5-1/27595 "2019-08-04T21:28:40Z")

</div>

When I trying build swift, I got the next error message: Undefined symbols for architecture x86\_64: "\_\_\_isOSVersionAtLeast", referenced from: swift::initializeProtocolLookup() in ImageInspectionMachO.cpp.o …

---

## [Swift 5.1 toolchain failure on ppc64le ubuntu 16.04](https://forums.swift.org/t/swift-5-1-toolchain-failure-on-ppc64le-ubuntu-16-04/26063)

<div class="topic-metadata">

**Author:** [@stamba](https://forums.swift.org/u/stamba)\
**Replies:** 1\
**Last updated:** [July 2, 2019, 5:08pm UTC](https://forums.swift.org/t/swift-5-1-toolchain-failure-on-ppc64le-ubuntu-16-04/26063 "2019-07-02T17:08:16Z")

</div>

The following command to build swift 5.1 toolchain is failing on ubuntu 16.04 on powerpc64le:- ./swift/utils/build-toolchain swift\_toolchain\_ppc64le Following is the failure part:- ./utils/build-script: note: Using to…

---

## [Root cause of "Umbrella header for module ... does not include"?](https://forums.swift.org/t/root-cause-of-umbrella-header-for-module-does-not-include/24063)

<div class="topic-metadata">

**Author:** [@cconway](https://forums.swift.org/u/cconway)\
**Replies:** 2\
**Last updated:** [May 2, 2019, 4:36pm UTC](https://forums.swift.org/t/root-cause-of-umbrella-header-for-module-does-not-include/24063 "2019-05-02T16:36:57Z")

</div>

I couldn't find any prior threads that matched my situation and I know this is more of a Clang question but my issue is while trying to integrate with a Swift project so I'm giving it a shot. I am getting "Umbrella head…
