0

On a fresh install of Raspbian on my Raspberry Pi Zero, I had attempted to install dub to build an application to see if it ran on this machine. I successfully installed gdc and downloaded and extracted the ARM version of dub from dlang.org. But, whenever I run any variation of the dub command, it returns Illegal instruction and nothing else.

What could cause this behaviour, and what can be done to fix it? Thanks in advance!

tinfoilboy
  • 926
  • 10
  • 17
  • my guess would be maybe a 64 bit build you downloaded to a 32 bit processor but i don't actually know any of the specs here. can you just use the gdc directly and get hello world working at least? – Adam D. Ruppe Mar 14 '17 at 03:29
  • @AdamD.Ruppe, it does seem like gdc does work fine. Also, I don't believe that this is for ARM64 (as the download site does not state that it is for that). But in the event that it is, compiling dub from source does not work either, as it gives me an error with gdc after a little while of running. – tinfoilboy Mar 14 '17 at 03:32
  • So the pi zero has a different processor than the other pis, so I'm guessing it is a wrong compile flag... I doubt the dub maintainers have tested on the zero, they prolly have the pi 2. I don't know dub nor the pi zero well enough to give a sure answer, but I'd try doing a verbose compile and seeing what flags are there. Could be softfloat, could be cortex something... idk really, but adding or removing and flags you see and trying manually with your gdc might help. Best I can offer :S – Adam D. Ruppe Mar 14 '17 at 13:14
  • @AdamD.Ruppe I was actually starting to make a makefile for use with gdc, but there are also errors with the standard library, such as the `format` function not being defined. Could it be that the gdc debian repository is out of date? Weird thing is that on my Windows machine it compiles just fine. – tinfoilboy Mar 14 '17 at 14:06
  • Yes, in fact, I'm almost certain the repo is out of date... it might even be a D1 in the repo.... the gdcproject.org ones are a year old too but probably the best you can get without building yourself, give this one a try: http://gdcproject.org/downloads/binaries/6.3.0/arm-linux-gnueabi/gdc-6.3.0+2.068.2.tar.xz – Adam D. Ruppe Mar 14 '17 at 15:26
  • https://wiki.debian.org/RaspberryPi says the Zero can't use the armhf port so I guess you're using armel debian? If so you need to make sure to use the `arm-linux-gnueabi` binaries, not `arm-linux-gnueabihf`. It's possible that the dub binaries have been compiled for armhf and therefore won't work. I'd try to compile dub from source using your system GDC or with the binaries Adam linked to. – jpf Mar 14 '17 at 20:53
  • @jpf I also tried compiling dub with gdc, I got an error in the middle that didn't give any information. I suspect now that it might be out of date though. Also, I'm technically using Raspbian, which is based off of Debian. – tinfoilboy Mar 14 '17 at 20:56
  • @AdamD.Ruppe I successfully installed the version of gdb that you sent, added it to my path, and tried to run my makefile to build the D project. But, there is an error that occurs upon attempting to link the program. This error says that the library `liblto_plugin.so` cannot be opened. Though, this is strange, as I've checked and there is a .so file there with that corresponding name. – tinfoilboy Mar 14 '17 at 23:47
  • Where is the so file? Maybe it just isn't in the load path... – Adam D. Ruppe Mar 15 '17 at 02:59
  • @AdamD.Ruppe The `so` file is in the `libexec` directory of where I installed `gdc`. `/usr/bin/ld: /usr/local/lib/gdc-6.3.0/bin/../libexec/gcc/arm-unknown-linux-gnueabi/6.3.0/liblto_plugin.so: error loading plugin: /usr/local/lib/gdc-6.3.0/bin/../libexec/gcc/arm-unknown-linux-gnueabi/6.3.0/liblto_plugin.so: cannot open shared object file: No such file or directory` is the full error I get. I verified that, indeed there is an `so` file with that name in that directory. – tinfoilboy Mar 15 '17 at 03:23

0 Answers0