www.digitalmars.com         C & C++   DMDScript  

D.gnu - (Probably trivial) arm-none-eabi-gdc building problem

reply "denizzzka" <denis.feklushkin gmail.com> writes:
Hi!

I am tried to use step-by-step instructions from wiki 
(http://wiki.dlang.org/Bare_Metal_ARM_Cortex-M_GDC_Cross_Compiler) 
to build toolchain on Debian GNU/Linux 8 and got this error after 
execute "make -j4 all-target-libgcc":

checking for arm-none-eabi-lipo... arm-none-eabi-lipo
checking for arm-none-eabi-nm... 
/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/nm
checking for arm-none-eabi-ranlib... arm-none-eabi-ranlib
checking for arm-none-eabi-strip... arm-none-eabi-strip
checking whether ln -s works... yes
checking for arm-none-eabi-gcc...  
/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/xgcc 
-B/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/bin/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/lib/ 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/include 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/sys-include
checking for suffix of object files... configure: error: in 
`/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/arm-none-eabi/libgcc':
configure: error: cannot compute suffix of object files: cannot 
compile
See `config.log' for more details.

config.log:

Configured with: ../gcc-4.9.2/configure --target=arm-none-eabi 
--prefix=/home/denizzz/dembed/arm-none-eabi-gdc/result 
--enable-languages=d --disable-bootstrap --disable-libssp 
--disable-libgomp --disable-libmudflap --disable-libphobos 
--disable-decimal-float --disable-libffi --disable-libmudflap 
--disable-libquadmath --disable-libssp --disable-libstdcxx 
--disable-libstdcxx-pch --disable-nls --disable-shared 
--disable-threads --disable-tls --with-gnu-as --with-gnu-ld 
--with-mode=thumb --without-headers
Thread model: single
gcc version 4.9.2 (GCC)
configure:3373: $? = 0
configure:3362:  
/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/xgcc 
-B/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/bin/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/lib/ 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/include 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/sys-include 
    -V >&5
xgcc: error: unrecognized command line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3362:  
/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/xgcc 
-B/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/bin/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/lib/ 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/include 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/sys-include 
    -qversion >&5
xgcc: error: unrecognized command line option '-qversion'
xgcc: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3389:  
/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/xgcc 
-B/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/bin/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/lib/ 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/include 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/sys-include 
    -o conftest -g -O2   conftest.c  >&5
/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/as: 106: 
exec: -meabi=5: not found
configure:3392: $? = 1
configure:3580: checking for suffix of object files
configure:3602:  
/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/xgcc 
-B/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/bin/ 
-B/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/lib/ 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/include 
-isystem 
/home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/sys-include 
    -c -g -O2  conftest.c >&5
/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/./gcc/as: 106: 
exec: -meabi=5: not found
configure:3606: $? = 1

Why config trying to use deprecated gcc option -V?
How to fix this?

Same problem discussion on github:
https://github.com/JinShil/arm-none-eabi-gdc/issues/1
May 30 2015
next sibling parent "Timo Sintonen" <t.sintonen luukku.com> writes:
On Saturday, 30 May 2015 at 16:55:14 UTC, denizzzka wrote:
 Hi!

 I am tried to use step-by-step instructions from wiki 
 (http://wiki.dlang.org/Bare_Metal_ARM_Cortex-M_GDC_Cross_Compiler) 
 to build toolchain on Debian GNU/Linux 8 and got this error 
 after execute "make -j4 all-target-libgcc":
I did not read the whole thing but this:
 checking for suffix of object files... configure: error: in 
 `/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/arm-none-eabi/libgcc':
 configure: error: cannot compute suffix of object files: cannot 
 compile
 See `config.log' for more details.
may mean that target binutils are not installed or not found (arm-none-eabi-asm arm-none-eabi-ld etc) Another reason may be wrong configuration options that cause the intermediate compiler fail. The error message is a bit misleading. It means that something we just built does not run or does not find all it needs. Also I have found several times that using -j4 may be too much. One of the jobs may run too fast and does not find something the other jobs have not build yet. Using -j2 has always worked for me.
May 30 2015
prev sibling next sibling parent reply "Mike" <none none.com> writes:
On Saturday, 30 May 2015 at 16:55:14 UTC, denizzzka wrote:
 Hi!

 I am tried to use step-by-step instructions from wiki 
 (http://wiki.dlang.org/Bare_Metal_ARM_Cortex-M_GDC_Cross_Compiler) 
 to build toolchain on Debian GNU/Linux 8 and got this error 
 after execute "make -j4 all-target-libgcc":
[snip] I just wanted to let you know that in case you couldn't get a build on your host PC, there may be another way to get a GDC ARM Cortex-M cross-compiler. It has come to my attention that the prebuilt binaries at http://gdcproject.org/downloads are capable of creating ARM Cortex-M binaries. I just tested it myself. I used the arm-linux-gnueabihf build, and the command I used for my STM32F4 (ARM Cortex-M4F) was: arm-gdcproject-linux-gnueabi-gdc -fno-emit-moduleinfo -frelease -mthumb -mcpu=cortex-m4 -fdata-sections -ffunction-sections -c start.d The key is to simply add the platform flags: -mthumb -mcpu=cortex-m4 I hope that helps. Mike
Jun 03 2015
parent reply "Johannes Pfau" <nospam example.com> writes:
On Wednesday, 3 June 2015 at 10:50:26 UTC, Mike wrote:
 On Saturday, 30 May 2015 at 16:55:14 UTC, denizzzka wrote:
 Hi!

 I am tried to use step-by-step instructions from wiki 
 (http://wiki.dlang.org/Bare_Metal_ARM_Cortex-M_GDC_Cross_Compiler) 
 to build toolchain on Debian GNU/Linux 8 and got this error 
 after execute "make -j4 all-target-libgcc":
[snip] I just wanted to let you know that in case you couldn't get a build on your host PC, there may be another way to get a GDC ARM Cortex-M cross-compiler. It has come to my attention that the prebuilt binaries at http://gdcproject.org/downloads are capable of creating ARM Cortex-M binaries. I just tested it myself. I used the arm-linux-gnueabihf build, and the command I used for my STM32F4 (ARM Cortex-M4F) was: arm-gdcproject-linux-gnueabi-gdc -fno-emit-moduleinfo -frelease -mthumb -mcpu=cortex-m4 -fdata-sections -ffunction-sections -c start.d The key is to simply add the platform flags: -mthumb -mcpu=cortex-m4 I hope that helps. Mike
That's correct. All ARM GCC compilers can generate code for all ARM variants (the hf compiler can generate softfloat code and the softfloat compiler can generate hf code as well). The difference between the compilers are the shipped libraries. You probably can't use the shipped libgcc etc from these compilers for thumb targets.
Jun 03 2015
parent reply "Mike" <none none.com> writes:
On Wednesday, 3 June 2015 at 12:54:32 UTC, Johannes Pfau wrote:
 That's correct. All ARM GCC compilers can generate code for all 
 ARM variants (the hf compiler can generate softfloat code and 
 the softfloat compiler can generate hf code as well). The 
 difference between the compilers are the shipped libraries. You 
 probably can't use the shipped libgcc etc from these compilers 
 for thumb targets.
I was not aware of this, but it makes perfect sense. Would it be feasible to uses Timo's multilib instructions (http://forum.dlang.org/post/knajzsqzojwrogzafmst forum.dlang.org) to add support for the Cortex-M variants to the ARM pre-built binaries (excluding libphobos of course)? Also, are the build-scripts used for the pre-built binaries on GitHub?
Jun 03 2015
parent reply Johannes Pfau <nospam example.com> writes:
Am Thu, 04 Jun 2015 04:05:39 +0000
schrieb "Mike" <none none.com>:

 On Wednesday, 3 June 2015 at 12:54:32 UTC, Johannes Pfau wrote:
 That's correct. All ARM GCC compilers can generate code for all 
 ARM variants (the hf compiler can generate softfloat code and 
 the softfloat compiler can generate hf code as well). The 
 difference between the compilers are the shipped libraries. You 
 probably can't use the shipped libgcc etc from these compilers 
 for thumb targets.
I was not aware of this, but it makes perfect sense. Would it be feasible to uses Timo's multilib instructions (http://forum.dlang.org/post/knajzsqzojwrogzafmst forum.dlang.org) to add support for the Cortex-M variants to the ARM pre-built binaries (excluding libphobos of course)?
If you mean adding support to the same binary toolchain package: I don't think that will work. Multilib requires similar systems, it's probably not possible to mix linux+libphobos and baremetal builds. But we could of course provide additional ARM-bare-metal toolchain binaries.
 
 Also, are the build-scripts used for the pre-built binaries on 
 GitHub?
Not yet. Maybe I'll publish them this weekend (I need to write some documentation first)
Jun 04 2015
parent "Mike" <none none.com> writes:
On Thursday, 4 June 2015 at 18:35:45 UTC, Johannes Pfau wrote:

 If you mean adding support to the same binary toolchain 
 package: I don't think that will work. Multilib requires 
 similar systems, it's probably not possible to mix 
 linux+libphobos and baremetal builds.
Indeed. I completely glossed over the linux-gnueabi there.
 But we could of course provide additional ARM-bare-metal 
 toolchain binaries.
Given the post that started this thread, I think that would be great even if they didn't include libphobos or even a standard C library. Just having libgcc and the compiler would be a sufficient start in my opinion. Mike
Jun 04 2015
prev sibling parent "Jens Bauer" <doctor who.no> writes:
On Saturday, 30 May 2015 at 16:55:14 UTC, denizzzka wrote:
 Hi!
 {snip}
 /home/denizzz/dembed/arm-none-eabi-gdc/result/arm-none-eabi/sys-include
 checking for suffix of object files... configure: error: in 
 `/home/denizzz/dembed/arm-none-eabi-gdc/gcc-build/arm-none-eabi/libgcc':
 configure: error: cannot compute suffix of object files: cannot 
 compile
 See `config.log' for more details.
Usually this means that you need to set your PATH to point to your target binaries. This should normally be set right after you've installed binutils. It might be helpful to look at my PDF and build-script ... <http://d.gpio.dk/> It's made for Mac/PPC only. I've tried the build-script on Debian, but it fails (due to problems with ARM7TDMI).
Jun 05 2015