arm-elf-gcc vs arm-elf-c++

David Korn
Thu Jun 7 06:41:00 GMT 2001

>-----Original Message-----
>Sent: 07 June 2001 14:09

>Can anybody tell me why i get different result when i compile my code with
>arm-elf-gcc and arm-elf-c++. If i make using the gcc tool then everything
>fine and eCos and my other code runs fine on the board. However, if i use
>the arm-elf-g++ tool when i make then i can still get an executable (make
>without any errors) to download but it does run on the board. 

  On the whole, the main difference between <target>-gcc and <target>-g++
is the list of libraries they add to the link command, and the set of
predefined macros they choose.  To see the difference, try compiling your
code again, giving the '-v' option to gcc; this will make it print out the
exact commands that it passes to the component subprograms, such as ld.

  Probably the most important difference here is that using g++ instead of
gcc will automatically link in the standard C++ library (libstdc++.a); it
seems that your code breaks if it is linked against this library and works
OK if it isn't, so you'll have to do some further digging there.  One
possibility is that the static object c-tors and d-tors in libstdc++.a
aren't being called correctly when your code starts up: this often arises
on embedded systems when the application doesn't begin execution at the
'main' subroutine but at some arbitrary entry point elsewhere.

we are not seats or eyeballs or end users or consumers.
we are human beings - and our reach exceeds your grasp.
                    deal with it.                      - 

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list