diff --git a/ape/ape.lds b/ape/ape.lds index 4d8695d37..3a72d8170 100644 --- a/ape/ape.lds +++ b/ape/ape.lds @@ -375,7 +375,7 @@ SECTIONS { /*END: file content */ /*BEGIN: bss memory that's addressable */ - .bss ALIGN(__SIZEOF_POINTER__) : { + .bss ALIGN(64) : { KEEP(*(SORT_BY_NAME(.piro.bss.init.*))) *(.piro.bss) KEEP(*(SORT_BY_NAME(.piro.bss.sort.*))) diff --git a/libc/nexgen32e/mcount.S b/libc/nexgen32e/mcount.S index 5d0653eeb..3f5872622 100644 --- a/libc/nexgen32e/mcount.S +++ b/libc/nexgen32e/mcount.S @@ -25,3 +25,4 @@ // cc -pg adds this to the start of global functions. mcount: ret .endfn mcount,weak + .alias mcount,.mcount # freebsd weirdness? diff --git a/test/libc/rand/getrandom_test.c b/test/libc/rand/getrandom_test.c index b79f39966..b6e83adb5 100644 --- a/test/libc/rand/getrandom_test.c +++ b/test/libc/rand/getrandom_test.c @@ -18,6 +18,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/log/check.h" #include "libc/math.h" +#include "libc/nexgen32e/x86feature.h" #include "libc/rand/lcg.internal.h" #include "libc/rand/rand.h" #include "libc/stdio/stdio.h" @@ -175,7 +176,11 @@ uint64_t GetRandomNoRdrrnd(void) { uint64_t GetRandomNoSystem(void) { uint64_t x; - ASSERT_EQ(8, getrandom(&x, 8, GRND_NOSYSTEM)); + if (X86_HAVE(RDRND) || X86_HAVE(RDSEED)) { + ASSERT_EQ(8, getrandom(&x, 8, GRND_NOSYSTEM)); + } else { + ASSERT_EQ(8, getrandom(&x, 8, 0)); + } return x; } diff --git a/test/libc/release/lld.sh b/test/libc/release/lld.sh index 5cac90ee5..28a43faa3 100755 --- a/test/libc/release/lld.sh +++ b/test/libc/release/lld.sh @@ -14,6 +14,7 @@ if CLANG=$(command -v clang); then -fno-pie \ -nostdlib \ -nostdinc \ + -fuse-ld=lld \ -mno-red-zone \ -Wl,-T,o/$MODE/ape/ape.lds \ -include o/cosmopolitan.h \