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

Build full-static LLVM tools binaries #216

Merged
merged 6 commits into from
Jul 22, 2024
Merged

Build full-static LLVM tools binaries #216

merged 6 commits into from
Jul 22, 2024

Conversation

shenhanc78
Copy link
Collaborator

@shenhanc78 shenhanc78 commented Jul 18, 2024

Previously, the binaries built when ENABLE_TOOL=LLVM are all dynamically linked, there are many .so dependencies that prevent the tool binaries from be deployed to other systems.

The change is also required when building release binaries.

After this change, the create_llvm_prof and other tools binaries will be fully static linked.

Previously, the binaries built when ENABLE_TOOL=LLVM are all
dynamically linked, there are many .so dependencies that prevent the
tool binaries from be deployed to other systems.

The change is also required when building release binaries.
@shenhanc78 shenhanc78 self-assigned this Jul 18, 2024
Copy link
Collaborator

@xur-llvm xur-llvm left a comment

Choose a reason for hiding this comment

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

Do we need to describe somewhere that the binary built will be statically linked?

@snehasish
Copy link
Collaborator

nit: It's not a fully static link and still depends on some basic shared libraries. Update the description to e.g. "Minimize shared libs ..." and so on?

Also for the future we could introduce a check in the CI which dumps the list of shared libs and expects that to be <= 7 (based on the commit description). What do you think?

@shenhanc78 shenhanc78 changed the title Build static llvm tool binaries. Minimize shared libs for llvm tool binaries Jul 18, 2024
@shenhanc78
Copy link
Collaborator Author

shenhanc78 commented Jul 18, 2024

nit: It's not a fully static link and still depends on some basic shared libraries. Update the description to e.g. "Minimize shared libs ..." and so on?

Done changing the PR title.

Also for the future we could introduce a check in the CI which dumps the list of shared libs and expects that to be <= 7 (based on the commit description). What do you think?

Sounds good, we can add the check in the CI action.

Copy link
Collaborator

@snehasish snehasish left a comment

Choose a reason for hiding this comment

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

LGTM.

Sounds good, we can add the check in the CI action.

Ok with me to add in a follow up if you want.

@xur-llvm
Copy link
Collaborator

xur-llvm commented Jul 18, 2024

Why can't we build fully static binary? too many changes?

@shenhanc78
Copy link
Collaborator Author

Why can't we build fully static binary? too many changes?

Yes we can. Experimented, and found that I can force a full static build adding "-static" to the linking command. Updated. PTAL.

@shenhanc78 shenhanc78 changed the title Minimize shared libs for llvm tool binaries Build full-static LLVM tools binaries Jul 19, 2024
@shenhanc78 shenhanc78 requested a review from xur-llvm July 19, 2024 21:47
Copy link
Collaborator

@xur-llvm xur-llvm left a comment

Choose a reason for hiding this comment

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

LGTM

@shenhanc78 shenhanc78 merged commit ad21603 into master Jul 22, 2024
2 checks passed
@shenhanc78 shenhanc78 deleted the static_build branch July 22, 2024 17:17
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