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-3233] Demands -Xlinker invocation even though modulemap already contains it #5172

Closed
swift-ci opened this issue Nov 17, 2016 · 3 comments
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-3233
Radar None
Original Reporter s1ddok (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: e311f70b79f2bf96b2c2df894d8f10f0

duplicates:

Issue Description:

During the conversion of my project, I created a repository for libpng.

As documentation of SwiftPM suggests, you have to add custom module.modulemap in include folder, if you have custom include layout. As I only need one header to be exported, I had to it. I also included

link "z"

in that modulemap as libpng depends on it, but compilation fails with "undefined symbols" error. -Xlinker -lz solves the issue.

@ddunbar
Copy link
Member

ddunbar commented Nov 18, 2016

Can you reference a test package showing the problem, and a full build log?

@ankitspd
Copy link
Member

This is the package: https://github.com/s1ddok/Cpng

After creating a system-module package for zlib I ran into two problems:

  1. We don't pass pkgConfig for Clang Modules ([Build] Pass pkgconfig args when compiling ClangModule #810
  2. We don't pass modulemaps of system packages to clang using -fmodule-map-file. Even after passing the modulemap file the autolinking doesn't work i.e. clang should link "z" automatically but it doesn't (unlike swiftc)

modulemap cz [system] {
link "z"
}

@ankitspd
Copy link
Member

ankitspd commented Mar 8, 2017

2. will be solved with build settings.

@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

3 participants