mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
7e0a09feec
This change ports APE Loader to Linux AARCH64, so that Raspberry Pi users can run programs like redbean, without the executable needing to modify itself. Progress has also slipped into this change on the issue of making progress better conforming to user expectations and industry standards regarding which symbols we're allowed to declare
42 lines
1.5 KiB
C
42 lines
1.5 KiB
C
#if 0
|
|
/*─────────────────────────────────────────────────────────────────╗
|
|
│ To the extent possible under law, Justine Tunney has waived │
|
|
│ all copyright and related or neighboring rights to this file, │
|
|
│ as it is written in the following disclaimers: │
|
|
│ • http://unlicense.org/ │
|
|
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
|
╚─────────────────────────────────────────────────────────────────*/
|
|
#endif
|
|
#include "libc/intrin/kprintf.h"
|
|
#include "libc/math.h"
|
|
#include "libc/runtime/runtime.h"
|
|
#include "libc/runtime/symbols.internal.h"
|
|
|
|
/**
|
|
* @fileoverview How to print backtraces and cpu state on crash.
|
|
*
|
|
* make -j8 -O o//examples/crashreport.com
|
|
* o//examples/crashreport.com
|
|
*
|
|
* To prevent the GDB GUI from popping up:
|
|
*
|
|
* export GDB=
|
|
* make -j8 -O o//examples/crashreport.com
|
|
* o//examples/crashreport.com
|
|
*/
|
|
|
|
dontubsan int main(int argc, char *argv[]) {
|
|
kprintf("----------------\n");
|
|
kprintf(" THIS IS A TEST \n");
|
|
kprintf("SIMULATING CRASH\n");
|
|
kprintf("----------------\n");
|
|
|
|
ShowCrashReports();
|
|
|
|
volatile double a = 0;
|
|
volatile double b = 23;
|
|
volatile double c = exp(b) / a;
|
|
|
|
volatile int64_t x;
|
|
return 1 / (x = 0);
|
|
}
|