Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-99108: Build the hashlib HACL* code as a static library. (fix wasm builds)#101917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpshead merged 4 commits intopython:mainfromgpshead:build/libhacl
Feb 14, 2023

Conversation

gpshead
Copy link
Member

@gpsheadgpshead commentedFeb 14, 2023
edited by bedevere-bot
Loading

A followup to#101707 which broke some builds. This builds HACL* as a library in one place.

This doesn't solve all the problems, the wasm-wasi build is fixed by this. The wasm-enscripten build is not. Because it has a linker that can't cope with the same .a file being listed twice on its command line and decides to ignorantly process that as two inputs with duplicate symbols.

@gpshead
Copy link
MemberAuthor

!buildbot wasm

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@gpshead for commit3c7e18e 🤖

The command will test the builders whose names match following regular expression:wasm

The builders matched are:

  • wasm32-wasi PR
  • wasm32-emscripten node (dynamic linking) PR
  • wasm32-emscripten node (pthreads) PR
  • wasm32-emscripten browser (dynamic linking, no tests) PR

@gpshead
Copy link
MemberAuthor

The wasm-wasi bot using llvm-ar to build libpython3.12.a appears happy with this.
The wasm-enscripten ones that useemscripten/emar to build libpython3.12.a still does not.

is this the problem? the .a file is showing up on the emcc linking command linetwice, is that really the source of the "duplicate" symbols?  is emcc thatdumb?
@gpshead
Copy link
MemberAuthor

!buildbot wasm

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@gpshead for commita5bb63e 🤖

The command will test the builders whose names match following regular expression:wasm

The builders matched are:

  • wasm32-wasi PR
  • wasm32-emscripten node (dynamic linking) PR
  • wasm32-emscripten node (pthreads) PR
  • wasm32-emscripten browser (dynamic linking, no tests) PR

@gpshead
Copy link
MemberAuthor

Emscriptenemcc which callswasm-ld winds up with a duplicate of-LModules/_hacl -lHacl_Streaming_SHA2 on its command line or a directModules/_hacl/libHacl_Streaming_SHA2.a on its command line (the emcc script turns the first into the latter regardless). And whatever version of enscripten wasm-ld this is... is brain dead and does not deduplicate input files. Thus reporting "duplicate symbol" because the same .a is listed twice. 💩

Real linkers (like clang and thus llvm's ld.lld) do not have a problem with this.

@gpsheadgpshead changed the titleBuild the hashlib HACL* code as a static library.gh:99108: Build the hashlib HACL* code as a static library.Feb 14, 2023
@gpsheadgpshead changed the titlegh:99108: Build the hashlib HACL* code as a static library.gh-99108: Build the hashlib HACL* code as a static library.Feb 14, 2023
@gpsheadgpshead marked this pull request as ready for reviewFebruary 14, 2023 22:44
@gpshead
Copy link
MemberAuthor

Realistically: We should probably just combine_sha256 and_sha512 into a single_sha2 module as another way to work around this. The .so files for each of those are carrying the code for both regardless given how we link the shared libraries.

@gpsheadgpshead changed the titlegh-99108: Build the hashlib HACL* code as a static library.gh-99108: Build the hashlib HACL* code as a static library. (fix wasm builds)Feb 14, 2023
@gpshead
Copy link
MemberAuthor

Realistically: We should probably just combine_sha256 and_sha512 into a single_sha2 module as another way to work around this. The .so files for each of those are carrying the code for both regardless given how we link the shared libraries.

I'll do that as its own follow on PR. This one at least addresses 2 of the 4 bot failures and defines the static library as we want regardless.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@brettcannonbrettcannonAwaiting requested review from brettcannon

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@gpshead@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp