public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] link error due to unwanted exception support
@ 2005-05-13 19:05 Will Wagner
  2005-05-13 19:33 ` Gary Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: Will Wagner @ 2005-05-13 19:05 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I want to write a very simple C application that uses the minimal 
template. This means that it has no heap and so no malloc/free.

When linking my application I get this error:

/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(del_op.o)(.t
ext+0x14): In function `operator delete(void*)':
: undefined reference to `free'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(eh_alloc.o)(
.text+0x98): In function `__cxa_allocate_exception':
: undefined reference to `malloc'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(eh_alloc.o)(
.text+0x29c): In function `__cxa_free_exception':
: undefined reference to `free'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(eh_globals.o
)(.text+0x54): In function `get_globals_dtor(void*)':
: undefined reference to `free'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(eh_globals.o
)(.text+0x28c): In function `__cxa_get_globals':
: undefined reference to `malloc'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x480): 
In function
`__register_frame':
: undefined reference to `malloc'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x594): 
In function
`__register_frame_table':
: undefined reference to `malloc'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x6c4): 
In function
`__deregister_frame_info_bases':
: undefined reference to `free'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x760): 
In function
`__deregister_frame':
: undefined reference to `free'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x167c): 
In function
  `init_object':
: undefined reference to `malloc'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x169c): 
In function
  `init_object':
: undefined reference to `malloc'
/opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x180c): 
In function
  `init_object':
: undefined reference to `free'

I have no need for exception support and I'm compiling everything with 
-fno-exceptions so why is it trying to link in these functions for 
exception handling?

What compiler options do i need other than -fno-exceptions to remove 
exception support?

I have managed to fix it temporarily by manually removing libsupc++.a 
from the GROUPS entry in target.ld but as the file is autogenerated this 
is a really bad solution.

Can anyone suggest what I'm doing wrong?

Many thanks,

Will Wagner


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] link error due to unwanted exception support
  2005-05-13 19:05 [ECOS] link error due to unwanted exception support Will Wagner
@ 2005-05-13 19:33 ` Gary Thomas
  2005-05-16 12:41   ` Will Wagner
  0 siblings, 1 reply; 4+ messages in thread
From: Gary Thomas @ 2005-05-13 19:33 UTC (permalink / raw)
  To: Will Wagner; +Cc: eCos Discussion

On Fri, 2005-05-13 at 18:41 +0100, Will Wagner wrote:
> Hi,
> 
> I want to write a very simple C application that uses the minimal 
> template. This means that it has no heap and so no malloc/free.
> 
> When linking my application I get this error:
> 
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(del_op.o)(.t
> ext+0x14): In function `operator delete(void*)':
> : undefined reference to `free'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(eh_alloc.o)(
> .text+0x98): In function `__cxa_allocate_exception':
> : undefined reference to `malloc'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(eh_alloc.o)(
> .text+0x29c): In function `__cxa_free_exception':
> : undefined reference to `free'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(eh_globals.o
> )(.text+0x54): In function `get_globals_dtor(void*)':
> : undefined reference to `free'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/../../../../powerpc-eabi/lib/nof/libsupc++.a(eh_globals.o
> )(.text+0x28c): In function `__cxa_get_globals':
> : undefined reference to `malloc'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x480): 
> In function
> `__register_frame':
> : undefined reference to `malloc'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x594): 
> In function
> `__register_frame_table':
> : undefined reference to `malloc'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x6c4): 
> In function
> `__deregister_frame_info_bases':
> : undefined reference to `free'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x760): 
> In function
> `__deregister_frame':
> : undefined reference to `free'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x167c): 
> In function
>   `init_object':
> : undefined reference to `malloc'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x169c): 
> In function
>   `init_object':
> : undefined reference to `malloc'
> /opt/ecos/gnutools/powerpc-eabi/lib/gcc-lib/powerpc-eabi/3.3.3/nof/libgcc.a(unwind-dw2-fde.o)(.text+0x180c): 
> In function
>   `init_object':
> : undefined reference to `free'
> 
> I have no need for exception support and I'm compiling everything with 
> -fno-exceptions so why is it trying to link in these functions for 
> exception handling?
> 
> What compiler options do i need other than -fno-exceptions to remove 
> exception support?
> 
> I have managed to fix it temporarily by manually removing libsupc++.a 
> from the GROUPS entry in target.ld but as the file is autogenerated this 
> is a really bad solution.
> 
> Can anyone suggest what I'm doing wrong?

What options did you use to compile your program?

Look in the examples directory for how to do this.  You can also
follow the instructions at
  http://www.mlbassoc.com/examples/


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] link error due to unwanted exception support
  2005-05-13 19:33 ` Gary Thomas
