-
Notifications
You must be signed in to change notification settings - Fork 96
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
Linking issue since 5.1-1.8.0 #158
Comments
Hi @ctabin, Later I will give it a try to create a small reproducer and get back to you. |
Hi @ctabin, I attached a small reproducer. You can build it with the following command where vcpkg is located in the parent directory. cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build The library should build as is but as soon as you change the version in Linking is only an issue when building a library. For executables it works somehow. |
Hi @Werni2A, |
Hi, I tested again with I tried adding In case you have no suggestions what to do feel free to close this issue. I guess there is low value in leaving this open. Looks like I'm the only one having this issue anyway.
|
@Werni2A Thanks for the test. Obviously it seems related to At this point I don't have any idea about this issue neither :-( |
I played around with different ways and locations to specify PIC but without any success. 😞 For now I will use the older version and close this issue. Nonetheless, thank you for your time and maintaining this library. 😄 👍 |
I experienced the same issue, also via vcpkg building. I put an issue in vcpkg but they had difficulties reproducing the error. I "solved" this by letting my build system build libzippp.cpp itself, bypassing your cmake system and vcpkg and then it worked with the same source code file, so it is definitely something with how it is built. Note that I did not have to change anything in the build of zlib or other dependencies, these are still built by a standard vcpkg build (their tag 2023.02.24) so I'm pretty sure the problem is in your cmakelists files. I tried blaming there and saw there were recent changes, but didn't understand much. It could be just that vcpkg is behind on following your releases, maybe. |
Note: -fPIC is needed when an object or static library is linked into a shared library, but not when linked into an executable. As I understand it this is as the shared library can be located anywhere when linked into the executable at runtime. So that's why it only fails when linked into a .so file. |
The issue is there: Lines 27 to 31 in ec69c0d
This overwrites flags from the toolchain. |
Hi @dg0yt, Thanks for the analyze. Do you mind submitting a PR to solve it ? That would be great ! |
It is just adding |
Thanks a lot for fixing this! |
Host Environment
Failure logs
See https://github.com/Werni2A/OpenAllegroParser/runs/7693726908 for the full compile log.
Additional context
I tried to figure out which commit in vcpkg introduced the issue by fixing the baseline to a few 'interesting' commits. It happens that after incorporating microsoft/vcpkg#24885 my software does not link anymore. The major change was to bump the libzippp package, therefore I guess that the issue is located somewhere here.
Do you experience similar issues or am I doing something wrong?
The text was updated successfully, but these errors were encountered: