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

[LIBTOMMATH] The static build library can not be included in a shared library in LINUX #22549

Closed
atopavirgil opened this issue Jan 16, 2022 · 5 comments
Assignees
Labels
depends:upstream-changes Waiting on a change to the upstream project Stale

Comments

@atopavirgil
Copy link

atopavirgil commented Jan 16, 2022

https://github.com/libtom/libtommath

The library build with VCPKG in Linux x64 can be included and works in another static library (as static library).
However if we try to create a shared library (which includes libtommath) we get this message:

libtommath.a(bn_mp_mul.o): relocation R_X86_64_PC32 against symbol `KARATSUBA_MUL_CUTOFF' can not be used when making a shared object; recompile with -fPIC

I suppose somwhere in the port the option must be included.

Triplet used:

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)

During the build using this triplet both static and dynamic libraries are created for libtommath but the program links with the static one.

@LilyWangLL LilyWangLL added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label Jan 17, 2022
@LilyWangLL LilyWangLL removed their assignment Jan 17, 2022
@atopavirgil
Copy link
Author

This is not a community-triplet issue (it may be for Android for which I added a sepparate issue). The main problem described here is that Building in Linux x64 which is an official supported configuration (not community) require changes in the PORT file ( adding -fPIC parameter). The sister library libtomcrypt has this parameter in port, libtommath it does not.
The Android problem may be different.

@LilyWangLL LilyWangLL added requires:repro The issue is not currently repro-able and removed category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. labels Jan 20, 2022
@LilyWangLL
Copy link
Contributor

This is not a community-triplet issue (it may be for Android for which I added a sepparate issue). The main problem described here is that Building in Linux x64 which is an official supported configuration (not community) require changes in the PORT file ( adding -fPIC parameter). The sister library libtomcrypt has this parameter in port, libtommath it does not. The Android problem may be different.

I will repro this issue locally and confirm it soon.

@LilyWangLL LilyWangLL self-assigned this Oct 21, 2022
@github-actions
Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added the Stale label Jul 18, 2023
@LilyWangLL LilyWangLL added depends:upstream-changes Waiting on a change to the upstream project and removed Stale requires:repro The issue is not currently repro-able labels Jul 31, 2023
@LilyWangLL
Copy link
Contributor

See the comment libtom/libtommath#523 (comment), this issue still exists when recompile with -fPIC.

Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added the Stale label Jun 29, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
depends:upstream-changes Waiting on a change to the upstream project Stale
Projects
None yet
Development

No branches or pull requests

2 participants