Subject: Re: getting gcc-2.95.2 working
To: Simon Burge <simonb@wasabisystems.com>
From: Andrew Cagney <ac131313@cygnus.com>
List: port-macppc
Date: 07/05/2001 11:51:22
> Andrew Cagney wrote:
>
>
>> Using this patch, current GCC can at least configure and build
>> (.../configure ; gmake all-gdb). It barfs while trying to cross compile
>> some of the libraries vis:
>>
>> [ libiberty/strerror.c ]
>
>
> Note that we have the following change in the NetBSD tree (this is
> against binutils 2.11 but should be pretty much the same for gcc's
> libiberty):
FYI,
It was a red herring.
The compile barf was caused by a misconfigured multi-lib tree - it had
incorrectly guessed that the host didn't have sys_errlist[].
That in turn was caused by the just compiled GCC not having -D__ELF__ in
its list of definitions :-/
> Note that we have the following change in the NetBSD tree (this is
> against binutils 2.11 but should be pretty much the same for gcc's
> libiberty):
They should be identical. GCC's libiberty is the master. Any changes
are double committed to the binutils/gdb libiberty.
> Index: strerror.c
> ===================================================================
> RCS file: /cvsroot/gnusrc/gnu/dist/toolchain/libiberty/strerror.c,v
> retrieving revision 1.1.1.2
> retrieving revision 1.2
> diff -d -p -u -r1.1.1.2 -r1.2
> --- strerror.c 2001/04/23 12:28:30 1.1.1.2
> +++ strerror.c 2001/05/30 09:51:10 1.2
> @@ -463,7 +463,7 @@ static int num_error_names = 0;
> static int sys_nerr;
> static const char **sys_errlist;
>
> -#else
> +#elif !defined(__NetBSD__)
>
> extern int sys_nerr;
> extern char *sys_errlist[];
>
>
> I suspect this patch would break very old versions of NetBSD though.
It wouldn't be accepted either :-) To be honest, looking at strerror()
I'm thinking the code has a bit of an attitude problem. It insists on
using the name sys_errlist, even doing this results in the diging of an
ever deeper hole .... :-)
Andrew
Andrew