@zigc/lib 0.16.0-dev.3013 → 0.16.0-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/compiler/build_runner.zig +10 -5
- package/libc/darwin/SDKSettings.json +1 -1
- package/libc/darwin/libSystem.tbd +357 -427
- package/libc/freebsd/lib/csu/aarch64/crt.h +1 -0
- package/libc/freebsd/lib/csu/aarch64/crt1_c.c +33 -0
- package/libc/freebsd/lib/csu/aarch64/crt1_s.S +68 -0
- package/libc/freebsd/lib/csu/amd64/crt.h +30 -0
- package/libc/freebsd/lib/csu/amd64/crt1_c.c +30 -0
- package/libc/freebsd/lib/csu/amd64/crt1_s.S +86 -0
- package/libc/freebsd/lib/csu/arm/crt.h +1 -0
- package/libc/freebsd/lib/csu/arm/crt1_c.c +79 -0
- package/libc/freebsd/lib/csu/arm/crt1_s.S +77 -0
- package/libc/freebsd/lib/csu/common/crtbegin.c +54 -0
- package/libc/freebsd/lib/csu/common/crtbrand.S +55 -0
- package/libc/freebsd/lib/csu/common/csu_common.h +50 -0
- package/libc/freebsd/lib/csu/common/feature_note.S +47 -0
- package/libc/freebsd/lib/csu/common/ignore_init_note.S +48 -0
- package/libc/freebsd/lib/csu/common/notes.h +32 -0
- package/libc/freebsd/lib/csu/i386/crt.h +30 -0
- package/libc/freebsd/lib/csu/i386/crt1_c.c +30 -0
- package/libc/freebsd/lib/csu/i386/crt1_s.S +91 -0
- package/libc/freebsd/lib/csu/powerpc/crt.h +30 -0
- package/libc/freebsd/lib/csu/powerpc/crt1_c.c +89 -0
- package/libc/freebsd/lib/csu/powerpc/crtsavres.S +189 -0
- package/libc/freebsd/lib/csu/powerpc64/crt.h +30 -0
- package/libc/freebsd/lib/csu/powerpc64/crt1_c.c +83 -0
- package/libc/freebsd/lib/csu/riscv/crt.h +8 -0
- package/libc/freebsd/lib/csu/riscv/crt1_c.c +51 -0
- package/libc/freebsd/lib/csu/riscv/crt1_s.S +51 -0
- package/libc/freebsd/lib/libc/include/libc_private.h +386 -0
- package/libc/include/any-darwin-any/AssertMacros.h +1 -1
- package/libc/include/any-darwin-any/AvailabilityInternal.h +10 -10
- package/libc/include/any-darwin-any/AvailabilityInternalLegacy.h +1 -1
- package/libc/include/any-darwin-any/AvailabilityVersions.h +16 -0
- package/libc/include/any-darwin-any/TargetConditionals.h +5 -21
- package/libc/include/any-darwin-any/_regex.h +11 -3
- package/libc/include/any-darwin-any/copyfile.h +1 -0
- package/libc/include/any-darwin-any/dirent.h +32 -2
- package/libc/include/any-darwin-any/dispatch/base.h +8 -0
- package/libc/include/any-darwin-any/dispatch/dispatch_swift_shims.h +4 -2
- package/libc/include/any-darwin-any/dispatch/once.h +2 -1
- package/libc/include/any-darwin-any/dispatch/workloop.h +2 -0
- package/libc/include/any-darwin-any/glob.h +7 -5
- package/libc/include/any-darwin-any/mach/arm/_structs.h +1 -0
- package/libc/include/any-darwin-any/mach/arm/exception.h +1 -0
- package/libc/include/any-darwin-any/mach/arm/thread_status.h +1 -1
- package/libc/include/any-darwin-any/mach/kern_return.h +4 -0
- package/libc/include/any-darwin-any/mach/mach_host.h +52 -2
- package/libc/include/any-darwin-any/mach/mach_traps.h +5 -1
- package/libc/include/any-darwin-any/mach/mach_types.h +4 -0
- package/libc/include/any-darwin-any/mach/mach_voucher_types.h +9 -0
- package/libc/include/any-darwin-any/mach/machine.h +1 -0
- package/libc/include/any-darwin-any/mach/message.h +21 -0
- package/libc/include/any-darwin-any/mach/port.h +48 -11
- package/libc/include/any-darwin-any/mach/thread_act.h +79 -2
- package/libc/include/any-darwin-any/mach/vm_map.h +54 -2
- package/libc/include/any-darwin-any/mach/vm_prot.h +0 -1
- package/libc/include/any-darwin-any/mach/vm_region.h +8 -0
- package/libc/include/any-darwin-any/mach/vm_statistics.h +39 -12
- package/libc/include/any-darwin-any/mach/vm_types.h +6 -0
- package/libc/include/any-darwin-any/mach-o/loader.h +3 -3
- package/libc/include/any-darwin-any/mach_debug/ipc_info.h +1 -0
- package/libc/include/any-darwin-any/malloc/malloc.h +0 -2
- package/libc/include/any-darwin-any/net/if_var.h +2 -2
- package/libc/include/any-darwin-any/signal.h +5 -2
- package/libc/include/any-darwin-any/simd/math.h +2 -2
- package/libc/include/any-darwin-any/sys/_symbol_aliasing.h +24 -0
- package/libc/include/any-darwin-any/sys/attr.h +5 -1
- package/libc/include/any-darwin-any/sys/fcntl.h +2 -0
- package/libc/include/any-darwin-any/sys/mman.h +3 -4
- package/libc/include/any-darwin-any/sys/paths.h +12 -9
- package/libc/include/any-darwin-any/sys/proc.h +2 -2
- package/libc/include/any-darwin-any/sys/sysctl.h +24 -20
- package/libc/include/any-darwin-any/unistd.h +2 -2
- package/libc/include/any-darwin-any/xpc/activity.h +7 -7
- package/libc/include/any-darwin-any/xpc/connection.h +15 -15
- package/libc/include/any-darwin-any/xpc/listener.h +2 -2
- package/libc/include/any-darwin-any/xpc/peer_requirement.h +13 -13
- package/libc/include/any-darwin-any/xpc/session.h +6 -6
- package/libc/include/any-darwin-any/xpc/xpc.h +14 -14
- package/libc/netbsd/lib/csu/arch/aarch64/crt0.S +45 -0
- package/libc/netbsd/lib/csu/arch/earm/crt0.S +61 -0
- package/libc/netbsd/lib/csu/arch/i386/crt0.S +48 -0
- package/libc/netbsd/lib/csu/arch/m68k/crt0.S +47 -0
- package/libc/netbsd/lib/csu/arch/mips/crt0.S +59 -0
- package/libc/netbsd/lib/csu/arch/powerpc/crt0.S +56 -0
- package/libc/netbsd/lib/csu/arch/sparc/crt0.S +55 -0
- package/libc/netbsd/lib/csu/arch/sparc64/crt0.S +59 -0
- package/libc/netbsd/lib/csu/arch/x86_64/crt0.S +48 -0
- package/libc/netbsd/lib/csu/common/crt0-common.c +351 -0
- package/libc/netbsd/lib/csu/common/crtbegin.c +135 -0
- package/libc/netbsd/lib/csu/common/csu-common.h +38 -0
- package/libc/netbsd/lib/csu/common/sysident.S +89 -0
- package/libc/netbsd/lib/csu/common/sysident_assym.h +17 -0
- package/libc/openbsd/lib/csu/aarch64/md_init.h +83 -0
- package/libc/openbsd/lib/csu/amd64/md_init.h +80 -0
- package/libc/openbsd/lib/csu/arm/md_init.h +112 -0
- package/libc/openbsd/lib/csu/crt0.c +76 -0
- package/libc/openbsd/lib/csu/crtbegin.c +61 -0
- package/libc/openbsd/lib/csu/extern.h +54 -0
- package/libc/openbsd/lib/csu/i386/md_init.h +83 -0
- package/libc/openbsd/lib/csu/mips64/md_init.h +127 -0
- package/libc/openbsd/lib/csu/os-note-elf.h +19 -0
- package/libc/openbsd/lib/csu/powerpc/md_init.h +80 -0
- package/libc/openbsd/lib/csu/powerpc64/md_init.h +75 -0
- package/libc/openbsd/lib/csu/riscv64/md_init.h +74 -0
- package/libc/openbsd/lib/csu/sparc64/md_init.h +85 -0
- package/package.json +2 -2
- package/std/Build/Step/Run.zig +4 -4
- package/std/Io/Dir.zig +122 -7
- package/std/Io/File.zig +6 -118
- package/std/Io/Kqueue.zig +1 -0
- package/std/Io/Threaded.zig +50 -46
- package/std/Io/Uring.zig +1 -0
- package/std/Io/net.zig +4 -0
- package/std/Io.zig +3 -3
- package/std/Target.zig +1 -1
- package/std/c.zig +2 -1
- package/std/http/Client.zig +3 -2
- package/std/tar.zig +76 -36
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* $OpenBSD: crtbegin.c,v 1.26 2019/01/09 16:42:38 visa Exp $ */
|
|
2
|
+
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 1993 Paul Kranenburg
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions
|
|
10
|
+
* are met:
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
12
|
+
* notice, this list of conditions and the following disclaimer.
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
* documentation and/or other materials provided with the distribution.
|
|
16
|
+
* 3. All advertising materials mentioning features or use of this software
|
|
17
|
+
* must display the following acknowledgement:
|
|
18
|
+
* This product includes software developed by Paul Kranenburg.
|
|
19
|
+
* 4. The name of the author may not be used to endorse or promote products
|
|
20
|
+
* derived from this software without specific prior written permission
|
|
21
|
+
*
|
|
22
|
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
23
|
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
24
|
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
25
|
+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
26
|
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
27
|
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
28
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
29
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
30
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
31
|
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* Run-time module for GNU C++ compiled shared libraries.
|
|
36
|
+
*
|
|
37
|
+
* The linker constructs the following arrays of pointers to global
|
|
38
|
+
* constructors and destructors. The first element contains the
|
|
39
|
+
* number of pointers in each.
|
|
40
|
+
* The tables are also null-terminated.
|
|
41
|
+
*/
|
|
42
|
+
#include <stdlib.h>
|
|
43
|
+
|
|
44
|
+
#include "md_init.h"
|
|
45
|
+
#include "os-note-elf.h"
|
|
46
|
+
#include "extern.h"
|
|
47
|
+
|
|
48
|
+
/* zig patch: no ctors/dtors and init/fini */
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
* Include support for the __cxa_atexit/__cxa_finalize C++ abi for
|
|
52
|
+
* gcc > 2.x. __dso_handle is NULL in the main program and a unique
|
|
53
|
+
* value for each C++ shared library. For more info on this API, see:
|
|
54
|
+
*
|
|
55
|
+
* http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
void *__dso_handle = NULL;
|
|
59
|
+
__asm(".hidden __dso_handle");
|
|
60
|
+
|
|
61
|
+
long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2004 Marc Espie <espie@openbsd.org>
|
|
3
|
+
*
|
|
4
|
+
* Permission to use, copy, modify, and distribute this software for any
|
|
5
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
6
|
+
* copyright notice and this permission notice appear in all copies.
|
|
7
|
+
*
|
|
8
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
9
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
10
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
11
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
12
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
13
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
14
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
void __init(void) __dso_hidden;
|
|
18
|
+
int main(int argc, char *argv[], char *envp[]);
|
|
19
|
+
|
|
20
|
+
typedef const void *dl_cb_cb(int);
|
|
21
|
+
typedef void (*initarray_f)(int, char **, char **, dl_cb_cb *);
|
|
22
|
+
typedef void (*init_f)(void);
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* Provide default implementations of these. Only archs with weird
|
|
26
|
+
* ASM stuff (hppa, arm) need to override them
|
|
27
|
+
*/
|
|
28
|
+
#ifndef MD_DATA_SECTION_FLAGS_SYMBOL
|
|
29
|
+
# ifdef __LP64__
|
|
30
|
+
# define VALUE_ALIGN ".balign 8"
|
|
31
|
+
# define VALUE_DIRECTIVE ".quad"
|
|
32
|
+
# else
|
|
33
|
+
# define VALUE_ALIGN ".balign 4"
|
|
34
|
+
# define VALUE_DIRECTIVE ".int"
|
|
35
|
+
# endif
|
|
36
|
+
# define MD_DATA_SECTION_FLAGS_SYMBOL(section, flags, type, symbol) \
|
|
37
|
+
extern __dso_hidden type symbol[]; \
|
|
38
|
+
__asm(" .section "section",\""flags"\",@progbits \n" \
|
|
39
|
+
" "VALUE_ALIGN" \n" \
|
|
40
|
+
#symbol": \n" \
|
|
41
|
+
" .previous")
|
|
42
|
+
# define MD_DATA_SECTION_SYMBOL_VALUE(section, type, symbol, value) \
|
|
43
|
+
extern __dso_hidden type symbol[]; \
|
|
44
|
+
__asm(" .section "section",\"aw\",@progbits \n" \
|
|
45
|
+
" "VALUE_ALIGN" \n" \
|
|
46
|
+
#symbol": \n" \
|
|
47
|
+
" "VALUE_DIRECTIVE" "#value" \n" \
|
|
48
|
+
" .previous")
|
|
49
|
+
# define MD_DATA_SECTION_FLAGS_VALUE(section, flags, value) \
|
|
50
|
+
__asm(" .section "section",\""flags"\",@progbits \n" \
|
|
51
|
+
" "VALUE_ALIGN" \n" \
|
|
52
|
+
" "VALUE_DIRECTIVE" "#value" \n" \
|
|
53
|
+
" .previous")
|
|
54
|
+
#endif
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* $OpenBSD: md_init.h,v 1.13 2023/11/18 16:26:16 deraadt Exp $ */
|
|
2
|
+
|
|
3
|
+
/*-
|
|
4
|
+
* Copyright (c) 2001 Ross Harvey
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions
|
|
9
|
+
* are met:
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
11
|
+
* notice, this list of conditions and the following disclaimer.
|
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
14
|
+
* documentation and/or other materials provided with the distribution.
|
|
15
|
+
* 3. All advertising materials mentioning features or use of this software
|
|
16
|
+
* must display the following acknowledgement:
|
|
17
|
+
* This product includes software developed by the NetBSD
|
|
18
|
+
* Foundation, Inc. and its contributors.
|
|
19
|
+
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
20
|
+
* contributors may be used to endorse or promote products derived
|
|
21
|
+
* from this software without specific prior written permission.
|
|
22
|
+
*
|
|
23
|
+
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
24
|
+
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
25
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
26
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
27
|
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
28
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
29
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
30
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
31
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
32
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
33
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
#define MD_SECT_CALL_FUNC(section, func) \
|
|
37
|
+
__asm (".section "#section", \"ax\"\n" \
|
|
38
|
+
" call " #func "\n" \
|
|
39
|
+
" .previous")
|
|
40
|
+
|
|
41
|
+
#define MD_SECTION_PROLOGUE(sect, entry_pt) \
|
|
42
|
+
__asm ( \
|
|
43
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
44
|
+
" .globl " #entry_pt " \n" \
|
|
45
|
+
" .type " #entry_pt ",@function \n" \
|
|
46
|
+
" .align 16 \n" \
|
|
47
|
+
#entry_pt": \n" \
|
|
48
|
+
" pushl %ebp \n" \
|
|
49
|
+
" movl %esp,%ebp \n" \
|
|
50
|
+
" andl $~15,%esp \n" \
|
|
51
|
+
" .previous")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
#define MD_SECTION_EPILOGUE(sect) \
|
|
55
|
+
__asm ( \
|
|
56
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
57
|
+
" leave \n" \
|
|
58
|
+
" ret \n" \
|
|
59
|
+
" .previous")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
#define MD_CRT0_START \
|
|
63
|
+
__asm( \
|
|
64
|
+
".text \n" \
|
|
65
|
+
" .align 4 \n" \
|
|
66
|
+
" .globl __start \n" \
|
|
67
|
+
" .globl _start \n" \
|
|
68
|
+
"_start: \n" \
|
|
69
|
+
"__start: \n" \
|
|
70
|
+
" movl %esp,%ebp \n" \
|
|
71
|
+
" andl $~15,%esp # align stack\n" \
|
|
72
|
+
" pushl %edx # cleanup\n" \
|
|
73
|
+
" movl 0(%ebp),%eax \n" \
|
|
74
|
+
" leal 8(%ebp,%eax,4),%ecx \n" \
|
|
75
|
+
" leal 4(%ebp),%edx \n" \
|
|
76
|
+
" pushl %ecx \n" \
|
|
77
|
+
" pushl %edx \n" \
|
|
78
|
+
" pushl %eax \n" \
|
|
79
|
+
" xorl %ebp,%ebp # mark deepest stack frame\n" \
|
|
80
|
+
" call ___start \n" \
|
|
81
|
+
" .previous")
|
|
82
|
+
|
|
83
|
+
/* zig patch: no static crt support */
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/* $OpenBSD: md_init.h,v 1.22 2023/11/19 00:46:54 deraadt Exp $ */
|
|
2
|
+
|
|
3
|
+
/*-
|
|
4
|
+
* Copyright (c) 2001 Ross Harvey
|
|
5
|
+
* Copyright (c) 2001 Simon Burge
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions
|
|
10
|
+
* are met:
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
12
|
+
* notice, this list of conditions and the following disclaimer.
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
* documentation and/or other materials provided with the distribution.
|
|
16
|
+
* 3. All advertising materials mentioning features or use of this software
|
|
17
|
+
* must display the following acknowledgement:
|
|
18
|
+
* This product includes software developed by the NetBSD
|
|
19
|
+
* Foundation, Inc. and its contributors.
|
|
20
|
+
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
21
|
+
* contributors may be used to endorse or promote products derived
|
|
22
|
+
* from this software without specific prior written permission.
|
|
23
|
+
*
|
|
24
|
+
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
25
|
+
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
26
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
27
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
28
|
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
29
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
30
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
31
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
32
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
33
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
34
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* Allocate 32 bytes for the stack frame. Store GP at SP+16 (since
|
|
39
|
+
* this is where code generated by the compiler for fallthru processing
|
|
40
|
+
* expects it to be), and the RA at SP+24.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/* this is gross... */
|
|
44
|
+
|
|
45
|
+
#ifdef __ABICALLS__
|
|
46
|
+
#define MD_FUNCTION_PROLOGUE(entry_pt) \
|
|
47
|
+
" .frame $sp,32,$31 \n" \
|
|
48
|
+
" .set reorder \n" \
|
|
49
|
+
" dsubu $sp,$sp,32 \n" \
|
|
50
|
+
" .cpsetup $25, 16, "#entry_pt" \n" \
|
|
51
|
+
" sd $ra ,24($sp) \n"
|
|
52
|
+
#else
|
|
53
|
+
#define MD_FUNCTION_PROLOGUE(entry_pt) \
|
|
54
|
+
" dsubu $sp,$sp,32 \n" \
|
|
55
|
+
" sd $ra ,24($sp) \n"
|
|
56
|
+
#endif
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
#define MD_SECTION_PROLOGUE(sect, entry_pt) \
|
|
60
|
+
__asm ( \
|
|
61
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
62
|
+
".align 2 \n" \
|
|
63
|
+
".globl "#entry_pt" \n" \
|
|
64
|
+
".type "#entry_pt",@function \n" \
|
|
65
|
+
".ent "#entry_pt" \n" \
|
|
66
|
+
#entry_pt": \n" \
|
|
67
|
+
MD_FUNCTION_PROLOGUE(entry_pt) \
|
|
68
|
+
" /* fall thru */ \n" \
|
|
69
|
+
".end "#entry_pt" \n" \
|
|
70
|
+
".previous")
|
|
71
|
+
|
|
72
|
+
#define MD_SECTION_EPILOGUE(sect) \
|
|
73
|
+
__asm ( \
|
|
74
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
75
|
+
" ld $ra ,24($sp) \n" \
|
|
76
|
+
" # next should have been a .cpreturn \n" \
|
|
77
|
+
" ld $gp,16($sp) \n" \
|
|
78
|
+
" .set noreorder \n" \
|
|
79
|
+
" j $ra \n" \
|
|
80
|
+
" daddu $sp,$sp,32 \n" \
|
|
81
|
+
" .set reorder \n" \
|
|
82
|
+
".previous")
|
|
83
|
+
|
|
84
|
+
#define MD_SECT_CALL_FUNC(section, func) \
|
|
85
|
+
__asm (".section "#section", \"ax\" \n" \
|
|
86
|
+
" .local " #func " \n" \
|
|
87
|
+
" jal " #func " \n" \
|
|
88
|
+
".previous")
|
|
89
|
+
|
|
90
|
+
#define MD_CRT0_START \
|
|
91
|
+
__asm( \
|
|
92
|
+
".text \n" \
|
|
93
|
+
" .align 3 \n" \
|
|
94
|
+
" .globl __start \n" \
|
|
95
|
+
" .ent __start \n" \
|
|
96
|
+
" .type __start, @function \n" \
|
|
97
|
+
"__start: \n" \
|
|
98
|
+
" lui $gp, %hi(%neg(%gp_rel(__start))) \n" \
|
|
99
|
+
" addiu $gp, $gp, %lo(%neg(%gp_rel(__start))) \n" \
|
|
100
|
+
" daddu $gp, $gp, $t9 \n" \
|
|
101
|
+
" move $a0, $sp \n" \
|
|
102
|
+
" dsrl $a1, $sp, 4 \n" /* align stack on a */ \
|
|
103
|
+
" dsll $sp, $a1, 4 \n" /* 16 byte boundary */ \
|
|
104
|
+
" move $a1, $v0 \n" \
|
|
105
|
+
" .local ___start \n" \
|
|
106
|
+
" dla $t9, ___start \n" \
|
|
107
|
+
" jr $t9 \n" \
|
|
108
|
+
" .end __start \n" \
|
|
109
|
+
" .previous")
|
|
110
|
+
|
|
111
|
+
/* zig patch: no static crt support */
|
|
112
|
+
|
|
113
|
+
struct kframe {
|
|
114
|
+
long kargc;
|
|
115
|
+
char *kargv[1]; /* size depends on kargc */
|
|
116
|
+
char kargstr[1]; /* size varies */
|
|
117
|
+
char kenvstr[1]; /* size varies */
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
#define MD_START_ARGS struct kframe *kfp, void (*cleanup)(void)
|
|
121
|
+
#define MD_START_SETUP \
|
|
122
|
+
char **argv, **envp; \
|
|
123
|
+
long argc; \
|
|
124
|
+
\
|
|
125
|
+
argc = kfp->kargc; \
|
|
126
|
+
argv = &kfp->kargv[0]; \
|
|
127
|
+
envp = argv + argc + 1;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* $OpenBSD: os-note-elf.h,v 1.5 2009/03/06 23:13:40 kurt Exp $ */
|
|
2
|
+
/*
|
|
3
|
+
* Contents:
|
|
4
|
+
*
|
|
5
|
+
* long Name length
|
|
6
|
+
* long Description length
|
|
7
|
+
* long ELF_NOTE_TYPE_OSVERSION (1) XXX - need a define.
|
|
8
|
+
* "OpenBSD\0"
|
|
9
|
+
* version? 0 XXX
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
__asm(" .section \".note.openbsd.ident\", \"a\"\n"
|
|
13
|
+
" .p2align 2\n"
|
|
14
|
+
" .long 8\n"
|
|
15
|
+
" .long 4\n"
|
|
16
|
+
" .long 1\n"
|
|
17
|
+
" .ascii \"OpenBSD\\0\"\n"
|
|
18
|
+
" .long 0\n"
|
|
19
|
+
" .previous\n");
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* $OpenBSD: md_init.h,v 1.12 2023/11/18 16:26:16 deraadt Exp $ */
|
|
2
|
+
|
|
3
|
+
/*-
|
|
4
|
+
* Copyright (c) 2001 Ross Harvey
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions
|
|
9
|
+
* are met:
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
11
|
+
* notice, this list of conditions and the following disclaimer.
|
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
14
|
+
* documentation and/or other materials provided with the distribution.
|
|
15
|
+
* 3. All advertising materials mentioning features or use of this software
|
|
16
|
+
* must display the following acknowledgement:
|
|
17
|
+
* This product includes software developed by the NetBSD
|
|
18
|
+
* Foundation, Inc. and its contributors.
|
|
19
|
+
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
20
|
+
* contributors may be used to endorse or promote products derived
|
|
21
|
+
* from this software without specific prior written permission.
|
|
22
|
+
*
|
|
23
|
+
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
24
|
+
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
25
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
26
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
27
|
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
28
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
29
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
30
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
31
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
32
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
33
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
#define MD_SECT_CALL_FUNC(section, func) \
|
|
37
|
+
__asm (".section "#section", \"ax\"\n" \
|
|
38
|
+
" bl " #func "\n" \
|
|
39
|
+
" .previous")
|
|
40
|
+
|
|
41
|
+
#define MD_SECTION_PROLOGUE(sect, entry_pt) \
|
|
42
|
+
__asm ( \
|
|
43
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
44
|
+
" .globl " #entry_pt " \n" \
|
|
45
|
+
" .type " #entry_pt ",@function \n" \
|
|
46
|
+
" .align 4 \n" \
|
|
47
|
+
#entry_pt": \n" \
|
|
48
|
+
" stwu %r1,-16(%r1) \n" \
|
|
49
|
+
" mflr %r0 \n" \
|
|
50
|
+
" stw %r0,12(%r1) \n" \
|
|
51
|
+
" /* fall thru */ \n" \
|
|
52
|
+
" .previous")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
#define MD_SECTION_EPILOGUE(sect) \
|
|
56
|
+
__asm ( \
|
|
57
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
58
|
+
" lwz %r0,12(%r1) \n" \
|
|
59
|
+
" mtlr %r0 \n" \
|
|
60
|
+
" addi %r1,%r1,16 \n" \
|
|
61
|
+
" blr \n" \
|
|
62
|
+
" .previous")
|
|
63
|
+
|
|
64
|
+
#define MD_CRT0_START \
|
|
65
|
+
__asm( \
|
|
66
|
+
" .text \n" \
|
|
67
|
+
" .section \".text\" \n" \
|
|
68
|
+
" .align 2 \n" \
|
|
69
|
+
" .globl _start \n" \
|
|
70
|
+
" .type _start, @function \n" \
|
|
71
|
+
" .globl __start \n" \
|
|
72
|
+
" .type __start, @function \n" \
|
|
73
|
+
"_start: \n" \
|
|
74
|
+
"__start: \n" \
|
|
75
|
+
" # put cleanup in r6 instead of r7 \n" \
|
|
76
|
+
" mr %r6, %r7 \n" \
|
|
77
|
+
" b ___start \n" \
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
/* zig patch: no static crt support */
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* $OpenBSD: md_init.h,v 1.5 2023/11/18 16:26:16 deraadt Exp $ */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2020 Dale Rahn <drahn@openbsd.org>
|
|
5
|
+
*
|
|
6
|
+
* Permission to use, copy, modify, and distribute this software for any
|
|
7
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
8
|
+
* copyright notice and this permission notice appear in all copies.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
11
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
12
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
13
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
14
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
15
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
16
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#define MD_SECT_CALL_FUNC(section, func) \
|
|
20
|
+
__asm (".section "#section", \"ax\" \n" \
|
|
21
|
+
" bl " #func " \n" \
|
|
22
|
+
" .previous")
|
|
23
|
+
|
|
24
|
+
#define MD_SECTION_PROLOGUE(sect, entry_pt) \
|
|
25
|
+
__asm ( \
|
|
26
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
27
|
+
" .globl " #entry_pt " \n" \
|
|
28
|
+
" .type " #entry_pt ",@function \n" \
|
|
29
|
+
" .align 4 \n" \
|
|
30
|
+
#entry_pt": \n" \
|
|
31
|
+
".L_"sect"_gep: \n" \
|
|
32
|
+
" addis %r2, %r12, .TOC.-.L_"sect"_gep@ha \n" \
|
|
33
|
+
" addi %r2, %r2, .TOC.-.L_"sect"_gep@l \n" \
|
|
34
|
+
".L_"sect"_lep: \n" \
|
|
35
|
+
" .localentry " #entry_pt", .L_"sect"_lep-.L_"sect"_gep; \n" \
|
|
36
|
+
" mflr %r0 \n" \
|
|
37
|
+
" std %r0,16(%r1) \n" \
|
|
38
|
+
" stdu %r1,-64(%r1) \n" \
|
|
39
|
+
" /* fall thru */ \n" \
|
|
40
|
+
" .previous")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
#define MD_SECTION_EPILOGUE(sect) \
|
|
44
|
+
__asm ( \
|
|
45
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
46
|
+
" addi %r1,%r1,64 \n" \
|
|
47
|
+
" ld %r0,16(%r1) \n" \
|
|
48
|
+
" mtlr %r0 \n" \
|
|
49
|
+
" blr \n" \
|
|
50
|
+
" .previous")
|
|
51
|
+
|
|
52
|
+
#define MD_CRT0_START \
|
|
53
|
+
__asm( \
|
|
54
|
+
" .text \n" \
|
|
55
|
+
" .section \".text\" \n" \
|
|
56
|
+
" .align 2 \n" \
|
|
57
|
+
" .globl _start \n" \
|
|
58
|
+
" .type _start, @function \n" \
|
|
59
|
+
" .globl __start \n" \
|
|
60
|
+
" .type __start, @function \n" \
|
|
61
|
+
"_start: \n" \
|
|
62
|
+
"__start: \n" \
|
|
63
|
+
" bl 1f \n" \
|
|
64
|
+
"1: \n" \
|
|
65
|
+
" mflr %r30 \n" \
|
|
66
|
+
" addis %r2, %r30, .TOC.-1b@ha \n" \
|
|
67
|
+
" addi %r2, %r2, .TOC.-1b@l \n" \
|
|
68
|
+
" # put cleanup in r6 instead of r7 \n" \
|
|
69
|
+
" mr %r6, %r7 \n" \
|
|
70
|
+
" li %r7, 0 \n" \
|
|
71
|
+
" stdu %r7, -64(%r1) \n" \
|
|
72
|
+
" b ___start \n" \
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
/* zig patch: no static crt support */
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* $OpenBSD: md_init.h,v 1.4 2023/11/18 16:26:16 deraadt Exp $ */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2020 Dale Rahn <drahn@openbsd.org>
|
|
4
|
+
*
|
|
5
|
+
* Permission to use, copy, modify, and distribute this software for any
|
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
|
8
|
+
*
|
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
#define MD_SECT_CALL_FUNC(section, func) \
|
|
19
|
+
__asm (".section "#section", \"ax\" \n" \
|
|
20
|
+
"call " # func "@plt \n" \
|
|
21
|
+
" .previous")
|
|
22
|
+
|
|
23
|
+
#define MD_SECTION_PROLOGUE(sect, entry_pt) \
|
|
24
|
+
__asm ( \
|
|
25
|
+
".section "#sect",\"ax\",%progbits \n" \
|
|
26
|
+
" .globl " #entry_pt " \n" \
|
|
27
|
+
" .type " #entry_pt ",@function \n" \
|
|
28
|
+
" .align 4 \n" \
|
|
29
|
+
#entry_pt": \n" \
|
|
30
|
+
" addi sp, sp, -16 \n" \
|
|
31
|
+
" sd ra,8(sp) \n" \
|
|
32
|
+
" sd s0,0(sp) \n" \
|
|
33
|
+
" addi s0, sp, 16 \n" \
|
|
34
|
+
" /* fall thru */ \n" \
|
|
35
|
+
" .previous")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
#define MD_SECTION_EPILOGUE(sect) \
|
|
39
|
+
__asm ( \
|
|
40
|
+
".section "#sect",\"ax\",%progbits \n" \
|
|
41
|
+
" ld ra, 8(sp) \n" \
|
|
42
|
+
" ld s0, 0(sp) \n" \
|
|
43
|
+
" addi sp, sp, 16 \n" \
|
|
44
|
+
" jr ra \n" \
|
|
45
|
+
" .previous")
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
#define MD_CRT0_START \
|
|
49
|
+
__asm( \
|
|
50
|
+
".text \n" \
|
|
51
|
+
" .align 0 \n" \
|
|
52
|
+
" .globl _start \n" \
|
|
53
|
+
" .globl __start \n" \
|
|
54
|
+
" .type _start, @function \n" \
|
|
55
|
+
" .type __start, @function \n" \
|
|
56
|
+
"_start: \n" \
|
|
57
|
+
"__start: \n" \
|
|
58
|
+
"/* Get argc/argv/envp from stack */ \n" \
|
|
59
|
+
" ld a0, (sp) \n" \
|
|
60
|
+
" addi a1, sp, 0x8 \n" \
|
|
61
|
+
" slli t0, a0, 0x3 \n" \
|
|
62
|
+
" add a2, a1, t0 \n" \
|
|
63
|
+
" addi a2, a2, 0x8 \n" \
|
|
64
|
+
" \n" \
|
|
65
|
+
" addi sp, sp, -16 \n" \
|
|
66
|
+
" li t0, 0 \n" \
|
|
67
|
+
" sd t0,(sp) \n" \
|
|
68
|
+
" \n" \
|
|
69
|
+
" j ___start \n" \
|
|
70
|
+
" .size _start, .-_start \n" \
|
|
71
|
+
" .size __start, .-__start \n" \
|
|
72
|
+
".previous");
|
|
73
|
+
|
|
74
|
+
/* zig patch: no static crt support */
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* $OpenBSD: md_init.h,v 1.11 2025/01/30 21:41:37 kurt Exp $ */
|
|
2
|
+
|
|
3
|
+
/*-
|
|
4
|
+
* Copyright (c) 2001 Ross Harvey
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions
|
|
9
|
+
* are met:
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
11
|
+
* notice, this list of conditions and the following disclaimer.
|
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
14
|
+
* documentation and/or other materials provided with the distribution.
|
|
15
|
+
* 3. All advertising materials mentioning features or use of this software
|
|
16
|
+
* must display the following acknowledgement:
|
|
17
|
+
* This product includes software developed by the NetBSD
|
|
18
|
+
* Foundation, Inc. and its contributors.
|
|
19
|
+
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
20
|
+
* contributors may be used to endorse or promote products derived
|
|
21
|
+
* from this software without specific prior written permission.
|
|
22
|
+
*
|
|
23
|
+
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
24
|
+
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
25
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
26
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
27
|
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
28
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
29
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
30
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
31
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
32
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
33
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
#define MD_SECT_CALL_FUNC(section, func) \
|
|
37
|
+
__asm (".section "#section", \"ax\" \n" \
|
|
38
|
+
" call " #func " \n" \
|
|
39
|
+
" nop \n" \
|
|
40
|
+
" .previous")
|
|
41
|
+
|
|
42
|
+
#define MD_SECTION_PROLOGUE(sect, entry_pt) \
|
|
43
|
+
__asm ( \
|
|
44
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
45
|
+
" .globl " #entry_pt " \n" \
|
|
46
|
+
" .type " #entry_pt ",@function \n" \
|
|
47
|
+
#entry_pt": \n" \
|
|
48
|
+
" save %sp, -192, %sp \n" \
|
|
49
|
+
" .align 4 \n" \
|
|
50
|
+
" /* fall thru */ \n" \
|
|
51
|
+
" .previous")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
#define MD_SECTION_EPILOGUE(sect) \
|
|
55
|
+
__asm ( \
|
|
56
|
+
".section "#sect",\"ax\",@progbits \n" \
|
|
57
|
+
" ret \n" \
|
|
58
|
+
" restore \n" \
|
|
59
|
+
" .previous")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
#define MD_CRT0_START \
|
|
63
|
+
__asm__( \
|
|
64
|
+
".text \n" \
|
|
65
|
+
" .align 4 \n" \
|
|
66
|
+
" .global _start \n" \
|
|
67
|
+
" .global __start \n" \
|
|
68
|
+
"_start: \n" \
|
|
69
|
+
"__start: \n" \
|
|
70
|
+
" clr %fp \n" \
|
|
71
|
+
" add %sp, 2175, %o0 /* stack */\n" \
|
|
72
|
+
" ba,pt %icc, ___start \n" \
|
|
73
|
+
" mov %g1, %o1 \n" \
|
|
74
|
+
" .previous")
|
|
75
|
+
|
|
76
|
+
/* zig patch: no static crt support */
|
|
77
|
+
|
|
78
|
+
#define MD_START_ARGS char **sp, void (*cleanup)(void)
|
|
79
|
+
#define MD_START_SETUP \
|
|
80
|
+
char **argv, **envp; \
|
|
81
|
+
long argc; \
|
|
82
|
+
\
|
|
83
|
+
argc = *(long *)sp; \
|
|
84
|
+
argv = sp + 1; \
|
|
85
|
+
envp = sp + 2 + argc; /* 2: argc + NULL ending argv */
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zigc/lib",
|
|
3
|
-
"version": "0.16.0-
|
|
3
|
+
"version": "0.16.0-test.0",
|
|
4
4
|
"description": "Zig standard library and libc headers (shared across all platforms)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/ziex-dev/
|
|
7
|
+
"url": "git+https://github.com/ziex-dev/zigc.git"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT"
|
|
10
10
|
}
|