Skip to content

Can not build swift-nio example NIOUDPEchoServer with --experimental-lto-mode=full #6888

@fabianfett

Description

@fabianfett

Description

I tried to build the NIOUDPEchoServer with lto enabled.

Expected behavior

NIOUDPEchoServer can be build in release mode with full lto optimization.

Actual behavior

[root@10f889c21a1b src]# swift run -c release --static-swift-stdlib --experimental-lto-mode=full NIOUDPEchoServer
Building for production...
error: autolink-extract command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: error opening input file '/src/.build/aarch64-unknown-linux-gnu/release/CNIOAtomics.build/src/c-atomics.c.o' (The file was not recognized as a valid object file
)
error: fatalError
[1/2] Linking NIOUDPEchoServer

Steps to reproduce

  1. Checkout NIO (git clone --depth 1 https://github.com/apple/swift-nio.git)
  2. Run inside the package swift run -c release --static-swift-stdlib --experimental-lto-mode=full NIOUDPEchoServer

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

[root@10f889c21a1b src]# swift --version ; uname -a
Swift version 5.9-dev (LLVM 50c867d95965de6, Swift ca3e3aa237df721)
Target: aarch64-unknown-linux-gnu
Linux 10f889c21a1b 5.15.111 #2 SMP Mon May 15 16:54:21 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions