public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Linker errors while linking ecos application with libc.a
@ 2005-06-22  9:27 Balasaravanan P
  2005-06-22 10:15 ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Balasaravanan P @ 2005-06-22  9:27 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I was linking my ecos application with libc.a. I received the
following linker errors.
I am not able to figure out a fix for this. 
Can anyone please let me know how this can be fixed?

"
GNU ld version 2.13.1 (eCosCentric)
libc.a(strtok.o): In function `strtok':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/str/strtok.c(.text+0xc8)
: undefined reference to `_libc_private_storage'
libc.a(rand.o): In function `rand':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/std/rand.c(.text+0x48):
undefined reference to `_libc_private_storage'
libc.a(rand.o): In function `srand':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/std/rand.c(.text+0x9c):
undefined reference to `_libc_private_storage'
libc.a(fclose.o): In function `_weak__flockfree':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fclose.c(.text+0x8
): undefined reference to `funlockfile'
libc.a(fclose.o): In function `fclose':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fclose.c(.text+0x2
c): undefined reference to `flockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fclose.c(.text+0x5
0): undefined reference to `funlockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fclose.c(.text+0x7
c): undefined reference to `funlockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fclose.c(.text+0x9
0): undefined reference to `close'
libc.a(fflush.o): In function `_flslbuf':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fflush.c(.text+0xc
): undefined reference to `ftrylockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fflush.c(.text+0x3
8): undefined reference to `funlockfile'
libc.a(fflush.o): In function `_flsobuf':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fflush.c(.text+0x6
8): undefined reference to `ftrylockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fflush.c(.text+0x9
8): undefined reference to `funlockfile'
libc.a(fflush.o): In function `fflush':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fflush.c(.text+0xe
4): undefined reference to `flockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fflush.c(.text+0x1
08): undefined reference to `funlockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fflush.c(.text+0x1
30): undefined reference to `funlockfile'
libc.a(fflush.o): In function `_fflush':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fflush.c(.text+0x1
d8): undefined reference to `lseek'
libc.a(fgetc.o): In function `fgetc':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fgetc.c(.text+0xc0
): undefined reference to `flockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fgetc.c(.text+0xd4
): undefined reference to `funlockfile'
libc.a(fopen.o): In function `fopen':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fopen.c:48: undefi
ned reference to `open'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/fopen.c:48: undefi
ned reference to `open'
libc.a(localtime.o): In function `tzset':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/time/localtime.c(.text+0
x844): undefined reference to `getenv'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/time/localtime.c(.text+0
x858): undefined reference to `pthread_mutex_lock'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/time/localtime.c(.text+0
x898): undefined reference to `pthread_mutex_unlock'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/time/localtime.c(.text+0
x904): undefined reference to `pthread_mutex_lock'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/time/localtime.c(.text+0
x93c): undefined reference to `pthread_mutex_unlock'
libc.a(localtime.o): In function `localtime':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/time/localtime.c(.text+0
xb50): undefined reference to `_libc_private_storage'
libc.a(offtime.o): In function `offtime':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/time/offtime.c(.text+0x3
44): undefined reference to `_libc_private_storage'
libc.a(isatty.o): In function `isatty':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/px/isatty.c(.text+0x10):
 undefined reference to `ioctl'
libc.a(time.o): In function `time':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/sys/time.c(.text+0x14):
undefined reference to `gettimeofday'
libc.a(_doprnt.o): In function `vfprintf':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_doprnt.c:205: und
efined reference to `flockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_doprnt.c:205: und
efined reference to `funlockfile'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_doprnt.c:205: und
efined reference to `funlockfile'
libc.a(_filbuf.o): In function `_filbuf':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_filbuf.c(.text+0x
7c): undefined reference to `read'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_filbuf.c(.text+0x
bc): undefined reference to `read'
libc.a(_flsbuf.o): In function `_flsbuf':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_flsbuf.c(.text+0x
dc): undefined reference to `write'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_flsbuf.c(.text+0x
140): undefined reference to `write'
libc.a(_flspbuf.o): In function `_flspbuf':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_flspbuf.c(.text+0
x50): undefined reference to `write'
libc.a(_iobproc.o): In function `_ioballoc':
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_iobproc.c(.text+0
x14): undefined reference to `pthread_mutex_lock'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_iobproc.c(.text+0
xb4): undefined reference to `pthread_mutex_unlock'
/amd/olympia/root/mnt/raid/home/nigel/sandbox/sde/lib/c/stdio/_iobproc.c(.text+0
x124): undefined reference to `pthread_mutex_unlock'
make: *** [build] Error 1

"

--
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] 7+ messages in thread

* Re: [ECOS] Linker errors while linking ecos application with libc.a
  2005-06-22  9:27 [ECOS] Linker errors while linking ecos application with libc.a Balasaravanan P
@ 2005-06-22 10:15 ` Andrew Lunn
  2005-06-22 10:34   ` Balasaravanan P
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2005-06-22 10:15 UTC (permalink / raw)
  To: Balasaravanan P; +Cc: ecos-discuss

On Wed, Jun 22, 2005 at 02:57:33PM +0530, Balasaravanan P wrote:
> Hi,
> 
> I was linking my ecos application with libc.a. I received the
> following linker errors.

eCos does not have a libc.a, so you should not be linking to it.

        Andrew

-- 
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] 7+ messages in thread

* Re: [ECOS] Linker errors while linking ecos application with libc.a
  2005-06-22 10:15 ` Andrew Lunn
@ 2005-06-22 10:34   ` Balasaravanan P
  2005-06-22 10:57     ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Balasaravanan P @ 2005-06-22 10:34 UTC (permalink / raw)
  To: Balasaravanan P, ecos-discuss

Basically I am using sprintf, strcmp, strcpy ...

If I am not linking libc.a I am receving lot of undefined errors for
all these functions.

Can you please tell me which library to be used to get the image built.

Regards,
Bala.


On 6/22/05, Andrew Lunn <andrew@lunn.ch> wrote:
> On Wed, Jun 22, 2005 at 02:57:33PM +0530, Balasaravanan P wrote:
> > Hi,
> >
> > I was linking my ecos application with libc.a. I received the
> > following linker errors.
> 
> eCos does not have a libc.a, so you should not be linking to it.
> 
>        Andrew
>

--
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] 7+ messages in thread

* Re: [ECOS] Linker errors while linking ecos application with libc.a
  2005-06-22 10:34   ` Balasaravanan P
@ 2005-06-22 10:57     ` Andrew Lunn
  2005-06-22 13:14       ` Balasaravanan P
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2005-06-22 10:57 UTC (permalink / raw)
  To: Balasaravanan P; +Cc: ecos-discuss

On Wed, Jun 22, 2005 at 04:04:13PM +0530, Balasaravanan P wrote:
> Basically I am using sprintf, strcmp, strcpy ...
> 
> If I am not linking libc.a I am receving lot of undefined errors for
> all these functions.

If eCos is configured to build these functions they will be in
libtarget.a.

Which template are you using. The minimal template does not have these
but the default template does.

        Andrew

-- 
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] 7+ messages in thread

* Re: [ECOS] Linker errors while linking ecos application with libc.a
  2005-06-22 10:57     ` Andrew Lunn
@ 2005-06-22 13:14       ` Balasaravanan P
  2005-06-22 18:55         ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Balasaravanan P @ 2005-06-22 13:14 UTC (permalink / raw)
  To: Balasaravanan P, ecos-discuss

Thanks Andrew,
I changed the template from kernel to default which provides most of
these functions.

But still one error persists for the call "localtime" in which it says
"localtime_r" undefined.

For this I tried enbling "Provide BSD compatiblity functions" & "Posix
time functions" & "localtime_r"  when I enable also these options
kernel is not building it says the following error

"
ecos-c/New/eCos/ecos-2.0/packages/language/c/libc/time/v2_0/src/strptime.cxx: In
   function `int match_string(const char**, const char**, int)':
/ecos-c/New/eCos/ecos-2.0/packages/language/c/libc/time/v2_0/src/strptime.cxx:87:
`
   strlen' undeclared (first use this function)
/ecos-c/New/eCos/ecos-2.0/packages/language/c/libc/time/v2_0/src/strptime.cxx:87:
(Each
   undeclared identifier is reported only once for each function it appears 
   in.)
/ecos-c/New/eCos/ecos-2.0/packages/language/c/libc/time/v2_0/src/strptime.cxx:89:
`
   strncasecmp' undeclared (first use this function)
make[1]: Leaving directory
`/ecos-c/New/eCos/Application/ecos_build/language/c/libc/time/v2_0'
make[1]: *** [src/strptime.o.d] Error 1
make: Leaving directory `/ecos-c/New/eCos/Application/ecos_build'
make: *** [build] Error 2
"
Please let me know if I had to enable any other options. 

Thanks,
Bala.


On 6/22/05, Andrew Lunn <andrew@lunn.ch> wrote:
> On Wed, Jun 22, 2005 at 04:04:13PM +0530, Balasaravanan P wrote:
> > Basically I am using sprintf, strcmp, strcpy ...
> >
> > If I am not linking libc.a I am receving lot of undefined errors for
> > all these functions.
> 
> If eCos is configured to build these functions they will be in
> libtarget.a.
> 
> Which template are you using. The minimal template does not have these
> but the default template does.
> 
>        Andrew
>

--
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] 7+ messages in thread

* Re: [ECOS] Linker errors while linking ecos application with libc.a
  2005-06-22 13:14       ` Balasaravanan P
@ 2005-06-22 18:55         ` Andrew Lunn
  2005-06-23  5:05           ` Balasaravanan P
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2005-06-22 18:55 UTC (permalink / raw)
  To: Balasaravanan P; +Cc: ecos-discuss

On Wed, Jun 22, 2005 at 06:43:54PM +0530, Balasaravanan P wrote:
> Thanks Andrew,
> I changed the template from kernel to default which provides most of
> these functions.
> 
> But still one error persists for the call "localtime" in which it says
> "localtime_r" undefined.

lunn@londo:~/eCos/work$ ecosconfig tree lunn@londo:~/eCos/work$ make -s
headers finished
build finished
lunn@londo:~/eCos/work$ ( cd language/c/libc/time/current/ ; make -s tests)
lunn@londo:~/eCos/work$ ./install/tests/language/c/libc/time/current/tests/localtime
INFO:<Starting tests from testcase /home/lunn/eCos/anoncvs-clean/packages/language/c/libc/time/current/tests/localtime.c for C library localtime() function>
PASS:<localtime test #1>
PASS:<localtime test #2>
PASS:<localtime Y2K test #3>
PASS:<localtime test #4>
EXIT:<Finished tests from testcase /home/lunn/eCos/anoncvs-clean/packages/language/c/libc/time/current/tests/localtime.c for C library localtime() function>

With the current anoncvs it should just work. There is no need to
change any configuration options.

        Andrew

-- 
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] 7+ messages in thread

* Re: [ECOS] Linker errors while linking ecos application with libc.a
  2005-06-22 18:55         ` Andrew Lunn
@ 2005-06-23  5:05           ` Balasaravanan P
  0 siblings, 0 replies; 7+ messages in thread
From: Balasaravanan P @ 2005-06-23  5:05 UTC (permalink / raw)
  To: Balasaravanan P, ecos-discuss

I am able to build the application now.

Actually the sting.h file was not included in the strptime.cxx in my
version of the file.

After including it, this works fine.

Thank you.
Bala.


On 6/23/05, Andrew Lunn <andrew@lunn.ch> wrote:
> On Wed, Jun 22, 2005 at 06:43:54PM +0530, Balasaravanan P wrote:
> > Thanks Andrew,
> > I changed the template from kernel to default which provides most of
> > these functions.
> >
> > But still one error persists for the call "localtime" in which it says
> > "localtime_r" undefined.
> 
> lunn@londo:~/eCos/work$ ecosconfig tree lunn@londo:~/eCos/work$ make -s
> headers finished
> build finished
> lunn@londo:~/eCos/work$ ( cd language/c/libc/time/current/ ; make -s tests)
> lunn@londo:~/eCos/work$ ./install/tests/language/c/libc/time/current/tests/localtime
> INFO:<Starting tests from testcase /home/lunn/eCos/anoncvs-clean/packages/language/c/libc/time/current/tests/localtime.c for C library localtime() function>
> PASS:<localtime test #1>
> PASS:<localtime test #2>
> PASS:<localtime Y2K test #3>
> PASS:<localtime test #4>
> EXIT:<Finished tests from testcase /home/lunn/eCos/anoncvs-clean/packages/language/c/libc/time/current/tests/localtime.c for C library localtime() function>
> 
> With the current anoncvs it should just work. There is no need to
> change any configuration options.
> 
>        Andrew
>

--
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] 7+ messages in thread

end of thread, other threads:[~2005-06-23  5:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-22  9:27 [ECOS] Linker errors while linking ecos application with libc.a Balasaravanan P
2005-06-22 10:15 ` Andrew Lunn
2005-06-22 10:34   ` Balasaravanan P
2005-06-22 10:57     ` Andrew Lunn
2005-06-22 13:14       ` Balasaravanan P
2005-06-22 18:55         ` Andrew Lunn
2005-06-23  5:05           ` Balasaravanan P

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