Skip to content
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

p5-net-ssleay: Work around macOS 12 dyld misfeature #12704

Merged
merged 1 commit into from
Oct 27, 2021

Conversation

markmentovai
Copy link
Contributor

Description

Attempting to load a file that does not exist (here,
/opt/local/libcrypto.dylib) will search the dyld shared cache by
filename, and return /usr/lib/libcrypto.dylib from the dyld shared
cache. That module is poisoned and has a load-time initializer that
calls abort(). There is no reason to attempt to load from /opt/local as
opposed to /opt/local/lib.

mark@sweet16 zsh% sw_vers
ProductName:	macOS
ProductVersion:	12.0.1
BuildVersion:	21A559
mark@sweet16 zsh% /opt/local/bin/perl5.28 Makefile.PL
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n]
*** Found OpenSSL-1.1.1l installed in /opt/local
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Checking if your kit is complete...
Looks good
WARNING: /opt/local/bin/perl5.28 is loading libcrypto in an unsafe way
zsh: abort      /opt/local/bin/perl5.28 Makefile.PL

Closes: https://trac.macports.org/ticket/63415

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 12.0.1 21A559 x86_64
Xcode 13.1 13A1030d

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

Attempting to load a file that does not exist (here,
/opt/local/libcrypto.dylib) will search the dyld shared cache by
filename, and return /usr/lib/libcrypto.dylib from the dyld shared
cache. That module is poisoned and has a load-time initializer that
calls abort(). There is no reason to attempt to load from /opt/local as
opposed to /opt/local/lib.

mark@sweet16 zsh% sw_vers
ProductName:	macOS
ProductVersion:	12.0.1
BuildVersion:	21A559
mark@sweet16 zsh% /opt/local/bin/perl5.28 Makefile.PL
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n]
*** Found OpenSSL-1.1.1l installed in /opt/local
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Checking if your kit is complete...
Looks good
WARNING: /opt/local/bin/perl5.28 is loading libcrypto in an unsafe way
zsh: abort      /opt/local/bin/perl5.28 Makefile.PL

Closes: https://trac.macports.org/ticket/63415
@danielluke
Copy link
Member

This looks good to me. I think we can also remove the openssl portgroup and stop setting OPENSSL_PREFIX. I'll test separately.

@danielluke danielluke merged commit 911ba56 into macports:master Oct 27, 2021
akiym added a commit to akiym/Crypt-OpenSSL-Guess that referenced this pull request Oct 28, 2021
Previously `openssl_lib_paths()` returned `"-L/usr/local/opt/openssl -L/usr/local/opt/openssl/lib"` in many cases.
However, in macOS 12 Monterey, this behavior causes an error when building: `perl is loading libcrypto in an unsafe way`
So `openssl_lib_paths()` now returns directories where libcrypto.dylib and libssl.dylib exist as library path.

See also macports/macports-ports#12704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants