Add scouts honor escape hatch for source embedding

This commit is contained in:
Justine Tunney 2020-06-15 19:01:28 -07:00
parent c91b3c5006
commit b4269930f7
547 changed files with 1516 additions and 944 deletions

View file

@ -21,7 +21,7 @@
#include "libc/runtime/internal.h"
#include "libc/macros.h"
.privileged
.yoink __FILE__
.source __FILE__
/ Terminates process, ignoring destructors and atexit() handlers.
/

View file

@ -23,7 +23,7 @@
#include "libc/sysv/consts/nr.h"
#include "libc/macros.h"
.real
.yoink __FILE__
.source __FILE__
/ Terminates program abnormally.
/

View file

@ -20,7 +20,7 @@
#include "ape/relocations.h"
#include "libc/macros.h"
.section .text.exit,"ax",@progbits
.yoink __FILE__
.source __FILE__
/ Delegates to __cxa_atexit().
/

View file

@ -19,7 +19,7 @@
*/
#include "libc/macros.h"
#include "libc/notice.inc"
.yoink __FILE__
.source __FILE__
/ Uniquely identifies each artifact linked in an address space.
__dso_handle:

View file

@ -20,7 +20,7 @@
#include "libc/macros.h"
#include "libc/notice.inc"
.text.startup
.yoink __FILE__
.source __FILE__
/ Intel Manual V.1 §10.2.3 - MXCSR Control and Status Register
#define MXCSR_DE (1 << 1) /* Denormal Flag */

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
/ Re-initializes FPU.
fpreset:

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
.initbss 300,_init_g_argc
g_argc: .quad 0

View file

@ -23,11 +23,12 @@
#include "libc/runtime/internal.h"
#include "libc/str/appendchar.h"
#include "libc/str/str.h"
#include "libc/str/tpenc.h"
/* TODO(jart): Make early-stage data structures happen. */
#undef isspace
#undef iswspace
#define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r')
#define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r')
#define iswspace(c) isspace(c)
struct DosArgv {
@ -37,14 +38,12 @@ struct DosArgv {
wint_t wc;
};
static textwindows void decodedosargv(struct DosArgv *st) {
static inline textwindows void decodedosargv(struct DosArgv *st) {
st->s += getutf16(st->s, &st->wc);
}
static textwindows void appenddosargv(struct DosArgv *st, wint_t wc) {
if (st->p < st->pe) {
st->p += tpencode(st->p, st->pe - st->p, wc, false);
}
static inline textwindows void appenddosargv(struct DosArgv *st, wint_t wc) {
AppendChar(&st->p, st->pe, wc);
}
/**

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
/ Returns granularity of memory manager.
getpagesize:

View file

@ -21,7 +21,7 @@
#include "libc/runtime/internal.h"
#include "libc/sysv/consts/prot.h"
#include "libc/dce.h"
.yoink __FILE__
.source __FILE__
/ Decentralized function for process initialization.
/

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
#define BYTES 64

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
#define BYTES 64

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
mapanon:push %rbp
mov %rsp,%rbp

View file

@ -22,7 +22,7 @@
#include "libc/sysv/consts/nr.h"
#include "libc/macros.h"
.text.startup
.yoink __FILE__
.source __FILE__
/ Merges page table entries for pages with identical content.
/

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
munmap: push %rbp
mov %rsp,%rbp

View file

@ -19,7 +19,7 @@
*/
#include "ape/relocations.h"
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
/ Loads all pages from program image into memory.
peekall:.leafprologue

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
/ Provides argv[0] The BSD Way.
.initbss 300,_init___progname

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
/ Supplies basename(argv[0]) The GNU Way.
.initbss 400,_init_program_invocation_short_name

View file

@ -26,7 +26,7 @@
#include "libc/runtime/mappings.h"
#include "libc/sysv/consts/prot.h"
.text.startup
.yoink __FILE__
.source __FILE__
/ Cosmopolitan process entrypoint.
/

View file

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/macros.h"
.yoink __FILE__
.source __FILE__
/ Thunks free() if it's linked, otherwise do nothing.
/