Thread overview
GDC & BBB arm
Apr 19, 2015
Andrea Fontana
Apr 19, 2015
Johannes Pfau
Apr 20, 2015
Andrea Fontana
Apr 20, 2015
Andrea Fontana
April 19, 2015
Today I was playing around with my beagleboneblack.

Debian jessy: gdc can be installed it compiles source and output works.
So far so good. I'm planning to write a library to control input/output from board to make some experiments (my dream: write firmware for my custom 3d printer in d).

Anyway in order to speed up compilation, I'm trying to compile using a cross compiler from my linux machine

Following instructions found on wiki I built a compiler for arm-unknown-linux-gnueabi.

gcc works (with -static)
and
gdc works (with -static) but it gives a lot of warnings:

/home/andrea/x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/4.8.2/../../../../arm-unknown-linux-gnueabi/lib/libgphobos2.a(path.o): In function `_D3std4path16__T9buildPathTaZ9buildPathFNaNbNfAxAaXAya':
/opt/bbb/.build/src/gcc-custom/libphobos/src/std/path.d:2929: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/andrea/x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/4.8.2/../../../../arm-unknown-linux-gnueabi/lib/libgphobos2.a(socket.o): In function `toImpl':
/opt/bbb/.build/src/gcc-custom/libphobos/src/std/socket.d:347: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/andrea/x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/4.8.2/../../../../arm-unknown-linux-gnueabi/lib/libgphobos2.a(socket.o): In function `getHostNoSync':
/opt/bbb/.build/src/gcc-custom/libphobos/src/std/socket.d:739: warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/bbb/.build/src/gcc-custom/libphobos/src/std/socket.d:738: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/andrea/x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/4.8.2/../../../../arm-unknown-linux-gnueabi/lib/libgphobos2.a(socket.o): In function `_D3std6format65__T14formatUnsignedTS3std5array20__T8AppenderTAyaTyaZ8AppenderTaZ14formatUnsignedFNaNbNfS3std5array20__T8AppenderTAyaTyaZ8AppendermKS3std6format18__T10FormatSpecTaZ10FormatSpeckbZv':
/opt/bbb/.build/src/gcc-custom/libphobos/src/std/socket.d:474: warning: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/bbb/.build/src/gcc-custom/libphobos/src/std/socket.d:461: warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/andrea/x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/4.8.2/../../../../arm-unknown-linux-gnueabi/lib/libgphobos2.a(socket.o): In function `_D3std6socket7Service16getServiceByNameMFxAaxAaZb':
/opt/bbb/.build/src/gcc-custom/libphobos/src/std/socket.d:563: warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/andrea/x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/4.8.2/../../../../arm-unknown-linux-gnueabi/lib/libgphobos2.a(socket.o): In function `_D3std6socket7Service16getServiceByPortMFtxAaZb':
/opt/bbb/.build/src/gcc-custom/libphobos/src/std/socket.d:575: warning: Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

using instead arm-unknown-linux-gnueabihf (that it's the right target, i guess) I can't cross-compile gcc+gdc (but gcc, alone, works!). Here the error:

[ALL  ]    checking for cosl... /opt/bbb/.build/arm-unknown-linux-gnueabihf/build/build-cc-final/./gcc/xgcc -B/opt/bbb/.build/arm-u
nknown-linux-gnueabihf/build/build-cc-final/./gcc/ -B/home/andrea/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/b
in/ -B/home/andrea/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/lib/ -isystem /home/andrea/x-tools/arm-unknown-l
inux-gnueabihf/arm-unknown-linux-gnueabihf/include -isystem /home/andrea/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnue
abihf/sys-include    -o core/threadasm.o -DHAVE_CONFIG_H -I ../ -I /opt/bbb/.build/src/gcc-custom/libphobos/libdruntime/gcc -I /opt
/bbb/.build/src/gcc-custom/libphobos/libdruntime/../zlib -g -Os -c /opt/bbb/.build/src/gcc-custom/libphobos/libdruntime/core/thread
asm.S
[ALL  ]    /opt/bbb/.build/src/gcc-custom/libphobos/libdruntime/core/threadasm.S: Assembler messages:
[ALL  ]    /opt/bbb/.build/src/gcc-custom/libphobos/libdruntime/core/threadasm.S:398: Error: selected processor does not support AR
M mode `vpush {d8-d15}'
[ALL  ]    /opt/bbb/.build/src/gcc-custom/libphobos/libdruntime/core/threadasm.S:402: Error: selected processor does not support AR
M mode `vpop {d8-d15}'
[ERROR]    make[5]: *** [core/threadasm.o] Error 1
[ALL  ]    make[5]: *** Waiting for unfinished jobs....


First: It's a known bug? I didn't find anything about it on bug tracker.
Second: why if i compile without -static flag when I try to run my test it says "file not found"? Am I missing any library on my bbb? Can I fix it?
April 19, 2015
Am Sun, 19 Apr 2015 16:29:41 +0000
schrieb "Andrea Fontana" <nospam@example.com>:

> First: It's a known bug? I didn't find anything about it on bug tracker.

You need to compile with --with-fpu=vfp (in crosstool-NG select the
correct FPU). (or any other supported fpu variant)

IIRC this is some GCC/binutils bug. vfp is the oldest supported and default fpu in gcc anyway. But binutils defaults to an older fpu target and gcc only passes the correct parameters when explicitly setting --with-fpu.

> Second: why if i compile without -static flag when I try to run my test it says "file not found"? Am I missing any library on my bbb? Can I fix it?

Never tried -static so I can't say anything about this.
April 20, 2015
On Sunday, 19 April 2015 at 17:39:43 UTC, Johannes Pfau wrote:
> Am Sun, 19 Apr 2015 16:29:41 +0000
> schrieb "Andrea Fontana" <nospam@example.com>:
>
>> First: It's a known bug? I didn't find anything about it on bug tracker.
>
> You need to compile with --with-fpu=vfp (in crosstool-NG select the
> correct FPU). (or any other supported fpu variant)
>
> IIRC this is some GCC/binutils bug. vfp is the oldest supported and
> default fpu in gcc anyway. But binutils defaults to an older fpu target
> and gcc only passes the correct parameters when explicitly setting
> --with-fpu.

Ok, I'll try tonight :)

>> Second: why if i compile without -static flag when I try to run my test it says "file not found"? Am I missing any library on my bbb? Can I fix it?
>
> Never tried -static so I can't say anything about this.

It's the only way executable works. Maybe the reason is that system is linux-unknown-eabihf and compiler now create exec for linux-unknown-eabi so dynamic libraries won't match?

If tonight using --with-fpu it works, probably it isn't needed anymore.
April 20, 2015
On Monday, 20 April 2015 at 08:14:49 UTC, Andrea Fontana wrote:
>> You need to compile with --with-fpu=vfp (in crosstool-NG select the
>> correct FPU). (or any other supported fpu variant)

It works! Thanks.
On ct-ng menuconfig i used "neon" as fpu.