René's URL Explorer Experiment


Title: Undefined references to HACL symbols when statically linking Python 3.12 · Issue #131298 · python/cpython · GitHub

Open Graph Title: Undefined references to HACL symbols when statically linking Python 3.12 · Issue #131298 · python/cpython

X Title: Undefined references to HACL symbols when statically linking Python 3.12 · Issue #131298 · python/cpython

Description: Bug report Bug description: I am developing an application that uses Python 3.12's static library (libpython3.12.a). Due to some restrictions, I am required to use a package manager to install Python and cannot compile it from source. Ad...

Open Graph Description: Bug report Bug description: I am developing an application that uses Python 3.12's static library (libpython3.12.a). Due to some restrictions, I am required to use a package manager to install Pyth...

X Description: Bug report Bug description: I am developing an application that uses Python 3.12's static library (libpython3.12.a). Due to some restrictions, I am required to use a package manager to install ...

Opengraph URL: https://github.com/python/cpython/issues/131298

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Undefined references to HACL symbols when statically linking Python 3.12","articleBody":"# Bug report\n\n### Bug description:\n\nI am developing an application that uses Python 3.12's static library (libpython3.12.a). Due to some restrictions, I am required to use a package manager to install Python and cannot compile it from source. Additionally, I can't use dynamic libraries, so I must link python statically.\n\nWhen linking libpython3.12.a to my project, I encounter undefined references to HACL (HACL*) symbols, such as:\n\n```bash\n/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/libpython3.12.a(sha2module.o): in function `update_256':\n(.text.unlikely+0x9ea): undefined reference to `python_hashlib_Hacl_Hash_SHA2_update_256'\n/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/libpython3.12.a(sha2module.o): in function `SHA512Type_copy':\n(.text.unlikely+0xcd3): undefined reference to `python_hashlib_Hacl_Hash_SHA2_copy_512'\n[etc.]\n```\n\nThese symbols appear to be related to the HACL library, which is included in Python 3.12's development. However, I cannot locate the corresponding object files or static libraries for HACL in the Python installation provided by the package manager.\n\nI was previously using python3.11 - which worked flawlessly -, however the dev package has been removed from apt and other similar package managers. For this specific reason, I had to upgrade.\n\nA quick note, the command `nm -gA /usr/lib/x86_64-linux-gnu/*.a 2\u003e/dev/null | grep python_hashlib_Hacl_Hash_SHA2_update_512` shows that these symbols are shipped with the static package: `/usr/lib/x86_64-linux-gnu/libpython3.12.a:sha2module.o: U python_hashlib_Hacl_Hash_SHA2_update_512`.\n\nSteps to Reproduce:\n1. Install Python 3.12 using your system's package manager (e.g., `apt` on Ubuntu).\n2. Attempt to statically link the Python static library `libpython3.12.a` into a C/C++ project.\n3. Observe linker errors related to undefined references to HACL symbols.\n\nExpected Behavior:\nThe static library libpython3.12.a should include all necessary dependencies, including HACL, or provide a way to link against HACL statically.\n\nActual Behavior:\nThe linker fails with undefined references to HACL symbols, as the required HACL objects or static libraries are not provided.\n\nQuestions:\n1. Are the HACL object files or static libraries supposed to be included in the Python 3.12 package from the package manager?\n2. If not, is there a recommended way to obtain the necessary HACL static library for linking with libpython3.12.a? And if so, is it possible to do so without having to compile Python or any other large project?\n3. Could this be an issue with the packaging of Python 3.12 in the package manager, or is it a broader issue with the static linking setup?\n4. My primary goal is to link python statically. If there isn't any solution available that follows the requirements of using a package manager, are there any work arounds to bypass the linker issue?\n\nThank you for your assistance.\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-132438\n* gh-133012\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/luis605","@type":"Person","name":"luis605"},"datePublished":"2025-03-15T17:56:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/131298/cpython/issues/131298"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7d24bbc0-cddf-7e15-8e2b-1b28448e4dbe
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id81D4:BAE66:398FDA:51C657:696A4592
html-safe-nonce5f871dfb5099de9ea4b83a6bbcf577c53c3d162d3b926c4f2f667cf1fad9aae9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUQ0OkJBRTY2OjM5OEZEQTo1MUM2NTc6Njk2QTQ1OTIiLCJ2aXNpdG9yX2lkIjoiMjg3MDAxMjQ2NDUzMjcwMjYxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace425b5fe5e88bbc2f8ad8baa5acb24b2669b7faf249cfcd56e40e71b129cfe96
hovercard-subject-tagissue:2922384904
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/131298/issue_layout
twitter:imagehttps://opengraph.githubassets.com/17aa4b413ded04370e3cfa6063d43d9a92dbb98b4d754a37e325bf30a45634b9/python/cpython/issues/131298
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/17aa4b413ded04370e3cfa6063d43d9a92dbb98b4d754a37e325bf30a45634b9/python/cpython/issues/131298
og:image:altBug report Bug description: I am developing an application that uses Python 3.12's static library (libpython3.12.a). Due to some restrictions, I am required to use a package manager to install Pyth...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameluis605
hostnamegithub.com
expected-hostnamegithub.com
None3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release63c426b30d262aba269ef14c40e3c817b384cd61
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/131298#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F131298
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F131298
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/131298
Reloadhttps://github.com/python/cpython/issues/131298
Reloadhttps://github.com/python/cpython/issues/131298
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/131298
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/131298
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/131298
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/131298
Undefined references to HACL symbols when statically linking Python 3.12https://github.com/python/cpython/issues/131298#top
buildThe build process and cross-buildhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22build%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/luis605
https://github.com/luis605
luis605https://github.com/luis605
on Mar 15, 2025https://github.com/python/cpython/issues/131298#issue-2922384904
gh-131298: eliminate HACL* static libraries for cryptographic modules #132438https://github.com/python/cpython/pull/132438
gh-131298: update Modules/Setup after HACL static linking changes #133012https://github.com/python/cpython/pull/133012
buildThe build process and cross-buildhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22build%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.