mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-25 07:19:02 +00:00
Increase build memory quota
If you install qemu-user from apt then glibc links a lot of address space bloat that causes pthread_create() to ENOMEM (a.k.a. EAGAIN). Boosting the virtual memory quota from 512m to 2048m will hopefully future proof the build for the future, as Linux distros get fatter. Please note this only applies to MODE=aarch64 on x86_64 builds when you're using QEMU from Debian/Ubuntu rather than installing the one cosmo provides in third_party/qemu/qemu-aarch64.gz. This change may also be useful to people who are using the host compiler toolchain.
This commit is contained in:
parent
8ebe2e9020
commit
8ab3a545c6
10 changed files with 22 additions and 35 deletions
2
Makefile
2
Makefile
|
@ -116,7 +116,7 @@ ZIPCOPY = build/bootstrap/zipcopy.com
|
||||||
PECHECK = build/bootstrap/pecheck.com
|
PECHECK = build/bootstrap/pecheck.com
|
||||||
FIXUPOBJ = build/bootstrap/fixupobj.com
|
FIXUPOBJ = build/bootstrap/fixupobj.com
|
||||||
MKDIR = build/bootstrap/mkdir.com -p
|
MKDIR = build/bootstrap/mkdir.com -p
|
||||||
COMPILE = build/bootstrap/compile.com -V9 -P4096 $(QUOTA)
|
COMPILE = build/bootstrap/compile.com -V9 -M2048m -P8192 $(QUOTA)
|
||||||
|
|
||||||
IGNORE := $(shell $(MKDIR) $(TMPDIR))
|
IGNORE := $(shell $(MKDIR) $(TMPDIR))
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,6 @@ o/$(MODE)/examples/picol.com.dbg: \
|
||||||
$(APE_NO_MODIFY_SELF)
|
$(APE_NO_MODIFY_SELF)
|
||||||
@$(APELINK)
|
@$(APELINK)
|
||||||
|
|
||||||
o/$(MODE)/examples/nesemu1.o: private QUOTA += -M512m
|
|
||||||
o/$(MODE)/usr/share/dict/words.zip.o: private ZIPOBJ_FLAGS += -C2
|
o/$(MODE)/usr/share/dict/words.zip.o: private ZIPOBJ_FLAGS += -C2
|
||||||
|
|
||||||
$(EXAMPLES_OBJS): examples/BUILD.mk
|
$(EXAMPLES_OBJS): examples/BUILD.mk
|
||||||
|
|
|
@ -96,7 +96,7 @@ static void __zipos_generate_index(struct Zipos *zipos) {
|
||||||
zipos->index[i] = c;
|
zipos->index[i] = c;
|
||||||
}
|
}
|
||||||
// smoothsort() isn't the fastest algorithm, but it guarantees
|
// smoothsort() isn't the fastest algorithm, but it guarantees
|
||||||
// o(logn), won't smash the stack and doesn't depend on malloc
|
// o(nlogn) won't smash the stack and doesn't depend on malloc
|
||||||
smoothsort_r(zipos->index, zipos->records, sizeof(size_t),
|
smoothsort_r(zipos->index, zipos->records, sizeof(size_t),
|
||||||
__zipos_compare_names, zipos);
|
__zipos_compare_names, zipos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
│ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS │
|
│ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS │
|
||||||
│ IN THE SOFTWARE. │
|
│ IN THE SOFTWARE. │
|
||||||
└─────────────────────────────────────────────────────────────────────────────*/
|
└─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#include "libc/assert.h"
|
|
||||||
#include "libc/intrin/bsf.h"
|
#include "libc/intrin/bsf.h"
|
||||||
#include "libc/limits.h"
|
#include "libc/limits.h"
|
||||||
#include "libc/mem/alg.h"
|
#include "libc/mem/alg.h"
|
||||||
|
|
2
third_party/chibicc/test/BUILD.mk
vendored
2
third_party/chibicc/test/BUILD.mk
vendored
|
@ -74,8 +74,6 @@ o/$(MODE)/third_party/chibicc/test/%.o: \
|
||||||
$(CHIBICC)
|
$(CHIBICC)
|
||||||
@$(COMPILE) -wAOBJECTIFY.c $(CHIBICC) $(CHIBICC_FLAGS) $(OUTPUT_OPTION) -c $<
|
@$(COMPILE) -wAOBJECTIFY.c $(CHIBICC) $(CHIBICC_FLAGS) $(OUTPUT_OPTION) -c $<
|
||||||
|
|
||||||
o/$(MODE)/third_party/chibicc/test/int128_test.o: private QUOTA = -M1024m
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: o/$(MODE)/third_party/chibicc/test
|
.PHONY: o/$(MODE)/third_party/chibicc/test
|
||||||
|
|
2
third_party/mbedtls/test/BUILD.mk
vendored
2
third_party/mbedtls/test/BUILD.mk
vendored
|
@ -1358,8 +1358,6 @@ o/$(MODE)/third_party/mbedtls/test/secp384r1_test.com.dbg: \
|
||||||
$(APE_NO_MODIFY_SELF)
|
$(APE_NO_MODIFY_SELF)
|
||||||
@$(APELINK)
|
@$(APELINK)
|
||||||
|
|
||||||
o/$(MODE)/third_party/mbedtls/test/test_suite_asn1parse.com.runs: private QUOTA = -M512m
|
|
||||||
|
|
||||||
# these need to be explictly defined because landlock make won't sandbox
|
# these need to be explictly defined because landlock make won't sandbox
|
||||||
# prerequisites with a trailing slash.
|
# prerequisites with a trailing slash.
|
||||||
o/$(MODE)/third_party/mbedtls/test/data/.zip.o: \
|
o/$(MODE)/third_party/mbedtls/test/data/.zip.o: \
|
||||||
|
|
15
third_party/python/BUILD.mk
vendored
15
third_party/python/BUILD.mk
vendored
|
@ -3900,8 +3900,8 @@ $(THIRD_PARTY_PYTHON_STAGE2_A_DATA_OBJS): private ZIPOBJ_FLAGS += -P.python -C3
|
||||||
$(THIRD_PARTY_PYTHON_PYTEST_A_PYS_OBJS): private PYFLAGS += -P.python -C3
|
$(THIRD_PARTY_PYTHON_PYTEST_A_PYS_OBJS): private PYFLAGS += -P.python -C3
|
||||||
$(THIRD_PARTY_PYTHON_PYTEST_A_DATA_OBJS): private ZIPOBJ_FLAGS += -P.python -C3
|
$(THIRD_PARTY_PYTHON_PYTEST_A_DATA_OBJS): private ZIPOBJ_FLAGS += -P.python -C3
|
||||||
|
|
||||||
o/$(MODE)/third_party/python/Python/ceval.o: private QUOTA = -C64 -M1024m -L300
|
o/$(MODE)/third_party/python/Python/ceval.o: private QUOTA = -C64 -L300
|
||||||
o/$(MODE)/third_party/python/Objects/unicodeobject.o: private QUOTA += -C64 -M1024m -L300
|
o/$(MODE)/third_party/python/Objects/unicodeobject.o: private QUOTA += -C64 -L300
|
||||||
|
|
||||||
o/$(MODE)/third_party/python/Objects/unicodeobject.o: \
|
o/$(MODE)/third_party/python/Objects/unicodeobject.o: \
|
||||||
third_party/python/Objects/unicodeobject.c \
|
third_party/python/Objects/unicodeobject.c \
|
||||||
|
@ -3944,18 +3944,13 @@ o/$(MODE)/third_party/python/Lib/test/pystone.o: private PYFLAGS += -m -O2 -P.py
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_long.py.runs: private QUOTA = -C64 -L180
|
o/$(MODE)/third_party/python/Lib/test/test_long.py.runs: private QUOTA = -C64 -L180
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_hash.py.runs: private QUOTA = -C64
|
o/$(MODE)/third_party/python/Lib/test/test_hash.py.runs: private QUOTA = -C64
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_exceptions.py.runs: private QUOTA = -C64
|
o/$(MODE)/third_party/python/Lib/test/test_exceptions.py.runs: private QUOTA = -C64
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_tuple.py.runs: private QUOTA = -M512m
|
o/$(MODE)/third_party/python/Lib/test/test_decimal.py.runs: private QUOTA = -C64 -L300
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_decimal.py.runs: private QUOTA = -M512m -C64 -L300
|
o/$(MODE)/third_party/python/Lib/test/test_unicode.py.runs: private QUOTA = -L300
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_longexp.py.runs: private QUOTA = -M1024m
|
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_unicode.py.runs: private QUOTA = -M1400m -L300
|
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_unicodedata.py.runs: private QUOTA = -C64 -L300
|
o/$(MODE)/third_party/python/Lib/test/test_unicodedata.py.runs: private QUOTA = -C64 -L300
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_logging.py.runs: private QUOTA = -M512m
|
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_itertools.py.runs: private QUOTA = -M1024m
|
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_tarfile.py.runs: private QUOTA = -L300 -C64
|
o/$(MODE)/third_party/python/Lib/test/test_tarfile.py.runs: private QUOTA = -L300 -C64
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_sqlite.py.runs: private QUOTA = -L120
|
o/$(MODE)/third_party/python/Lib/test/test_sqlite.py.runs: private QUOTA = -L120
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_gzip.py.runs: private QUOTA = -L120
|
o/$(MODE)/third_party/python/Lib/test/test_gzip.py.runs: private QUOTA = -L120
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_logging.py.runs: private QUOTA = -M512m
|
o/$(MODE)/third_party/python/Lib/test/test_email/test_email.py.runs: private QUOTA = -C32
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_email/test_email.py.runs: private QUOTA = -C32 -M1024m
|
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_selectors.py.runs: private QUOTA = -L180
|
o/$(MODE)/third_party/python/Lib/test/test_selectors.py.runs: private QUOTA = -L180
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_trace.py.runs: private QUOTA = -L300
|
o/$(MODE)/third_party/python/Lib/test/test_trace.py.runs: private QUOTA = -L300
|
||||||
o/$(MODE)/third_party/python/Lib/test/test_multibytecodec.py.runs: private QUOTA = -C128 -L600 -L300
|
o/$(MODE)/third_party/python/Lib/test/test_multibytecodec.py.runs: private QUOTA = -C128 -L600 -L300
|
||||||
|
|
8
third_party/sqlite3/BUILD.mk
vendored
8
third_party/sqlite3/BUILD.mk
vendored
|
@ -187,11 +187,9 @@ o/$(MODE)/third_party/sqlite3/parse.o: private \
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-fpie
|
-fpie
|
||||||
|
|
||||||
o/$(MODE)/third_party/sqlite3/shell.o: private QUOTA = -M512m -C32 -L180
|
o/$(MODE)/third_party/sqlite3/shell.o: private QUOTA = -C32 -L180
|
||||||
o/$(MODE)/third_party/sqlite3/vdbe.o: private QUOTA = -M1024m
|
o/$(MODE)/third_party/sqlite3/fts5.o: private QUOTA = -C32
|
||||||
o/$(MODE)/third_party/sqlite3/vdbe.shell.o: private QUOTA = -M1024m
|
o/$(MODE)/third_party/sqlite3/fts5.shell.o: private QUOTA = -C32 -L180
|
||||||
o/$(MODE)/third_party/sqlite3/fts5.o: private QUOTA = -M512m -C32
|
|
||||||
o/$(MODE)/third_party/sqlite3/fts5.shell.o: private QUOTA = -M512m -C32 -L180
|
|
||||||
|
|
||||||
o/$(MODE)/third_party/sqlite3/rtree.o: \
|
o/$(MODE)/third_party/sqlite3/rtree.o: \
|
||||||
third_party/sqlite3/rtree.c \
|
third_party/sqlite3/rtree.c \
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "libc/fmt/itoa.h"
|
#include "libc/fmt/itoa.h"
|
||||||
#include "libc/fmt/libgen.h"
|
#include "libc/fmt/libgen.h"
|
||||||
#include "libc/fmt/magnumstrs.internal.h"
|
#include "libc/fmt/magnumstrs.internal.h"
|
||||||
#include "libc/serialize.h"
|
|
||||||
#include "libc/intrin/safemacros.internal.h"
|
#include "libc/intrin/safemacros.internal.h"
|
||||||
#include "libc/limits.h"
|
#include "libc/limits.h"
|
||||||
#include "libc/log/appendresourcereport.internal.h"
|
#include "libc/log/appendresourcereport.internal.h"
|
||||||
|
@ -48,6 +47,7 @@
|
||||||
#include "libc/nexgen32e/x86info.h"
|
#include "libc/nexgen32e/x86info.h"
|
||||||
#include "libc/proc/posix_spawn.h"
|
#include "libc/proc/posix_spawn.h"
|
||||||
#include "libc/runtime/runtime.h"
|
#include "libc/runtime/runtime.h"
|
||||||
|
#include "libc/serialize.h"
|
||||||
#include "libc/stdio/append.h"
|
#include "libc/stdio/append.h"
|
||||||
#include "libc/str/str.h"
|
#include "libc/str/str.h"
|
||||||
#include "libc/sysv/consts/auxv.h"
|
#include "libc/sysv/consts/auxv.h"
|
||||||
|
@ -112,9 +112,9 @@ FLAGS\n\
|
||||||
-V NUMBER specifies compiler version\n\
|
-V NUMBER specifies compiler version\n\
|
||||||
-C SECS set cpu limit [default 16]\n\
|
-C SECS set cpu limit [default 16]\n\
|
||||||
-L SECS set lat limit [default 90]\n\
|
-L SECS set lat limit [default 90]\n\
|
||||||
-P PROCS set pro limit [default 2048]\n\
|
-P PROCS set pro limit [default 4096]\n\
|
||||||
-S BYTES set stk limit [default 8m]\n\
|
-S BYTES set stk limit [default 8m]\n\
|
||||||
-M BYTES set mem limit [default 512m]\n\
|
-M BYTES set mem limit [default 2048m]\n\
|
||||||
-F BYTES set fsz limit [default 256m]\n\
|
-F BYTES set fsz limit [default 256m]\n\
|
||||||
-O BYTES set out limit [default 1m]\n\
|
-O BYTES set out limit [default 1m]\n\
|
||||||
-s decrement verbosity [default 4]\n\
|
-s decrement verbosity [default 4]\n\
|
||||||
|
@ -845,12 +845,12 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
// parse prefix arguments
|
// parse prefix arguments
|
||||||
verbose = 4;
|
verbose = 4;
|
||||||
timeout = 90; /* secs */
|
timeout = 90; // secs
|
||||||
cpuquota = 32; /* secs */
|
cpuquota = 32; // secs
|
||||||
proquota = 2048; /* procs */
|
proquota = 4096; // procs
|
||||||
stkquota = 8 * 1024 * 1024; /* bytes */
|
stkquota = 8 * 1024 * 1024; // bytes
|
||||||
fszquota = 256 * 1000 * 1000; /* bytes */
|
fszquota = 256 * 1000 * 1000; // bytes
|
||||||
memquota = 512 * 1024 * 1024; /* bytes */
|
memquota = 2048L * 1024 * 1024; // bytes
|
||||||
if ((s = getenv("V"))) verbose = atoi(s);
|
if ((s = getenv("V"))) verbose = atoi(s);
|
||||||
while ((opt = getopt(argc, argv, "hnstvwA:C:F:L:M:O:P:T:V:S:")) != -1) {
|
while ((opt = getopt(argc, argv, "hnstvwA:C:F:L:M:O:P:T:V:S:")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
|
|
@ -20,10 +20,10 @@ APELINK=o/$(mode)/tool/build/apelink.com
|
||||||
AMD64=${2:-x86_64}
|
AMD64=${2:-x86_64}
|
||||||
ARM64=${3:-aarch64}
|
ARM64=${3:-aarch64}
|
||||||
|
|
||||||
make -j8 m= \
|
make -j32 m= \
|
||||||
$APELINK
|
$APELINK
|
||||||
|
|
||||||
make -j8 m=$AMD64 \
|
make -j32 m=$AMD64 \
|
||||||
o/cosmocc.h.txt \
|
o/cosmocc.h.txt \
|
||||||
o/$AMD64/ape/ape.lds \
|
o/$AMD64/ape/ape.lds \
|
||||||
o/$AMD64/libc/crt/crt.o \
|
o/$AMD64/libc/crt/crt.o \
|
||||||
|
@ -46,7 +46,7 @@ make -j8 m=$AMD64 \
|
||||||
o/$AMD64/third_party/make/make.com.dbg \
|
o/$AMD64/third_party/make/make.com.dbg \
|
||||||
o/$AMD64/third_party/ctags/ctags.com.dbg
|
o/$AMD64/third_party/ctags/ctags.com.dbg
|
||||||
|
|
||||||
make -j8 m=$ARM64 \
|
make -j32 m=$ARM64 \
|
||||||
o/$ARM64/ape/ape.elf \
|
o/$ARM64/ape/ape.elf \
|
||||||
o/$ARM64/ape/aarch64.lds \
|
o/$ARM64/ape/aarch64.lds \
|
||||||
o/$ARM64/libc/crt/crt.o \
|
o/$ARM64/libc/crt/crt.o \
|
||||||
|
|
Loading…
Add table
Reference in a new issue