Repository navigation
Closed
Labels
bugSomething isn't working
Description
Error
When running ./bin/compile on Linux, compilation fails on step 4 with [4/5] link seed -> /tmp/seed/manticore_seed.
The error looks like that:
...
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : /tmp/seed/seed.o : dans la fonction « manticore_preg_replace » :
mir:(.text+0x3fb7bb) : référence indéfinie vers « pcre2_match_data_create_from_pattern_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : mir:(.text+0x3fb811) : référence indéfinie vers « pcre2_match_data_create_from_pattern_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : mir:(.text+0x3fbb45) : référence indéfinie vers « pcre2_match_data_free_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : /tmp/seed/seed.o : dans la fonction « manticore_preg_replace_callback » :
mir:(.text+0x3fbce4) : référence indéfinie vers « pcre2_match_data_create_from_pattern_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : mir:(.text+0x3fbd36) : référence indéfinie vers « pcre2_match_data_create_from_pattern_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : mir:(.text+0x3fc1a7) : référence indéfinie vers « pcre2_match_data_free_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : /tmp/seed/seed.o : dans la fonction « manticore_preg_split » :
mir:(.text+0x3fc537) : référence indéfinie vers « pcre2_match_data_create_from_pattern_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : mir:(.text+0x3fc591) : référence indéfinie vers « pcre2_match_data_create_from_pattern_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : mir:(.text+0x3fca9d) : référence indéfinie vers « pcre2_match_data_free_8 »
collect2: erreur: ld a retourné le statut de sortie 1
Expected
Compilation should succeed.
Reproduce
Build the official Linux container:
docker build -t manticore --file tools/docker/Dockerfile.debian ./binGet a shell in it:
docker run --rm -it -v `pwd`:/build manticore
Try to bootstrap manticore:
./bin/compile
It will fail on step 4
Reason
This call is broken on Linux:
# Probe the linker without the runtime lib — every symbol it still can't find
# gets a void* fallback. macOS underscores names in errors; strip it defensively.
set +e
LINK_ERR="$(cc "$OBJ" -o /dev/null 2>&1)"
set -e
echo "$LINK_ERR" \
| grep '^ "_' \
| awk -F'"' '{print $2}' \
| sort -u \
| grep -vE '^_(main|manticore_cli_argc|manticore_cli_argv)$' \
| awk '{name=$1; sub(/^_/, "", name); print "void* "name"() { return 0; }"}' >> "$STUBS_C" \
|| trueOn Linux, errors are not prefixed with underscore, and double quotes are not used.
On a container set without locales, we get a backtick:
$ clang /tmp/seed/seed.o -o /dev/null
/usr/bin/ld: /tmp/seed/seed.o: in function `manticore_Runtime_Pcre_compile':
mir:(.text+0x36ae22): undefined reference to `pcre2_compile_8'
/usr/bin/ld: /tmp/seed/seed.o: in function `manticore_Runtime_Pcre_matchDataCreate':
mir:(.text+0x36ae32): undefined reference to `pcre2_match_data_create_from_pattern_8'
/usr/bin/ld: /tmp/seed/seed.o: in function `manticore_Runtime_Pcre_exec':
mir:(.text+0x36ae4b): undefined reference to `pcre2_match_8'
/usr/bin/ld: /tmp/seed/seed.o: in function `manticore_Runtime_Pcre_ovectorPtr':
mir:(.text+0x36ae62): undefined reference to `pcre2_get_ovector_pointer_8'
/usr/bin/ld: /tmp/seed/seed.o: in function `manticore_Runtime_Pcre_ovectorCount':
mir:(.text+0x36ae72): undefined reference to `pcre2_get_ovector_count_8'
/usr/bin/ld: /tmp/seed/seed.o: in function `manticore_Runtime_Pcre_matchDataFree':
mir:(.text+0x36ae82): undefined reference to `pcre2_match_data_free_8'
/usr/bin/ld: /tmp/seed/seed.o: in function `manticore_Runtime_Pcre_codeFree':
mir:(.text+0x36ae92): undefined reference to `pcre2_code_free_8'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
With french locales, we get french quotes:
$ clang seed.o -o /dev/null
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : seed.o : dans la fonction « manticore_Runtime_Pcre_compile » :
mir:(.text+0x3f0651) : référence indéfinie vers « pcre2_compile_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : seed.o : dans la fonction « manticore_Runtime_Pcre_matchDataCreate » :
mir:(.text+0x3f0661) : référence indéfinie vers « pcre2_match_data_create_from_pattern_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : seed.o : dans la fonction « manticore_Runtime_Pcre_exec » :
mir:(.text+0x3f0671) : référence indéfinie vers « pcre2_match_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : seed.o : dans la fonction « manticore_Runtime_Pcre_ovectorPtr » :
mir:(.text+0x3f0681) : référence indéfinie vers « pcre2_get_ovector_pointer_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : seed.o : dans la fonction « manticore_Runtime_Pcre_ovectorCount » :
mir:(.text+0x3f0691) : référence indéfinie vers « pcre2_get_ovector_count_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : seed.o : dans la fonction « manticore_Runtime_Pcre_matchDataFree » :
mir:(.text+0x3f06a2) : référence indéfinie vers « pcre2_match_data_free_8 »
/nix/store/39lyf5g2iz4jd2r6q4g5whk9vw09zglj-binutils-2.46/bin/ld.bfd : seed.o : dans la fonction « manticore_Runtime_Pcre_codeFree » :
mir:(.text+0x3f06b2) : référence indéfinie vers « pcre2_code_free_8 »
...
Workaround
An alternative way to generate the stub that should work when locales are not set (or set to ~english):
echo "$LINK_ERR" \
| grep 'undefined reference to' \
| grep -Po "[a-zA-Z0-9_]+'$" \
| sed 's/.$//' \
| sort -u \
| grep -vE '^_(main|manticore_cli_argc|manticore_cli_argv)$' \
| awk '{name=$1; print "void* "name"() { return 0; }"}' > "$STUBS_C" \
|| trueFiles that must be updated:
./bin/compile./tools/selfhost.sh./tools/link_stubs.sh
Activity
[-]Bootstrapping on Linux is broken because seed_stubs.c is not properly generated[/-][+]`$STUBS_C` generation is broken on Linux[/+][-]`$STUBS_C` generation is broken on Linux[/-][+]`$LINK_ERR` -> `$STUBS_C` generation is broken on Linux[/+]blacktrs commentedon Jul 20, 2026
Thanks for the report and suggestion. I plan to fix Docker builds soon
Docker/Linux: one portable undefined-symbol extractor, unified image,…
Merge dockerlinux: issue #1 Linux linker portability + unified Docker…
emit: fix isNonRcScalarKind param type (string kind, not int) — unbre…
blacktrs commentedon Jul 24, 2026
Linux should be mostly fixed now
serialize Ф7: __debugInfo drives var_dump
aliasing: a slot two frames disagree about has one representation, an…