aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.91k stars 1.04k forks source link

cmake install to strip rpath #2976

Closed SergeyRyabinin closed 1 month ago

SergeyRyabinin commented 1 month ago

Issue #, if available: cmake does not strip RPATH

the original intent of having this "feature" was to fix cross-compilation:

When doing cross-compilation, linkers can link shared SDK with cross-compiled libraries (like libssl.so) from specified customer search paths. But these customer search paths are not written to SDK library as RPATH. Some linkers then don't know where to link libssl.so when linking an executable. This path fixes this specific problem.

From the original description, it seems to be our classic "FindCrypto" class of problems. Now that "FindCrypto" is fixed by removing the crypto (and using crypto methods from/through CRT library), this hack is not necessary anymore. Even more, it was and is harmful as it goes against regular development practices.

Description of changes: cmake to strip RPATH how it is typically expected. Issues with "some linkers" should be fixed in the environments where these "some linkers" exist and not pollute the generic expected way of things.

to fix the problem where some linkers can't find cross-compiled dependent libraries in customer paths when linking executables.

Check all that applies:

Check which platforms you have built SDK on to verify the correctness of this PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.