@ 2005-05-16 12:41   ` Will Wagner
  2005-05-16 19:42     ` Gary Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: Will Wagner @ 2005-05-16 12:41 UTC (permalink / raw)
  To: Gary Thomas; +Cc: eCos Discussion


> 
> What options did you use to compile your program?
> 
> Look in the examples directory for how to do this.  You can also
> follow the instructions at
>   http://www.mlbassoc.com/examples/
> 
> 

Thanks for the help.

My options are:
CXXFLAGS = -msoft-float -mcpu=860 -ffunction-sections -fdata-sections 
-finit-priority -fvtable-gc -fno-exceptions -Wall -W -Wpointer-arith 
-Wstrict-prototypes -Winline -Wno-deprecated -Woverloaded-virtual -g
LFLAGS   = -msoft-float -mcpu=860 -nostdlib -Wl,--gc-sections 
-Wl,-static -Ttarget.ld -L../ecos_kernel/minimal/install/lib -g

I have fixed my problem by working round the bit of rtti code I was 
using. I had been hoping to use rtti but not use exceptions but that 
doesn't seem to be possible. Should it be?

Many thnaks,

Will Wagner



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] link error due to unwanted exception support
  2005-05-16 12:41   ` Will Wagner
@ 2005-05-16 19:42     ` Gary Thomas
  0 siblings, 0 replies; 4+ messages in thread
From: Gary Thomas @ 2005-05-16 19:42 UTC (permalink / raw)
  To: Will Wagner; +Cc: eCos Discussion

On Mon, 2005-05-16 at 12:27 +0100, Will Wagner wrote:
> > 
> > What options did you use to compile your program?
> > 
> > Look in the examples directory for how to do this.  You can also
> > follow the instructions at
> >   http://www.mlbassoc.com/examples/
> > 
> > 
> 
> Thanks for the help.
> 
> My options are:
> CXXFLAGS = -msoft-float -mcpu=860 -ffunction-sections -fdata-sections 
> -finit-priority -fvtable-gc -fno-exceptions -Wall -W -Wpointer-arith 
> -Wstrict-prototypes -Winline -Wno-deprecated -Woverloaded-virtual -g
> LFLAGS   = -msoft-float -mcpu=860 -nostdlib -Wl,--gc-sections 
> -Wl,-static -Ttarget.ld -L../ecos_kernel/minimal/install/lib -g
> 
> I have fixed my problem by working round the bit of rtti code I was 
> using. I had been hoping to use rtti but not use exceptions but that 
> doesn't seem to be possible. Should it be?

I don't think so.  I'm pretty sure that RTTI support requires some
architecture+OS specific help which we don't provide.  We have certainly
used -fno-rtti in the kernel since Day 1, so I doubt that you'll have
much luck with it.

n.b. I'm not a C++ guru, so may answer may be inaccurate (as well as 
biased against such things)

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-16 12:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-13 19:05 [ECOS] link error due to unwanted exception support Will Wagner
2005-05-13 19:33 ` Gary Thomas
2005-05-16 12:41   ` Will Wagner
2005-05-16 19:42     ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).