This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: arm-elf-gcc vs arm-elf-c++


>-----Original Message-----
>From: Daniel.Andersson@combitechsystems.com
>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
is
>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.

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


**********************************************************************
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.

www.mimesweeper.com
**********************************************************************

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]