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

[SR-5005] Swift build with -whole-module-optimization crashes following normal build #5006

Closed
tayloraswift opened this issue May 24, 2017 · 1 comment
Labels

Comments

@tayloraswift
Copy link

Previous ID SR-5005
Radar None
Original Reporter @Kelvin13
Type Bug
Status Closed
Resolution Duplicate

Attachment: Download

Environment

Ubuntu 17.04, swift-3.1-dev trunk, also tested on swift-3.1-RELEASE

Additional Detail from JIRA
Votes 0
Component/s Compiler, Package Manager
Labels Bug
Assignee None
Priority Medium

md5: f915ca50c26844dbc38d839cdeeb927e

duplicates:

  • SR-5004 Swift build with -whole-module-optimization fails

Issue Description:

When a swift build -Xswiftc -whole-module-optimization follows a normal, successful swift build, the compiler starts interpreting "unresolved identifier"s and dumps gibberish

/home/kelvin/sandbox/swift/wmo/.build/debug/wmo.build/main.swift.o:1:112: warning: integer literal is unused
HJHUD��HE��HuHHHNHEHUHM��H�}�HuLMHUL��LUHML��I��LMHEH$1H��P]�Hello, World!SR���<��CaT��-lswiftCore-lswiftSwiftOnoneSupportSwift version 3.1 (swift-3.1-RELEASE)/home/kelvin/sandbox/swift/wmo/Sources/main.swift/home/kelvin/sandbox/swift/wmo-emit-object /home/kelvin/sandbox/swift/wmo/Sources/main.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/kelvin/sandbox/swift/wmo/.build/debug -enable-testing -g -module-cache-path /home/kelvin/sandbox/swift/wmo/.build/debug/ModuleCache -D SWIFT_PACKAGE -emit-module-doc-path /home/kelvin/sandbox/swift/wmo/.build/debug/wmo.swiftdoc -Onone -module-name wmo -emit-module-path /home/kelvin/sandbox/swift/wmo/.build/debug/wmo.swiftmodule -emit-dependencies-path /home/kelvin/sandbox/swift/wmo/.build/debug/wmo.build/main.swift.d -num-threads 8 -o /home/kelvin/sandbox/swift/wmo/.build/debug/wmo.build/main.swift.o -resource-dir /home/kelvin/devtools/swift-3.1-RELEASE/usr/lib/swiftwmo/home/kelvin/sandbox/swift/wmo/SourcesSwift/home/kelvin/devtools/swift-3.1-RELEASE/usr/lib/swift/linux/x86_64/Swift.swiftmoduleclang version 4.0.0 (git@github.com:apple/swift-clang.git 9772bf511a32353fad73e38fdfc501d5fccb50d2) (git@github.com:apple/swift-llvm.git a7c680da5182d29e2c6441d484a307b695902c64)<swift-imported-modules>mainInt32_TtVs5Int32%��
                                                                                 �|.@n:
                                                                                                      ;
                                                                                                       I?::
     ;
      n

           �
            :%�t��Vf/]
                                               HSAH
                                                      j�|,8HSAH
                                                                     ����HSAH
                                                                                  ����HSAHBf
/home/kelvin/sandbox/swift/wmo/.build/debug/wmo.build/main.swift.o:1:114: error: use of unresolved identifier 'H'
HJHUD��HE��HuHHHNHEHUHM��H�}�HuLMHUL��LUHML��I��LMHEH$1H��P]�Hello, World!SR���<��CaT��-lswiftCore

A simple test case is attached.

Related: https://bugs.swift.org/browse/SR-5004

@belkadan
Copy link

I don't think you can just add -whole-module-optimization using -Xswiftc. The package manager has to know about it to link your project correctly. Right, @aciidb0mb3r?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants