Skip to content

Commit 5af19b7

Browse files
committed
Make some foss compatibility improvements
1 parent 8111462 commit 5af19b7

34 files changed

+319
-48
lines changed

ape/sections.internal.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#ifndef COSMOPOLITAN_APE_SECTIONS_INTERNAL_H_
2+
#define COSMOPOLITAN_APE_SECTIONS_INTERNAL_H_
3+
#if !(__ASSEMBLER__ + __LINKER__ + 0)
4+
COSMOPOLITAN_C_START_
5+
6+
extern unsigned char _base[];
7+
extern unsigned char _ehead[];
8+
extern unsigned char _etext[];
9+
extern unsigned char _edata[];
10+
extern unsigned char _ezip[];
11+
extern unsigned char _end[];
12+
extern unsigned char _ereal[];
13+
extern unsigned char __privileged_start[];
14+
extern unsigned char __privileged_addr[];
15+
extern unsigned char __privileged_size[];
16+
extern unsigned char __privileged_end[];
17+
extern unsigned char __test_start[];
18+
extern unsigned char __ro[];
19+
extern unsigned char *__relo_start[];
20+
extern unsigned char *__relo_end[];
21+
extern uint8_t __zip_start[];
22+
extern uint8_t __zip_end[];
23+
extern uint8_t __data_start[];
24+
extern uint8_t __data_end[];
25+
extern uint8_t __bss_start[];
26+
extern uint8_t __bss_end[];
27+
28+
COSMOPOLITAN_C_END_
29+
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
30+
#endif /* COSMOPOLITAN_APE_SECTIONS_INTERNAL_H_ */

examples/getrandom.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
88
╚─────────────────────────────────────────────────────────────────*/
99
#endif
10+
#include "ape/sections.internal.h"
1011
#include "libc/calls/calls.h"
1112
#include "libc/calls/struct/sigaction.h"
1213
#include "libc/errno.h"

examples/nomodifyself.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
88
╚─────────────────────────────────────────────────────────────────*/
99
#endif
10+
#include "ape/sections.internal.h"
1011
#include "libc/dce.h"
1112
#include "libc/runtime/runtime.h"
1213
#include "libc/stdio/stdio.h"

libc/calls/__sig2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
1717
│ PERFORMANCE OF THIS SOFTWARE. │
1818
╚─────────────────────────────────────────────────────────────────────────────*/
19+
#include "ape/sections.internal.h"
1920
#include "libc/assert.h"
2021
#include "libc/calls/calls.h"
2122
#include "libc/calls/sig.internal.h"

libc/calls/openat-metal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
1717
│ PERFORMANCE OF THIS SOFTWARE. │
1818
╚─────────────────────────────────────────────────────────────────────────────*/
19+
#include "ape/sections.internal.h"
1920
#include "libc/calls/internal.h"
2021
#include "libc/calls/metalfile.internal.h"
2122
#include "libc/intrin/weaken.h"

libc/calls/pledge-linux.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
1717
│ PERFORMANCE OF THIS SOFTWARE. │
1818
╚─────────────────────────────────────────────────────────────────────────────*/
19+
#include "ape/sections.internal.h"
1920
#include "libc/calls/calls.h"
2021
#include "libc/calls/pledge.internal.h"
2122
#include "libc/calls/struct/bpf.h"

libc/calls/sigenter-freebsd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
1717
│ PERFORMANCE OF THIS SOFTWARE. │
1818
╚─────────────────────────────────────────────────────────────────────────────*/
19+
#include "ape/sections.internal.h"
1920
#include "libc/calls/calls.h"
2021
#include "libc/calls/internal.h"
2122
#include "libc/calls/state.internal.h"

libc/calls/sigenter-netbsd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
1717
│ PERFORMANCE OF THIS SOFTWARE. │
1818
╚─────────────────────────────────────────────────────────────────────────────*/
19+
#include "ape/sections.internal.h"
1920
#include "libc/calls/calls.h"
2021
#include "libc/calls/internal.h"
2122
#include "libc/calls/state.internal.h"

libc/calls/sigenter-openbsd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
1717
│ PERFORMANCE OF THIS SOFTWARE. │
1818
╚─────────────────────────────────────────────────────────────────────────────*/
19+
#include "ape/sections.internal.h"
1920
#include "libc/calls/calls.h"
2021
#include "libc/calls/internal.h"
2122
#include "libc/calls/state.internal.h"

libc/calls/sigenter-xnu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
1717
│ PERFORMANCE OF THIS SOFTWARE. │
1818
╚─────────────────────────────────────────────────────────────────────────────*/
19+
#include "ape/sections.internal.h"
1920
#include "libc/calls/calls.h"
2021
#include "libc/calls/internal.h"
2122
#include "libc/calls/state.internal.h"

0 commit comments

Comments
 (0)