From ef12c8587c529b7e3ecaddec785cdb478574f6f6 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Fri, 12 Jun 2026 12:15:42 -0500 Subject: [PATCH] fix(ci): link only soul.c to avoid GNU ld duplicate symbol errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The El compiler inlines imported modules into each module's .c file. On macOS, ld64 accepts duplicate strong symbols silently. On Linux, GNU ld rejects them. soul.c is a fully merged file — every function from every imported module is present in it — so linking only soul.c against el_runtime.c produces a correct binary with no duplicates. --- .gitea/workflows/ci.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index d05bbdb..419fff6 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -109,7 +109,23 @@ jobs: ELC=/opt/el/dist/platform/elc RUNTIME=/opt/el/runtime - $ELB --elc=$ELC --runtime=$RUNTIME/el_runtime.c + # Compile all El modules to C (may fail at link on Linux: the El compiler + # inlines imported modules into each module's .c file, producing duplicate + # symbol definitions that GNU ld rejects as errors. macOS ld accepts them + # silently. We ignore the link failure and re-link manually below.) + $ELB --elc=$ELC --runtime=$RUNTIME/el_runtime.c || true + + # soul.c is a fully self-contained merged file — every function from every + # imported module is inlined into it. Link only soul.c against el_runtime.c; + # this avoids all duplicate-symbol conflicts from the individual module files. + mkdir -p dist + cc -O2 -DHAVE_CURL \ + -I$RUNTIME \ + dist/soul.c \ + $RUNTIME/el_runtime.c \ + -lssl -lcrypto -lcurl -lpthread -lm \ + -o dist/neuron + ls -lh dist/neuron - name: Smoke test