Skip to content
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

Using -g for non-macho targets can cause driver planning errors #1570

Open
rauhul opened this issue Mar 25, 2024 · 1 comment
Open

Using -g for non-macho targets can cause driver planning errors #1570

rauhul opened this issue Mar 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rauhul
Copy link
Member

rauhul commented Mar 25, 2024

Building a binary for -target armv7em-none-none-eabi with -o and -emit-module works if -g is not specified.

Works:

Desktop xcrun --toolchain org.swift.59202403131a swiftc -target armv7em-none-none-eabi -c foo.swift -o foo.o -emit-module -wmo -enable-experimental-feature Embedded

Fails:

Desktop xcrun --toolchain org.swift.59202403131a swiftc -target armv7em-none-none-eabi -c foo.swift -o foo.o -emit-module -wmo -enable-experimental-feature Embedded -g
SwiftDriverExecution/MultiJobExecutor.swift:207: Fatal error: multiple producers for output foo.o: Wrapping Swift module foo & Compiling foo foo.swift
[1]    85772 trace trap  xcrun --toolchain org.swift.59202403131a swiftc -target armv7em-none-none-eab

Failing Frontend commands:

/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/bin/swift-frontend -frontend -c foo.swift -target armv7em-none-none-eabi -disable-objc-interop -sdk /Applications/XcodeGeode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -color-diagnostics -g -debug-info-format=dwarf -dwarf-version=4 -enable-experimental-feature Embedded -empty-abi-descriptor -resource-dir /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /Users/rauhul/Desktop -module-name foo -plugin-path /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/local/lib/swift/host/plugins -o foo.o
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types foo.swift -target armv7em-none-none-eabi -disable-objc-interop -sdk /Applications/XcodeGeode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -color-diagnostics -g -debug-info-format=dwarf -dwarf-version=4 -enable-experimental-feature Embedded -empty-abi-descriptor -resource-dir /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /Users/rauhul/Desktop -module-name foo -plugin-path /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/local/lib/swift/host/plugins -emit-module-doc-path foo.swiftdoc -emit-module-source-info-path foo.swiftsourceinfo -o foo.swiftmodule
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/bin/swift-frontend -modulewrap foo.swiftmodule -target armv7em-none-none-eabi -o foo.o
@rauhul rauhul added the bug Something isn't working label Mar 25, 2024
@hamishknight
Copy link
Contributor

Also fails without -g if the -o is for the module:

❯ ./swiftc -emit-module -c ~/src/swift-test-arena/swift-test-arena/main.swift -o /tmp/main.swiftmodule
SwiftDriverExecution/MultiJobExecutor.swift:207: Fatal error: multiple producers for output /tmp/main.swiftmodule: Compiling main main.swift & Emitting module for main

hamishknight added a commit to hamishknight/swift that referenced this issue Sep 22, 2024
hamishknight added a commit to swiftlang/swift that referenced this issue Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants