diff --git a/README.md b/README.md index aad80553b..29b222a4d 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,13 @@ gcc -g -Os -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone \ objcopy -S -O binary hello.com.dbg hello.com ``` -You now have a portable program! Your APE binary will assimilate itself -as conventional residents of your platform after the first run, so it -can be fast and efficient for subsequent executions. +You now have a portable program. Please note that your APE binary will +assimilate itself as a conventional resident of your platform after the +first run, so it can be fast and efficient for subsequent executions. ```sh ./hello.com -bash -c './hello.com' # zsh/fish workaround: we upstream a patch! +bash -c './hello.com' # zsh/fish workaround (we upstreamed a patch) ``` So if you intend to copy the binary to Windows or Mac then please do diff --git a/libc/nexgen32e/g_argv.S b/libc/nexgen32e/argv.S similarity index 100% rename from libc/nexgen32e/g_argv.S rename to libc/nexgen32e/argv.S diff --git a/libc/nexgen32e/g_auxv.S b/libc/nexgen32e/auxv.S similarity index 100% rename from libc/nexgen32e/g_auxv.S rename to libc/nexgen32e/auxv.S diff --git a/libc/nexgen32e/errno.S b/libc/nexgen32e/errno.c similarity index 69% rename from libc/nexgen32e/errno.S rename to libc/nexgen32e/errno.c index 5e51e0f96..f175f75f8 100644 --- a/libc/nexgen32e/errno.S +++ b/libc/nexgen32e/errno.c @@ -1,7 +1,7 @@ -/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ -│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ -│ Copyright 2020 Justine Alexandra Roberts Tunney │ +│ Copyright 2021 Justine Alexandra Roberts Tunney │ │ │ │ Permission to use, copy, modify, and/or distribute this software for │ │ any purpose with or without fee is hereby granted, provided that the │ @@ -16,21 +16,20 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/macros.internal.h" -.source __FILE__ +#include "libc/nexgen32e/nexgen32e.h" -// Global variable for last error. -// -// The system call wrappers update this with WIN32 error codes. -// Unlike traditional libraries, Cosmopolitan error codes are -// defined as variables. By convention, system calls and other -// functions do not update this variable when nothing's broken. -// -// @see libc/sysv/consts.sh -// @see libc/sysv/errfuns.h -// @see __errno_location() stable abi - .bss - .align 4 -errno: .long 0 - .endobj errno,globl - yoink __errno_location +STATIC_YOINK("__errno_location"); /* needed by gdb */ + +/** + * Global variable for last error. + * + * The system call wrappers update this with WIN32 error codes. + * Unlike traditional libraries, Cosmopolitan error codes are + * defined as variables. By convention, system calls and other + * functions do not update this variable when nothing's broken. + * + * @see libc/sysv/consts.sh + * @see libc/sysv/errfuns.h + * @see __errno_location() stable abi + */ +int errno;