mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Make assimilate.com better
It's now safer to run. It'll now remove FreeBSD from the ELF os/abi so that GDB is happier.
This commit is contained in:
parent
f491276b62
commit
566cb5963f
2 changed files with 209 additions and 79 deletions
|
@ -38,10 +38,6 @@ __static_yoink("zipos");
|
|||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(stat_010, testEmptyFile_sizeIsZero) {
|
||||
struct stat st;
|
||||
memset(&st, -1, sizeof(st));
|
||||
|
@ -72,32 +68,6 @@ TEST(stat, zipos) {
|
|||
EXPECT_SYS(0, 0, stat("/zip/.python/", &st));
|
||||
}
|
||||
|
||||
static long Fstatat(const char *path, struct stat *st) {
|
||||
#ifdef __x86_64__
|
||||
long ax, di, si, dx;
|
||||
register long r10 asm("r10") = 0;
|
||||
asm volatile("syscall"
|
||||
: "=a"(ax), "=D"(di), "=S"(si), "=d"(dx), "+r"(r10)
|
||||
: "0"(__NR_fstatat), "1"(AT_FDCWD), "2"(path), "3"(st)
|
||||
: "rcx", "r8", "r9", "r11", "memory", "cc");
|
||||
return ax;
|
||||
#elif defined(__aarch64__)
|
||||
register long r0 asm("x0") = (long)AT_FDCWD;
|
||||
register long r1 asm("x1") = (long)path;
|
||||
register long r2 asm("x2") = (long)st;
|
||||
register long r3 asm("x3") = (long)0;
|
||||
register long r8 asm("x8") = (long)__NR_fstatat;
|
||||
register long res_x0 asm("x0");
|
||||
asm volatile("svc\t0"
|
||||
: "=r"(res_x0)
|
||||
: "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r8)
|
||||
: "memory");
|
||||
return res_x0;
|
||||
#else
|
||||
#error "unsupported architecture"
|
||||
#endif
|
||||
}
|
||||
|
||||
BENCH(stat, bench) {
|
||||
struct stat st;
|
||||
union metastat ms;
|
||||
|
@ -107,12 +77,6 @@ BENCH(stat, bench) {
|
|||
touch(".python/test/"
|
||||
"tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt",
|
||||
0644));
|
||||
if (!IsWindows() && !IsFreebsd()) {
|
||||
EZBENCH2("fstatat syscall", donothing,
|
||||
Fstatat(".python/test/"
|
||||
"tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt",
|
||||
&st));
|
||||
}
|
||||
EZBENCH2("stat() fs", donothing,
|
||||
stat(".python/test/"
|
||||
"tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue