Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.3k
Description
Bug report
Bug description:
This appears to be a regression: in our static musl packaging, Python3.13 built successfully, but failures started in3.14 and are still present in3.15.0a7.
When building CPython3.15.0a7 as a fully static musl target, final linking ofpython andPrograms/_testembed fails with duplicate_Py_LibHacl_* symbols.
The link command includes severalModules/_hacl/*.o files twice, thenld reports multiple definitions for symbols from those objects.
I knowx86_64-unknown-linux-musl is not a PEP 11 supported tier, but this looks like a generic linker-input duplication issue in the HACL link flags (similar class to#133042), not musl-specific behavior.
Reproduction:
I’m reproducing this from nixpkgs static Python packaging, but the relevant configure mode is:
./configure \ --disable-shared \ --enable-static \ --host=x86_64-unknown-linux-musl \ --build=x86_64-unknown-linux-gnu \ --with-lto \ LDFLAGS=-static \ MODULE_BUILDTYPE=static \ ac_cv_func_dlopen=nomake -j
Build fails while linkingpython andPrograms/_testembed.
Evidence from build log:
Configure/version context:
- source:
Python-3.15.0a7 - host:
x86_64-unknown-linux-musl - compiler:
x86_64-unknown-linux-musl-gcc - static build mode:
--enable-static --disable-shared LDFLAGS=-static MODULE_BUILDTYPE=static
In both-o python and-o Programs/_testembed link commands, these appear twice:
Modules/_hacl/Hacl_Hash_MD5.oModules/_hacl/Hacl_Hash_SHA1.oModules/_hacl/Hacl_Hash_SHA2.oModules/_hacl/Hacl_Hash_SHA3.oModules/_hacl/Hacl_Hash_Blake2s.oModules/_hacl/Hacl_Hash_Blake2b.oModules/_hacl/Lib_Memzero0.oModules/_hacl/Hacl_Hash_Blake2s_Simd128.oModules/_hacl/Hacl_Hash_Blake2b_Simd256.oObject count summary from the-o python line:
- total HACL objects passed:
20 - unique HACL objects:
11 - 9 hash/memzero objects are each passed exactly twice
Hacl_HMAC.oandHacl_Streaming_HMAC.oappear once
Example linker failures:
ld: Modules/_hacl/Hacl_Hash_MD5.o: multiple definition of `_Py_LibHacl_Hacl_Hash_MD5_init'; ... first defined hereld: Modules/_hacl/Hacl_Hash_SHA1.o: multiple definition of `_Py_LibHacl_Hacl_Hash_SHA1_init'; ... first defined here...collect2: error: ld returned 1 exit statusmake: *** [Makefile:1151: python] Error 1make: *** [Makefile:1841: Programs/_testembed] Error 1Expected behavior:
Static builds should not duplicate identical HACL object files on the final link line forpython /_testembed.
Related issues/PRs:
- emscripten cross-compile wasm-ld: error: duplicate symbol
_Py_LibHacl_Hacl_Hash_*#133042 (duplicate_Py_LibHacl_*symbols in Emscripten builds) - gh-131298: eliminate HACL* static libraries for cryptographic modules #132438 (HACL link behavior changes)
- freeze cannot find Modules/_hacl/libHacl_Hash_*.o #145810 (ongoing HACL link dependency issues in freeze flow)
If useful, I can attach the full failing link command and full build log.
Note: This report was prepared with the help of Codex.
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status