Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

libc.a compiled from CVS doesn't work for me

18 views
Skip to first unread message

Fabrizio Gennari

unread,
Mar 24, 2005, 10:05:59 AM3/24/05
to
I downloaded the latest CVS version of djgpp and compiled it (using
tools downladed in binary form drom a DJGPP mirror). But there was a
problem: every time a program linked with the newly-compiled libc.a, a
link error occurred.

libc.a:undefined reference to '_environ' (in crt1.c and spawnp.c)

Example: symify.c in djgpp/src/debug/common

In order t make things work, I replaced one line in src\libc\crt0\crt1.c

extern char **_environ;

with

char **_environ;

Is that the right thing to do? Or is there a cleaner fix?

By the way, some more files in djgpp CVS tree still do not compile, even
with this modification: v2load.c in djgpp/src/debug/common, and
go32-v2.c in djgpp/src/stub give an error "undefined reference to
'environ'".

Regards,
Fabrizio

Martin Str|mberg

unread,
Mar 24, 2005, 5:41:19 PM3/24/05
to
Fabrizio Gennari <fabri...@tiscalinet.noitspam> wrote:
> I downloaded the latest CVS version of djgpp and compiled it (using
> tools downladed in binary form drom a DJGPP mirror). But there was a
> problem: every time a program linked with the newly-compiled libc.a, a
> link error occurred.

> libc.a:undefined reference to '_environ' (in crt1.c and spawnp.c)

> Example: symify.c in djgpp/src/debug/common

> In order t make things work, I replaced one line in src\libc\crt0\crt1.c

> extern char **_environ;

> with

> char **_environ;

> Is that the right thing to do? Or is there a cleaner fix?

No. If you want to use the whole CVS you should use everything from
cvs. In this case you need lib/djgpp.djl (I think). But you should
really get everything.

(It is possible to selectively pick stuff, but then you shouldn't be
surprised if there are problems; e. g. the one you have right now.)


Right,

MartinS

Andris Pavenis

unread,
Mar 30, 2005, 1:19:20 AM3/30/05
to dj...@delorie.com
On Thursday 24 March 2005 17:05, Fabrizio Gennari wrote:
> I downloaded the latest CVS version of djgpp and compiled it (using
> tools downladed in binary form drom a DJGPP mirror). But there was a
> problem: every time a program linked with the newly-compiled libc.a, a
> link error occurred.
>
> libc.a:undefined reference to '_environ' (in crt1.c and spawnp.c)
>
> Example: symify.c in djgpp/src/debug/common
>
> In order t make things work, I replaced one line in src\libc\crt0\crt1.c
>
> extern char **_environ;
>
> with
>
> char **_environ;
>
> Is that the right thing to do? Or is there a cleaner fix?

Yes.

Download latest update of gcc-3.4.3 (or gcc-3.3.5 if You are stick with
gcc-3.3.X) for DJGPP, which I uploaded in begin of March. The linker script
is modified to provide _environ.

Andris

PS. It's highly recommended not to mix object files generated by this update
(and perhaps later versions) with ones generated by any earlier releases.
So You must rebuild them after upgrade.


0 new messages