Closed jrrk2 closed 2 years ago
In fact I'm absolute not specialist of Apple's computers. Maybe @jeanthom or @chenrui333 are more able to answer about that. Is it not possible to use this formula ? Or at least following this procedure to try to build manually?
When installed as a binary, it does work but the formula is outdated
The Homebrew formula uses the latest "stable" version of openFPGALoader. Sure it isn't the latest unstable version, but it should work well enough.
Your issue looks similar to this one: https://githubmemory.com/repo/libusb/libusb/issues/931 Can you try to add "-framework Security" to the CMakeLists.txt at the end of this line? https://github.com/trabucayre/openFPGALoader/blob/master/CMakeLists.txt#L174
@trabucayre The above mentioned issue is caused by static linking of libusb on macOS. Are we using static libs on other platforms?
yeah, looks like the HEAD build failed for me as well, brew install --HEAD openfpgaloader
(I am on a m1 machine)
Undefined symbols for architecture arm64:
"_SecTaskCopyValueForEntitlement", referenced from:
_darwin_detach_kernel_driver in libusb-1.0.a(darwin_usb.o)
"_SecTaskCreateFromSelf", referenced from:
_darwin_detach_kernel_driver in libusb-1.0.a(darwin_usb.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The Homebrew formula uses the latest "stable" version of openFPGALoader. Sure it isn't the latest unstable version, but it should work well enough.
I assume it's to use openFPGALoader with kintex and with new contributed boards so I suspect lastest stable is not enough...
@trabucayre The above mentioned issue is caused by static linking of libusb on macOS. Are we using static libs on other platforms?
On linux platforms: no (it's always possible to force using static libs but some distributions have stopped to provides .a). For windows I'm not sure but I think no.
I have checked all commits between v0.7.0 and HEAD. There is nothing about USB modifications... And no MAC computer to test.
Thanks for the tip, adding “-framework Security as Jean suggested did the trick. Now there only remains a runtime issue, “openFPGAloader is built without zlib support”. This is solved by reinstalling the home brew version of zlib.
@jrrk2 Thanks for trying this patch. I thought openFPGALoader had zlib on macOS already? What steps did you perform to get zlib decompression working?
All I did was (re)install the home brew version of zlib and then pkg-config picked it up.
I think we can close this issue?
I guess so, since it will be up to the Libusb maintener to fix it.
I don't think it's a libusb issue, We were statically linking libusb against openFPGALoader, which means we had to manually add the "Security" framework. #200 should fix everything by linking dynamically to libusb.
I'm agree I'm not sure it's a libusb issue, but it make sense to warn maintener to the need of this flag when it's used with static linking. I don't know policy with brew / macOS but when using pkg-config on linux box CFLAGS and LDFLAGS are filled with, as far I know, everything required to compile code.
According to https://github.com/libusb/libusb/issues/931, libusb has everything you need in its pkg-config description (see Ludovic Rousseau's comment). The issue was that we were manually doing the job of pkg-config by hardcoding the library path, compiler flags, etc.: https://github.com/trabucayre/openFPGALoader/blob/bbd755832df464326fe3614a257336ec47d31acd/CMakeLists.txt#L172-L181
Besides being a bad thing for all the things we discussed in this issue, it also prevents users with a different Homebrew prefix and MacPorts (another package manager for macOS) users from installing openFPGALoader without having to edit the CMakeLists.txt.
Sorry I have missed this aspect. So yes it's not something related to libusb. I everyone is okay I can close this issue?
@jeanthom since some time workflow fails for macos, but I'm unable to find howto fix it. Could you have a look? Thanks!
brew reinstall --build-from-source --verbose --debug openFPGAloader does not work on AppleSilicon under OSX 12.2.1
When installed as a binary, it does work but the formula is outdated. The actual error is in libusb which installs without errors, but when linked with openFPGAloader, fails with the following errors:
Undefined symbols for architecture arm64: "_SecTaskCopyValueForEntitlement", referenced from: _darwin_detach_kernel_driver in libusb-1.0.a(darwin_usb.o) "_SecTaskCreateFromSelf", referenced from: _darwin_detach_kernel_driver in libusb-1.0.a(darwin_usb.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
These functions seem to have been introduced at version 700 of the Interface to libusb. Perhaps that version is already obsolete for Monterey. Feel free to ignore this bug on grounds that the real problem is in libusb. Or do you think the problem should be raised with the HomeBrew authors ?