-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
1.5 cross-compiled to mips32 openwrt 18.06 illegal instruction WITH_SYS_TREE=yes #1209
Comments
tried downgrading to tag v1.5 (there's an opkg for that version that works):
|
I went a bit further with disabling things and got a working mosquitto:
not sure yet what disabled feature made it work. |
version with websockets working:
|
That is caused by Have you figured out the part that was causing the problem? |
almost definitely a bad compiler for your target, or not enough/correct compiler options for your target/compiler pair. Try disabling mips16 generation if that's an option, it's often buggy. mosquitto is happily getting compiled for lots andlots of mips variants as part of the openwrt project. dockcross seems to be only targetting mips hard float too, which won't work on all targets |
@karlp I wouldn't think it's mips16 as the compiler has the @ralight As I mentioned, I've been able to get to a working version by disabling all features I could except for the one I really wanted (websockets). It has to be one of these:
Most likely WITH_PERSISTENCE? perhaps trying to write somewhere it's not supposed to? My next steps should be to get a gdb installed and compile with debugging so I can figure out precisely which line fails. the hardware manufacturer repo does not have gdb as part of its openwrt 18.06 packages so not sure how to proceed yet (https://www.gl-inet.com/products/gl-usb150/) except to also cross-compile gdb... |
Karl is right though, this is highly unlikely to be anything other than a compilation problem. SIGILL occurs if the CPU instruction is invalid, which isn't something that I have any control over, it's just the compiler. |
-mips32 just means "Equivalent to -march=mips32." it's completely orthogonal to "-mips16 Is there any reason you're trying to use some magical docker cross compile thing instead of the openwrt buildroot that your platform expects/provides? gl.inet devices are supported in openwrt upstream, and they're regarded as a "good" vendor (so no vendor tree required), is there any reason you can't just use the plain 18.06 release, with the packaged version of mosquitto as is? (which is 1.5.7 at present, I'm only just back from holidays and haven't gotten to updating it yet) |
THe bottom of http:https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/ has downloads for the imagebuilder and the SDK, which will give you a much better chance of successfully building packages for your target. downloads.openwrt.org has historical releases too, if you want to find one that more closely matches what you're running. I've just linked the latest release. |
@karlp my reason for building my own mosquitto is because the version that comes packaged does not support mqtt to websockets which is the main functionality I require. I'll give a try to I don't have any idea how to build stuff using openwrt process. I was excited at even being able to do it using the cross-docker (much easier than last time I tried to cross-compile anything) so I'm not sure where to start with the openwrt build process. https://openwrt.org/docs/guide-user/additional-software/imagebuilder looks way more involved than single shot compiles. I don't really want to build whole images, just one or two pieces of software I care about. Although being able to build our own packages would be great, especially if we delve deeper into deploying some of our logic to microrouter. |
by process of elimination, I got it down to this flag: I ended up with this configuration setup:
...which runs fine. |
Could you try compiling and testing this example program? You'll need to rename it to .c, then compile with e.g. |
The version that comes packaged does support websockets. I package it. I use it daily. But ok. You don't have to use the image builder, I just listed that as an option. But use the SDK at least. You definitely have a problem with your cross compiler setup. Perhaps just https://openwrt.org/docs/guide-developer/crosscompile is enough if you really want to ignore things and do it by hand. I think you're still missing the core that the docker mips toolchain is targetting hardfloat. fwiw, here's the compiler options passed by the openwrt 1806 buildroot.
1.5.8 is getting updated for openwrt "right now" so it should even be available as a binary for you tomorrow morning. |
and crashes with Illegal instructions. I figured trying to compile for soft-float but that fails:
|
seems to be a much older package included in the openwrt in my image:
based off this: https://github.com/gl-inet/openwrt filed an issue with dockcross since -msoft-float seems unsupported: |
yes, as I said, that docker thing is very explicitly just targetting hardfloat. if you're working on openwrt, I strongly suggest you get used to it's tooling, you will save yourself (and others!) much heartache and time. Using a busted compiler will give you very random results. Also, unless you have a special need to use gl-inets tree, just use openwrt itself. All their hardware is normally supported upstream, they probably only have a tree for initial contributions. If you insist on using third party trees you will very quickly be on your own when it comes to getting support for them. And no, the -nossl build doesn't include websockets support. |
Ok, so if the test program which just uses doubles, fabs() and exp() fails then it's not a mosquitto problem so this issue can be closed? |
I'm going to follow up in two ways:
|
yes, this can be closed. nothing to do with mosquitto. (fwiw, mosquitto 1.5.8 has been pushed to both the 18.06 and master branches of openwrt though now) |
@karlp agreed. thanks for your help. |
@rngadam I believe I'm building on the same gl device as you and have been running into a ton of issues with soft/hardfloat. Did including the http:https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/openwrt-sdk-18.06.2-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz allow you to get past the following error: |
built from source, tried disabling most things:
crashes on start:
platform info
uname
openwrt
cpuinfo
The text was updated successfully, but these errors were encountered: