ci: add -lm and allow-multiple-definition for bootstrap build
El CI -dev / build-and-test (pull_request) Failing after 54s
El CI -dev / build-and-test (pull_request) Failing after 54s
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).
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user