From 517bdbd0551f517d2c5f2e954a1c44476f396a88 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Wed, 22 Mar 2023 15:34:55 -0700 Subject: [PATCH] updates --- Makefile.frag | 11 +++++++++++ README.md | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile.frag b/Makefile.frag index 4eb26f5..266c3d6 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -16,8 +16,19 @@ ifneq (OFF,$(USE_OPENSSL)) ifneq (ON,$(USE_OPENSSL)) CMAKE_PREFIX_PATH=-DCMAKE_PREFIX_PATH=$(USE_OPENSSL) endif +else + # Hide symbols from libcrypto.a + # This avoids problems when an application ends up using both libcrypto.a and libcrypto.so. + # + # An example of this happening is the aws-c-io tests. + # All the C libs are compiled statically, but then a PKCS#11 library is + # loaded at runtime which happens to use libcrypto.so from OpenSSL. + # If the symbols from libcrypto.a aren't hidden, then SOME function calls use the libcrypto.a implementation + # and SOME function calls use the libcrypto.so implementation, and this mismatch leads to weird crashes. + EXTRA_LDFLAGS="-Wl,--exclude-libs,libcrypto.a" endif + CMAKE_CONFIGURE = $(CMAKE) \ -DCMAKE_SOURCE_DIR=$(srcdir) \ -DCMAKE_BINARY_DIR=$(CMAKE_BUILD_DIR) \ diff --git a/README.md b/README.md index b04c979..1b2478a 100644 --- a/README.md +++ b/README.md @@ -105,10 +105,9 @@ the system default php. See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information. -## Knowning OpenSSL related issue (Unix only) +## Known OpenSSL related issue (Unix only) -* With php5.5 and openssl-3.0.2, signing functions will not work -* When your php loads a different version of openssl than your system openssl version, awscrt may fail to load. +* When your php loads a different version of openssl than your system openssl version, awscrt may fail to load or weirdly crash. You can find the openssl version php linked via: `php -i | grep 'OpenSSL'`, and awscrt linked from the build log, which will be `Found OpenSSL: * (found version *)` The easiest workaround to those issue is to build from source and get aws-lc as libscrypto for awscrt to depend on instead of your local openssl. Same instructions as [here](#building-from-github-source), but use `USE_OPENSSL=OFF make` instead of `make`