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

glibc warnings compiling for 5.9-RELEASE_ubuntu_jammy_aarch64 #12

Open
rvsrvs opened this issue Sep 23, 2023 · 5 comments
Open

glibc warnings compiling for 5.9-RELEASE_ubuntu_jammy_aarch64 #12

rvsrvs opened this issue Sep 23, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@rvsrvs
Copy link

rvsrvs commented Sep 23, 2023

I've created a simple helloworld tool, and compiling it generates warning messages that seem to be spurious. Here's the project structure:

./Package.swift
./Sources/helloworld/main.swift
./Tests/LinuxMain.swift
./Tests/helloworldTests/helloworldTests.swift
./Tests/helloworldTests/XCTestManifests.swift

Package consists of:

// swift-tools-version:5.9
import PackageDescription

let package = Package(
    name: "helloworld",
    dependencies: [],
    targets: [
        .executableTarget(
            name: "helloworld",
            dependencies: []
        ),
        .testTarget(
            name: "helloworldTests",
            dependencies: ["helloworld"]
        ),
    ]
)

main.swift consists of:

print("Successful launch!")

This produces the following output:

swift build --experimental-swift-sdk 5.9-RELEASE_ubuntu_jammy_aarch64
Building for debugging...
warning: Could not read SDKSettings.json for SDK at: /Users/rvs/Library/org.swift.swiftpm/swift-sdks/5.9-RELEASE_ubuntu_jammy_aarch64.artifactbundle/5.9-RELEASE_ubuntu_jammy_aarch64/aarch64-unknown-linux-gnu/ubuntu-jammy.sdk
<unknown>:0: warning: glibc not found for 'aarch64-unknown-linux-gnu'; C stdlib may be unavailable
<unknown>:0: warning: glibc not found for 'aarch64-unknown-linux-gnu'; C stdlib may be unavailable
warning: Could not read SDKSettings.json for SDK at: /Users/rvs/Library/org.swift.swiftpm/swift-sdks/5.9-RELEASE_ubuntu_jammy_aarch64.artifactbundle/5.9-RELEASE_ubuntu_jammy_aarch64/aarch64-unknown-linux-gnu/ubuntu-jammy.sdk
[5/5] Linking helloworld
Build complete! (9.02s)

The glibc warnings seem to be spurious.

@Diggory
Copy link

Diggory commented Sep 24, 2023

Did you mean main.c or was that a typo?

@rvsrvs
Copy link
Author

rvsrvs commented Sep 25, 2023

sorry main.swift. will fix

@MaxDesiatov
Copy link
Member

MaxDesiatov commented Sep 25, 2023

Also tracked as rdar://115492638

@MaxDesiatov MaxDesiatov added the bug Something isn't working label Sep 25, 2023
@fwcd
Copy link

fwcd commented Oct 24, 2023

I've been having similar issues with my manually configured cross-compilation build where

swift build --sdk <path/to/sysroot>

no longer works as expected in 5.9. Swift neither seems to find libc nor any other libraries in the sysroot. For a full log, see e.g. this failed build (I prepare a sysroot in the first Docker stage, then copy it over into /usr/local/<targetarch>-ubuntu-jammy and point --sdk to this sysroot, along with some flags for the C/C++ compilers).

Would of course be nice to migrate over to the new SDK bundles once the Ubuntu host -> Ubuntu target scenario is properly supported, but I assume this is still a regression.

@rvsrvs
Copy link
Author

rvsrvs commented Nov 12, 2023

This has gotten much worse in 5.9.1, now I get a ton of the following warnings:

clang-13: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
warning: Could not read SDKSettings.json for SDK at: /Users/____/Library/org.swift.swiftpm/swift-sdks/5.9.1-RELEASE_ubuntu_jammy_x86_64.artifactbundle/5.9.1-RELEASE_ubuntu_jammy_x86_64/x86_64-unknown-linux-gnu/ubuntu-jammy.sdk
<unknown>:0: warning: glibc not found for 'x86_64-unknown-linux-gnu'; C stdlib may be unavailable

The good news is that then after dozens of each of the above, I get:

[798/798] Linking echoserver
Build complete! (19.56s)

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

4 participants