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

Allow static and shared libs to be mixed (take 2) #3484

Merged
merged 9 commits into from
Sep 15, 2022

Conversation

graebm
Copy link
Contributor

@graebm graebm commented Sep 10, 2022

This was previously reviewed here: #3467
That was merged to main, but then it broke many other tests, so the commit was reverted.
This PR is exactly the same thing, except LD_LIBRARY_PATH is no longer being tampered with.

I've run the s2nOmnibus tests on this branch, and they're all passing.

Resolved issues:

This is part of a fix for an issue from another repo: aws4embeddedlinux/meta-aws#191

Description of changes:

Currently, users cannot build a shared lib that uses a static libs2n.a, and they cannot build a static lib that uses a shared libs2n.so.

With this change, a library can use either static libs2n.a or shared libs2n.so. If both are static and shared libs2n are installed, BUILD_SHARED_LIBS serves as a tie-breaker.

Testing:

Added new unit test.

Did local testing:

  • installed static libs2n.a and then built a shared library that used it.
  • installed shared libs2n.so and then built a static library that used it.
  • installed BOTH static libs2n.a and shared libs2n.so
    • Built my own shared library and confirmed that it used picked libs2n.so
    • Built my own static library and confirmed that it picked libs2n.a
  • CodeBuild ad-hoc job

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The previous merge to mainline broke other tests. This is the same thing as last time, but only tweak LD_LIBRARY_PATH in my one new test, instead of in ALL of them.
@graebm graebm marked this pull request as ready for review September 14, 2022 14:21
@graebm graebm requested review from dougch and a team as code owners September 14, 2022 14:21
Copy link
Contributor

@dougch dougch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passed locally and in ad-hoc CodeBuild job.

@dougch dougch enabled auto-merge (squash) September 15, 2022 16:19
@dougch dougch merged commit 4363412 into aws:main Sep 15, 2022
@graebm graebm deleted the static-shared-mix-2 branch September 15, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants