Skip to content

Commit 73bd558

Browse files
committed
[stdlib] Modulemap for libc on OpenBSD.
Provide a separate modulemap for OpenBSD's libc, rather than try to continue to overload the modulemap for glibc, since glibc has its own idiosyncracies.
1 parent 5847726 commit 73bd558

File tree

2 files changed

+313
-0
lines changed

2 files changed

+313
-0
lines changed

stdlib/public/Platform/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ foreach(sdk ${SWIFT_SDKS})
8080

8181
if(${sdk} STREQUAL ANDROID)
8282
set(glibc_modulemap_source "bionic.modulemap.gyb")
83+
elseif(${sdk} STREQUAL OPENBSD)
84+
set(glibc_modulemap_source "libc-openbsd.modulemap.gyb")
8385
else()
8486
set(glibc_modulemap_source "glibc.modulemap.gyb")
8587
endif()
Lines changed: 311 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,311 @@
1+
//===--- libc-openbsd.modulemap.gyb ----------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
/// Partial modulemap for libc on OpenBSD.
14+
module SwiftGlibc [system] {
15+
link "pthread"
16+
link "util"
17+
18+
// C standard library
19+
module C {
20+
module complex {
21+
header "${GLIBC_INCLUDE_PATH}/complex.h"
22+
export *
23+
}
24+
module ctype {
25+
header "${GLIBC_INCLUDE_PATH}/ctype.h"
26+
export *
27+
}
28+
module errno {
29+
header "${GLIBC_INCLUDE_PATH}/errno.h"
30+
export *
31+
}
32+
module fenv {
33+
header "${GLIBC_INCLUDE_PATH}/fenv.h"
34+
export *
35+
}
36+
module inttypes {
37+
header "${GLIBC_INCLUDE_PATH}/inttypes.h"
38+
export *
39+
}
40+
module locale {
41+
header "${GLIBC_INCLUDE_PATH}/locale.h"
42+
export *
43+
}
44+
module math {
45+
link "m"
46+
header "${GLIBC_INCLUDE_PATH}/math.h"
47+
export *
48+
}
49+
module setjmp {
50+
header "${GLIBC_INCLUDE_PATH}/setjmp.h"
51+
export *
52+
}
53+
module signal {
54+
header "${GLIBC_INCLUDE_PATH}/signal.h"
55+
export *
56+
}
57+
58+
module stdio {
59+
header "${GLIBC_INCLUDE_PATH}/stdio.h"
60+
export *
61+
}
62+
module stdlib {
63+
header "${GLIBC_INCLUDE_PATH}/stdlib.h"
64+
export *
65+
export stddef
66+
}
67+
module string {
68+
header "${GLIBC_INCLUDE_PATH}/string.h"
69+
export *
70+
}
71+
module time {
72+
header "${GLIBC_INCLUDE_PATH}/time.h"
73+
export *
74+
}
75+
}
76+
77+
// POSIX
78+
module POSIX {
79+
module cpio {
80+
header "${GLIBC_INCLUDE_PATH}/cpio.h"
81+
export *
82+
}
83+
module nl_types {
84+
header "${GLIBC_INCLUDE_PATH}/nl_types.h"
85+
export *
86+
}
87+
module ftw {
88+
header "${GLIBC_INCLUDE_PATH}/ftw.h"
89+
export *
90+
}
91+
module glob {
92+
header "${GLIBC_INCLUDE_PATH}/glob.h"
93+
export *
94+
}
95+
module langinfo {
96+
header "${GLIBC_INCLUDE_PATH}/langinfo.h"
97+
export *
98+
}
99+
module netdb {
100+
header "${GLIBC_INCLUDE_PATH}/netdb.h"
101+
export *
102+
}
103+
module ifaddrs {
104+
header "${GLIBC_INCLUDE_PATH}/ifaddrs.h"
105+
export *
106+
}
107+
module search {
108+
header "${GLIBC_INCLUDE_PATH}/search.h"
109+
export *
110+
}
111+
module spawn {
112+
header "${GLIBC_INCLUDE_PATH}/spawn.h"
113+
export *
114+
}
115+
module syslog {
116+
header "${GLIBC_INCLUDE_PATH}/syslog.h"
117+
export *
118+
}
119+
module tar {
120+
header "${GLIBC_INCLUDE_PATH}/tar.h"
121+
export *
122+
}
123+
module utmp {
124+
header "${GLIBC_INCLUDE_PATH}/utmp.h"
125+
export *
126+
}
127+
module arpa {
128+
module inet {
129+
header "${GLIBC_INCLUDE_PATH}/arpa/inet.h"
130+
export *
131+
}
132+
export *
133+
}
134+
module dirent {
135+
header "${GLIBC_INCLUDE_PATH}/dirent.h"
136+
export *
137+
}
138+
module dl {
139+
header "${GLIBC_INCLUDE_PATH}/link.h"
140+
export *
141+
}
142+
module dlfcn {
143+
header "${GLIBC_INCLUDE_PATH}/dlfcn.h"
144+
export *
145+
}
146+
module fcntl {
147+
header "${GLIBC_INCLUDE_PATH}/fcntl.h"
148+
export *
149+
}
150+
module fnmatch {
151+
header "${GLIBC_INCLUDE_PATH}/fnmatch.h"
152+
export *
153+
}
154+
module grp {
155+
header "${GLIBC_INCLUDE_PATH}/grp.h"
156+
export *
157+
}
158+
module ioctl {
159+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/ioctl.h"
160+
export *
161+
}
162+
module libgen {
163+
header "${GLIBC_INCLUDE_PATH}/libgen.h"
164+
export *
165+
}
166+
module net {
167+
module if {
168+
header "${GLIBC_INCLUDE_PATH}/net/if.h"
169+
export *
170+
}
171+
}
172+
module netinet {
173+
module in {
174+
header "${GLIBC_INCLUDE_PATH}/netinet/in.h"
175+
export *
176+
177+
exclude header "${GLIBC_INCLUDE_PATH}/netinet6/in6.h"
178+
}
179+
module tcp {
180+
header "${GLIBC_INCLUDE_PATH}/netinet/tcp.h"
181+
export *
182+
}
183+
}
184+
module poll {
185+
header "${GLIBC_INCLUDE_PATH}/poll.h"
186+
export *
187+
}
188+
module pthread {
189+
header "${GLIBC_INCLUDE_PATH}/pthread.h"
190+
export *
191+
}
192+
module pwd {
193+
header "${GLIBC_INCLUDE_PATH}/pwd.h"
194+
export *
195+
}
196+
module regex {
197+
header "${GLIBC_INCLUDE_PATH}/regex.h"
198+
export *
199+
}
200+
module sched {
201+
header "${GLIBC_INCLUDE_PATH}/sched.h"
202+
export *
203+
}
204+
module semaphore {
205+
header "${GLIBC_INCLUDE_PATH}/semaphore.h"
206+
export *
207+
}
208+
module strings {
209+
header "${GLIBC_INCLUDE_PATH}/strings.h"
210+
export *
211+
}
212+
213+
module sys {
214+
export *
215+
216+
module file {
217+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/file.h"
218+
export *
219+
}
220+
module sem {
221+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/sem.h"
222+
export *
223+
}
224+
module shm {
225+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/shm.h"
226+
export *
227+
}
228+
module statvfs {
229+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/statvfs.h"
230+
export *
231+
}
232+
module ipc {
233+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/ipc.h"
234+
export *
235+
}
236+
module mman {
237+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/mman.h"
238+
export *
239+
}
240+
module msg {
241+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/msg.h"
242+
export *
243+
}
244+
module resource {
245+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/resource.h"
246+
export *
247+
}
248+
module select {
249+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/select.h"
250+
export *
251+
}
252+
module socket {
253+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/socket.h"
254+
export *
255+
}
256+
module stat {
257+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/stat.h"
258+
export *
259+
}
260+
module time {
261+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/time.h"
262+
export *
263+
}
264+
module times {
265+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/times.h"
266+
export *
267+
}
268+
module types {
269+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/types.h"
270+
export *
271+
}
272+
module event {
273+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/event.h"
274+
export *
275+
}
276+
module uio {
277+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/uio.h"
278+
export *
279+
}
280+
module un {
281+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/un.h"
282+
export *
283+
}
284+
module user {
285+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/user.h"
286+
export *
287+
}
288+
module utsname {
289+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/utsname.h"
290+
export *
291+
}
292+
module wait {
293+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/wait.h"
294+
export *
295+
}
296+
}
297+
module termios {
298+
header "${GLIBC_INCLUDE_PATH}/termios.h"
299+
export *
300+
}
301+
module unistd {
302+
header "${GLIBC_INCLUDE_PATH}/unistd.h"
303+
export *
304+
}
305+
}
306+
}
307+
308+
module CUUID [system] {
309+
header "${GLIBC_INCLUDE_PATH}/uuid.h"
310+
export *
311+
}

0 commit comments

Comments
 (0)