File tree Expand file tree Collapse file tree 10 files changed +104
-2
lines changed Expand file tree Collapse file tree 10 files changed +104
-2
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,15 @@ set(TARGET_PUBLIC_HEADERS
2
2
libc.include.assert
3
3
libc.include.ctype
4
4
libc.include.dlfcn
5
+ libc.include.elf
5
6
libc.include.errno
6
7
libc.include.features
7
8
libc.include.fenv
8
9
libc.include.float
9
10
libc.include.stdint
10
11
libc.include.inttypes
11
12
libc.include.limits
13
+ libc.include.link
12
14
libc.include.math
13
15
libc.include.pthread
14
16
libc.include.signal
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ set(TARGET_PUBLIC_HEADERS
3
3
libc.include.ctype
4
4
libc.include.dirent
5
5
libc.include.dlfcn
6
+ libc.include.elf
6
7
libc.include.errno
7
8
libc.include.fcntl
8
9
libc.include.features
@@ -11,6 +12,7 @@ set(TARGET_PUBLIC_HEADERS
11
12
libc.include.stdint
12
13
libc.include.inttypes
13
14
libc.include.limits
15
+ libc.include.link
14
16
libc.include.math
15
17
libc.include.pthread
16
18
libc.include.sched
Original file line number Diff line number Diff line change @@ -420,6 +420,23 @@ add_header_macro(
420
420
.llvm-libc-types.posix_spawn_file_actions_t
421
421
)
422
422
423
+ add_gen_header (
424
+ link
425
+ DEF_FILE link.h.def
426
+ GEN_HDR link.h
427
+ DEPENDS
428
+ .llvm_libc_common_h
429
+ .llvm-libc-macros.link_macros
430
+ )
431
+
432
+ add_gen_header (
433
+ elf
434
+ DEF_FILE elf.h.def
435
+ GEN_HDR elf.h
436
+ DEPENDS
437
+ .llvm-libc-macros.elf_macros
438
+ )
439
+
423
440
# TODO: Not all platforms will have a include/sys directory. Add the sys
424
441
# directory and the targets for sys/*.h files conditional to the OS requiring
425
442
# them.
Original file line number Diff line number Diff line change
1
+ //===-- System V header elf.h ---------------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_ELF_H
10
+ #define LLVM_LIBC_ELF_H
11
+
12
+ #include "__llvm-libc-common.h"
13
+ #include "llvm-libc-macros/elf-macros.h"
14
+
15
+ %%public_api()
16
+
17
+ #endif // LLVM_LIBC_ELF_H
Original file line number Diff line number Diff line change
1
+ //===-- GNU header link.h -------------------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_LINK_H
10
+ #define LLVM_LIBC_LINK_H
11
+
12
+ #include "__llvm-libc-common.h"
13
+ #include "llvm-libc-macros/link-macros.h"
14
+
15
+ %%public_api()
16
+
17
+ #endif // LLVM_LIBC_LINK_H
Original file line number Diff line number Diff line change @@ -289,3 +289,9 @@ add_macro_header(
289
289
HDR
290
290
dlfcn-macros.h
291
291
)
292
+
293
+ add_macro_header (
294
+ elf_macros
295
+ HDR
296
+ elf-macros.h
297
+ )
Original file line number Diff line number Diff line change
1
+ //===-- Definition of macros from elf.h -----------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_MACROS_ELF_MACROS_H
10
+ #define LLVM_LIBC_MACROS_ELF_MACROS_H
11
+
12
+ #if __has_include (< linux /elf .h > )
13
+ #include <linux/elf.h>
14
+ #else
15
+ #error "cannot use <sys/elf.h> without proper system headers."
16
+ #endif
17
+
18
+ #endif // LLVM_LIBC_MACROS_ELF_MACROS_H
Original file line number Diff line number Diff line change 6
6
//
7
7
//===----------------------------------------------------------------------===//
8
8
9
+ #ifndef LLVM_LIBC_MACROS_LINK_MACROS_H
10
+ #define LLVM_LIBC_MACROS_LINK_MACROS_H
11
+
12
+ #include "elf-macros.h"
13
+
9
14
#ifdef __LP64__
10
- #define ElfW (type ) Elf64_ ## type
15
+ #define ElfW (type ) Elf64_## type
11
16
#else
12
- #define ElfW (type ) Elf32_ ## type
17
+ #define ElfW (type ) Elf32_##type
18
+ #endif
19
+
13
20
#endif
Original file line number Diff line number Diff line change
1
+ header : elf.h
2
+ standards :
3
+ - Linux
4
+ macros : []
5
+ types : []
6
+ enums : []
7
+ objects : []
8
+ functions : []
Original file line number Diff line number Diff line change
1
+ header : link.h
2
+ standards :
3
+ - Linux
4
+ macros : []
5
+ types : []
6
+ enums : []
7
+ objects : []
8
+ functions : []
You can’t perform that action at this time.
0 commit comments