Embedded Swift Build Errors

I am trying to build the esp32-led-blink-sdk example and am hitting some errors. (Note: I am able to build a non-swift example project using idf).

I am using:

idf.py --version
ESP-IDF v6.1-dev-931-g683ddf8a6e
swift --version
Apple Swift version 6.2-dev (LLVM c38ce79b011b115, Swift 3803158def380fc)
Target: arm64-apple-macosx26.0
Build config: +assertions

I run idf.py set-target esp32c6 followed by idf.py build .

The output from idf.py build shows:

[1/10] Building Swift Module '__idf_main' with 2 sources
FAILED: [code=1] esp-idf/main/__idf_main.swiftmodule esp-idf/main/CMakeFiles/__idf_main.dir/Main.swift.obj esp-idf/main/CMakeFiles/__idf_main.dir/Led.swift.obj 
/Users/jon/.swiftly/bin/swiftc -j 10 -num-threads 10 ...

error: unknown argument: '-mabi=ilp32'

Appears that the swiftc command is failing because it doesn't like the argument -mabi=ilp32. I am sure I don't have something setup properly. Any help is appreciated.

1 Like

I was able to resolve my issue.

For anyone else that hits this, the issue was the version of ESP-IDF ESP-IDF v6.1-dev-931-g683ddf8a6e. I reinstalled ESP-IDF to version ESP-IDF v5.5.1 and it is working.

1 Like