-
Notifications
You must be signed in to change notification settings - Fork 120
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
MinGW: Remove manual setting of library prefix/suffix #277
Conversation
- Use "lib{library}.dll.a" for import libraries - Use "{library.dll}" for shared libraries See msys2/MINGW-packages#20024 (comment)
I don't where does the issue come from, those are set by default by CMake, they shouldn't be added at all. |
My best guess is that this is because the CMake project declares itself as a OBJC/OBJCXX project, and CMake may not have sensible defaults for Objective-C on MSYS2/MINGW and friends. |
We should add support for MinGW for OBJC/OBJCXX to CMake. |
@qmfrederik Do you know which clang library has objc_alloc, objc_alloc_init and objc_allocWithZone symbols? |
These are not provided by clang, they are provided by libobjc2. |
I am trying to support OBJ/OBJCXX on CMake, but It fails with undefined reference to those symbols! |
@MehdiChinoune Have you got a small repo? libobjc2 does export those symbols. You also need to make sure you use the right clang parameters -- e.g. |
It's about this repo, I am testing your PR in MinGW-package |
Those symbols won’t be exported from anywhere until libobjc2 is built… |
The issue appears when building tests, but that occurs with LLVM/Clang 18.1.0-rc2. |
@MehdiChinoune Thanks for your patches for cmake (msys2/MINGW-packages#20028). I've removed the the hard-coded values for Can you confirm this is what you had in mind? |
Yes, fixing shared/import libraries suffix/prefix was the intention. |
06a7c38
to
e82addf
Compare
@MehdiChinoune I tried:
Long story short, I would leave it at this for now -- we can always revisit later and try to optimize things. |
@davidchisnall I think this is ready now -- long story short: there was a workaround to manually set the library prefix/suffix, but this is no longer needed as CMake in MSYS2 now knows about ObjC. Do you agree? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the caveat that I don't have a Windows machine to try this on, it looks fine.
Build looks green for MinGW CI, and I'm in favour of removing complexity from the build system if it is not essential. |
LINKER_LANGUAGE is a target property, It couldn't be passed by command. |
@MehdiChinoune Do you know which clang library has objc_alloc, objc_alloc_init and objc_allocWithZone symbols? You were right, they weren't being exported on Windows. I've included a fix for that in #280. |
We no longer need to manually set these suffixes/prefixes as CMake in MSYS2 now knows about Objective C. See msys2/MINGW-packages#20028 See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9244 See msys2/MINGW-packages#20024 (comment)
We no longer need to manually set these suffixes/prefixes as CMake in MSYS2 now knows about Objective C.
See msys2/MINGW-packages#20028
See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9244
See msys2/MINGW-packages#20024 (comment)
/cc @MehdiChinoune