From 049a7712f4a2a2ca144edd85e902867022fafa7e Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Mon, 4 May 2026 16:08:47 -0500 Subject: [PATCH] ci: add -lm and allow-multiple-definition for bootstrap build el_runtime.c uses pow/sqrt/log/sin/cos/exp - needs -lm. elc-bootstrap.c predates the text-processing primitives commit so it has its own C definitions of is_digit/is_whitespace; -Wl,--allow-multiple-definition lets the linker accept both (equivalent implementations). --- .gitea/workflows/ci-dev.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci-dev.yaml b/.gitea/workflows/ci-dev.yaml index b33bad8..1aab05b 100644 --- a/.gitea/workflows/ci-dev.yaml +++ b/.gitea/workflows/ci-dev.yaml @@ -23,13 +23,17 @@ jobs: apt-get install -y gcc libcurl4-openssl-dev # Gen2: compile the bootstrap C source into a working elc binary + # -Wl,--allow-multiple-definition: is_digit/is_whitespace exist in both + # elc-bootstrap.c (pre-dates runtime text primitives) and el_runtime.c. + # Both definitions are equivalent; allow the linker to pick one. - name: Build elc from bootstrap (gen2) run: | gcc -O2 \ -I el-compiler/runtime \ dist/elc-bootstrap.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread \ + -lcurl -lpthread -lm \ + -Wl,--allow-multiple-definition \ -o dist/elc-gen2 chmod +x dist/elc-gen2 echo "gen2 elc built" @@ -44,7 +48,7 @@ jobs: -I el-compiler/runtime \ dist/elc-gen3.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread \ + -lcurl -lpthread -lm \ -o dist/platform/elc chmod +x dist/platform/elc echo "gen3 (self-hosted) elc built" @@ -83,7 +87,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -o /tmp/el_native_text + -lcurl -lpthread -lm -o /tmp/el_native_text /tmp/el_native_text # Publish artifact to GCP Artifact Registry (dev)