Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

cross-gcc for ARM - weird error

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
turboscrew
Posts: 190
Joined: 2009-03-23 09:17
Location: Nokia (town), Finland

cross-gcc for ARM - weird error

#1 Post by turboscrew »

Does anyone know why this error, and what could I do:

arm-linux-gnueabihf-g++ -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -D__circle__ -DRASPPI=2 -I ../include -I ../addon -O -g -fno-exceptions -fno-rtti -std=c++0x -c -o serial.o serial.cpp
/tmp/ccfBYII7.s: Assembler messages:
/tmp/ccfBYII7.s:40: Error: immediate value out of range -- `bkpt #0x7FFB'
../Rules.mk:54: recipe for target 'serial.o' failed
make: *** [serial.o] Error 1
jaa@jaa-debian:~/workspace/test/circle$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc ( 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

That bkpt should be fine for ARMv7-A, and Linaro gcc 4.8.3 (on another machine) compiles that bkpt (in another program) without problems.
Whom/where should I contact for more info?
De-bugging is for sissies, real men do de-monstrations.

turboscrew
Posts: 190
Joined: 2009-03-23 09:17
Location: Nokia (town), Finland

Re: cross-gcc for ARM - weird error

#2 Post by turboscrew »

This works:
arm-none-eabi-g++ (4.8.4-1+11-1) 4.8.4 20141219 (release)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
De-bugging is for sissies, real men do de-monstrations.

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: cross-gcc for ARM - weird error

#3 Post by tomazzi »

turboscrew wrote:arm-linux-gnueabihf-g++ -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -D__circle__ -DRASPPI=2 -I ../include -I ../addon -O -g -fno-exceptions -fno-rtti -std=c++0x -c -o serial.o serial.cpp
turboscrew wrote:This works:
arm-none-eabi-g++
As a programmer 'with a 20 years of experience', you shouldn't ask about such things ... ;)

Anyway, the most probable reasons are:
1. C++11 bug (very likely). Btw, are You using C++11 for embedded applications? - really? (it has very poor compiler support even on an x86 arch, that is, there are lots of bugs...)
2. 'linux' os != 'none os'. Have You heard about 'calling convention' ? Hint: You've probably messed up the classes dependencies (*), especially, You should check system calls.
3. Compiler bug (with respect to (1) - rather unlikely).

(*) just guessing - C++11 has problems with keeping correct stack frames during switching between C and C++ calls.

Regards.

PS.
And of course, since Your code has a closed src, noone can verify if Your problem is reproducible ...

Edit:
One more thing, which is not necessarily obvious:
Just because another version of compiler didn't returned an error, it doesn't mean that the generated binary code is correct ->
You can always get an SIGILL from the kernel or Illegal Instrucion exception directly from the CPU's HW, f.e. when operating in wrong CPU mode... like f.e inside a FIQ routine (on ARM) ;)
/Edit
Odi profanum vulgus

Post Reply