-
Notifications
You must be signed in to change notification settings - Fork 6
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
d2xx cannot be cross compiled with CGO enabled with soft float #1
Comments
Thanks for the report, will check this ASAP. |
I think it's because you are using a toolchain built with emulated floating point. Can you confirm? |
Moved issue to where the problem lies. Do you need to support RPi Zero / RPi1? If not, can you try to build with arm=7? |
Maybe something like |
arm-linux-gnueabihf-gcc works for compilation. Can you try this instead of arm-linux-gnueabi-gcc and see if the executable runs? It'd be nice to add this to the website, it's quite an edge case but still it'd be nice to document. |
It is much easier than I thought thanks to @lutzky who gave the initial guidance at periph/d2xx#1 To choose your own compiler, set $CC before calling. To disable cgo, set CGO_ENABLED=0 before calling.
To confirm this is not a WSL issue, I checked on a plain Ubuntu box (Ubuntu 20.10, kernel Building with gcc-arm-linux-gnueabihf: WAlthough the build does work, the executable fails to run on the target system. strace says the following on my full program (which tries to control an ssd1306):
...and the following on the minimal program (which just does a
The target system in question is a Raspberri Pi Zero-W running ...this might mean that periph/bootstrap@288e17f is incorrect. |
As an immediate workaround to unblock you, you can selectively load drivers to skip periph.io/x/host/v3/ftdi. Here's pseudo code:
I'll do a test on a RPiZW later. |
FTR, I did a test on a FT232h on a RPi3 thus it used the static library just fine. So it looks like bcm2385 specific. |
To be clear, I'm not blocked, it's just a hobby project and v3.6.10 is perfectly fine. I just think it's super-useful for people to be able to cross-compile this stuff when targeting RPi0. Happy to help test solutions. |
I want to fix this as I want to make sure that things work going forward. I just tested on a Raspberry Pi Zero Wireless on Raspbian Buster Do you need cgo specifically for your project? I'm inclined to document that cgo is unsupported in this specific configuration as I can't imagine a reason someone would connect a FTDI chip on these... I'll add a build tag to optionally disable the driver, something like It's increasingly hard to buy a RPiZ and RPiZW. Many stores list them as out of stock or still limit to one board per order (or requires folks to buy a kit even when not needed). It's sad, I like the form factor. |
Ah, interesting! I indeed do not need cgo for this project. I had it enabled because I cargo-culted my build script from another project which uses https://github.com/d2r2/go-dht (which does need cgo). While that particular project no longer uses a display (it exports to prometheus instead), it did previously use an ssd1306 display. So that would be an example of a project which would both requrire cgo and periph's ssd1306 library. Indeed the worst part here is I don't think I'm using d2xx for anything, I had to look up what it's for. I think the cgo compatibility issue isn't new - just the dependency on d2xx. I apologize if I put this issue in the wrong repository. I'm happy RPis are produced relatively near to my part of the world, pimoroni and pihut have plenty of stock; the form factor is indeed lovely. |
Nothing in periph currently requires cgo beside https://periph.io/x/host/v3/ftdi. And only ftdi loads d2xx. You can use the ssd1306 package without cgo. Commit a5d3841 includes the |
Can confirm, building with Readers might note that this required running the following first:
Thank you for adding this functionality! |
My build uses
devices
(specifically ssd1306) and works fine with v3.6.10. However, upgrading to v3.6.11 adds a dependency ofperiph.io/x/d2xx v0.0.1
, which causes build failures on WSL. I'm cross-compiling like so:...and get the following errors:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should at least build successfully, like it did in v3.6.10.
Platform (please complete the following information):
Additional context
n/a
The text was updated successfully, but these errors were encountered: