From e09790470e584d4bf7f1961d6ecf20ae36f2e790 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 18 Oct 2022 19:02:39 -0700 Subject: [PATCH] all: properly use the right cosmopolitan libraries --- build-all | 9 ++++++++- cosmo-all/Dockerfile | 6 +++++- notwa-util/cosmocc | 4 +++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/build-all b/build-all index cac2775..d5873e6 100755 --- a/build-all +++ b/build-all @@ -46,6 +46,13 @@ build_simple() { : \ ;done \ ;} +build_base() { : \ + && sed 's/\bcosmo-bootstrap\b/cosmo-all/g' \ + cosmo-dist/all.Dockerfile \ + && build cosmo-dist -f cosmo-dist/all.Dockerfile \ + && build cosmo-base \ + ;} + : \ && me="$(readlink -f "$0")" && cd "${me%/*}" && { [ -d out ] || mkdir out ;} \ && : \ @@ -62,7 +69,7 @@ build_simple() { : \ && build rescue \ \ `# phase 4` \ - && build cosmo-base \ + && build_base \ && build_simple \ \ `# phase 5` \ diff --git a/cosmo-all/Dockerfile b/cosmo-all/Dockerfile index 035c621..d2ef3c3 100644 --- a/cosmo-all/Dockerfile +++ b/cosmo-all/Dockerfile @@ -15,6 +15,10 @@ RUN : \ commit "$commit" \ flavor "$COSMO_FLAVOR" \ mode "$mode" \ + COSMO "$PWD" \ + COSMO_DIST "$PWD/dist/$COSMO_FLAVOR" \ +\ + && shed expand "s_o='o/[^']*'_o='o/$mode'_g" \ ; RUN --mount=type=tmpfs,target=/tmp : \ @@ -44,5 +48,5 @@ RUN --mount=type=tmpfs,target=/tmp : \ install -m0755 -t /usr/local/bin {} \ + \ # save some space: \ - && find o '(' -name '*.com.dbg' -o -name '*_test.*' -o -name 'test_*' ')' -delete \ + && find o -type f '(' -name '*.com.dbg' -o -name '*_test.*' -o -name 'test_*' ')' -delete \ ; diff --git a/notwa-util/cosmocc b/notwa-util/cosmocc index b579d0e..98aab5b 100755 --- a/notwa-util/cosmocc +++ b/notwa-util/cosmocc @@ -1,6 +1,8 @@ #!/usr/bin/env sh cosmo="${COSMO:-"/cosmopolitan"}" -dist="${COSMO_DIST:-"$cosmo/dist/def"}" +unset flavor +[ ! -s "$cosmo/env" ] || . "$cosmo/env" +dist="${COSMO_DIST:-"$cosmo/dist/${flavor:-def}"}" _CFLAGS="-fno-omit-frame-pointer -fdata-sections -ffunction-sections -fno-pie -pg -mnop-mcount -mno-tls-direct-seg-refs" _CPPFLAGS="-DNDEBUG -nostdinc -iquote $cosmo -isystem $cosmo/libc/isystem -include $cosmo/libc/integral/normalize.inc"