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-15] Glibc module doesn't work with Gentoo: prefix is /usr/include/sys, not /usr/include/x86_64-linux-gnu/sys #42638

Closed
octoploid mannequin opened this issue Dec 3, 2015 · 11 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Linux Platform: Linux

Comments

@octoploid
Copy link
Mannequin

octoploid mannequin commented Dec 3, 2015

Previous ID SR-15
Radar None
Original Reporter @octoploid
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s
Labels Bug, Linux
Assignee @bitjammer
Priority Medium

md5: d5a5cc8c191684fcb73a1cae75fc477f

Issue Description:

stdlib/public/Glibc/module.map contains hardcoded paths to glibc headers.
On my system all "module sys" paths are wrong, e.g.:

header "/usr/include/x86_64-linux-gnu/sys/ipc.h"
lives in /usr/include/sys/ipc.h on my system.

@tkremenek
Copy link
Member

What Linux distribution/version/configuration are you using?

@tkremenek
Copy link
Member

Also, are you using the pre-built binaries, or rolling your own from sources?

@octoploid
Copy link
Mannequin Author

octoploid mannequin commented Dec 3, 2015

I'm rolling my own from sources.
My guess is that many distros, that don't use the weird Debian/Ubuntu layout,
might be affected by this issue.
I use Gentoo for example.

@tkremenek
Copy link
Member

I suspect we will need some build-time configuration logic to figure out the right locations and generate the module map.

@swift-ci
Copy link
Collaborator

swift-ci commented Dec 5, 2015

Comment by James Laver (JIRA)

I'm also a gentoo user and I've worked around this for now by symlinking /usr/include/x86-64-linux-gnu to /usr/include, if that helps other people in the meantime.

@bitjammer
Copy link
Member

Great - thank you for noting the workaround for others.

@swift-ci
Copy link
Collaborator

swift-ci commented Dec 8, 2015

Comment by Manolo van Ee (JIRA)

This will be fixed by pull request 282:
#282

@swift-ci
Copy link
Collaborator

Comment by William Casarin (JIRA)

This still doesn't fix the module map on NixOS, I'm getting this error:

<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h"
         ^
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h:25:10: error: 'features.h' file not found with <angled> include; use "quotes" instead
#include <features.h>
         ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h"
         ^
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h:25:10: note: in file included from /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h:25:
#include <features.h>
         ^
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/features.h:343:10: error: 'stdc-predef.h' file not found with <angled> include; use "quotes" instead
#include <stdc-predef.h>
         ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h"
         ^
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h:25:10: note: in file included from /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h:25:
#include <features.h>
         ^
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/features.h:365:12: error: 'sys/cdefs.h' file not found with <angled> include; use "quotes" instead
#  include <sys/cdefs.h>
           ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h"
         ^
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h:25:10: note: in file included from /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/complex.h:25:
#include <features.h>
         ^
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/features.h:365:12: note: in file included from /nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/features.h:365:
#  include <sys/cdefs.h>
           ^
/nix/store/hd6km3hscbgl2yw8nx7lr5z9s8h89p04-glibc-2.21/include/sys/cdefs.h:402:10: error: 'bits/wordsize.h' file not found
#include <bits/wordsize.h>
         ^
/home/jb55/dev/swift/swift/stdlib/public/Glibc/Glibc.swift:13:19: error: could not build Objective-C module 'SwiftGlibc'
@_exported import SwiftGlibc // Clang module
                  ^
[470/487] Compiling /home/jb55/dev/swift/Ninja-ReleaseA...stdlib/private/SwiftPrivate/linux/x86_64/SwiftPrivate.o
ninja: build stopped: subcommand failed

any ideas?

@swift-ci
Copy link
Collaborator

Comment by Manolo van Ee (JIRA)

I've got no experience with NixOS, but I can give it a try. I assume you changed the following line in stdlib/public/Glibc/CMakeLists.txt:
set(GLIBC_INCLUDE_PATH "/usr/include")

Is that correct?

@swift-ci
Copy link
Collaborator

Comment by William Casarin (JIRA)

Yeah I did, it looks like the library path just wasn't set up in my build properly. Sorry for the noise.

@swift-ci
Copy link
Collaborator

Comment by Manolo van Ee (JIRA)

Set to resolved.
Fixed by pull request 282.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Linux Platform: Linux
Projects
None yet
Development

No branches or pull requests

3 participants