Repository navigation
bpo-43466: Use pkg-config with --static in the PY_UNSUPPORTED_OPENSSL_BUILD path in setup.py #25475
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2447,8 +2447,13 @@ def split_var(name, sep): | |
| # features like DSO engines or external OSSL providers don't work. | ||
| # Only tested on GCC and clang on X86_64. | ||
| if os.environ.get("PY_UNSUPPORTED_OPENSSL_BUILD") == "static": | ||
| import subprocess, shutil | ||
| pkgconfig = os.getenv("PKG_CONFIG", shutil.which("pkg-config")) | ||
| libs_out = subprocess.check_output( | ||
| [pkgconfig, "--static", "--libs-only-l", "openssl"]).decode() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are not taking
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is that logic in the configure script? I can try to adapt it
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's in an external autoconf-archive script called |
||
| openssl_libs_static = {v.strip() for v in libs_out.split("-l") if v.strip()} | ||
| extra_linker_args = [] | ||
| for lib in openssl_extension_kwargs["libraries"]: | ||
| for lib in openssl_libs_static: | ||
| # link statically | ||
| extra_linker_args.append(f"-l:lib{lib}.a") | ||
| # don't export symbols | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will give incorrect results on systems without pkg-config.
ax_check_openssl.m4works around missing pkg-config.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine, we don't support all platforms for this hack. We can fall back to the previous behaviour if there is no pkg-config