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]
Other format: [Raw text]

RE: C++ on ppc


>-----Original Message-----
>From: Vermeulen Jan [mailto:Jan.Vermeulen@siemens.atea.be]
>Sent: 12 February 2002 13:03

>But when I try to do the same with the C++ program, it always complains
>about something depending on what commandline i use.
>
>For example: (2.95.3)
>[prompt]$ powerpc-eabi-g++ -nostdlib -nostartfiles -fno-builtin
>-Wl,-Tscript.ld,-N -o test test.cc
>in function 'LED::~LED(void)' :
>undefined reference to '__buildin_delete'
>in function 'main' :
>undefined reference to '__eabi'
>undefined reference to '__get_eh_context'
>collect2: ld returned 1 exit status
>
>I have a clue why this is so:
>The startfiles include code for setting up global 
>constructors/destructors.
>
>But we don't really need startup code, all the SPR's are already setup
>correctly.
>We just want our C++ program to be compiled to adress 0x2000 
>so we can run
>it.


  You should be able to use -fno-exceptions to fix the _eh_context
references, but remember your C++ code cannot then use "try" and "throw".

  You should also be able to use -mno-eabi to prevent the call to __eabi;
but that option was broken in at least some gcc versions, so if it doesn't
work, just rename 'main' to something else, and change the name in your
linker script vector0 to match.  The call to __eabi is inserted by the
compiler in any function called 'main', just using a name match.

  I'm not quite sure why there should be any reference to __builtin_delete
(*please* folks, copy and paste your error messages, don't retype them,
because I've never even once seen anyone do that and not make a mistake that
could be misleading) if you aren't actually calling new and delete, but I
suspect that what you might want is to *remove* the -fno-builtin; that way
you will get the builtin inline versions of the function actually placed
into your code, rather than being left with references to be filled by
external (i.e. non-builtin) functions.  I'm not quite sure about this bit -
try it and see.

        DaveK
-- 
Burn your ID card!  http://www.optional-identity.org.uk/
Help support the campaign, copy this into your .sig!


**********************************************************************
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@sources.redhat.com


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