(Answer) (Category) Linux on PowerPC FAQ-O-Matic : (Category) Languages and Compilers :
Using egcs-1.1 with linuxppc R4 and mklinux DR3

> Hi,
> 
> Now I use generic-05 kernel (vmlinux, System.map, and Mach Kernel) under
> the environment below...
> 
> Power Macintosh G3 DT/233<br>
> 32MB Memory<br>
> glibc-*-0.961212-1m (From ftp://ftp.mklinux.apple.com/pub/contrib/JDK/ )
> kernel-headers-2.1.24-1 (From
ftp://ftp.linuxppc.org/pub/linuxppc/linuxppc-R4/RedHat/RPMS/ )
> egcs-*1.1.1pre+-11Nov (From
ftp://ppc.linux.or.jp/pub/users/fukui/egcs-1.1branch/ )
> 
> I can compile wget-1.5.3, but not excute it. Core file only says:
> #0  0x2ab21458 in ?? () from /lib/libc.so.6
> 
> I think glibc has MkLinux-specific problems. And I rebuilt glibc.
> Using rebuilt-glibc, I can excute wget.
> 
> But I cannot compile XEmacs with rebuilt-glibc. Core file created by
> $xemacs-21.2-b3/src/temacs says:
>
> #0  0x2b30d0d8 in __kill ()
> #1  0x187a178 in fatal_error_signal (sig=6) at emacs.c:262
> #2  <signal handler called>
> #3  0x2b30d0d8 in __kill ()
> #4  0x2b30dc74 in abort ()
> #5  0x2ab47d18 in __do_global_ctors_aux ()
> #6  0x2b3df988 in resbuf.48 ()
> #7  0x2b3068ec in __nss_hosts_lookup ()
> #8  0x2b372174 in gethostbyname_r ()
> #9  0x2b371d34 in gethostbyname ()
> #10 0x1971ab8 in init_system_name () at sysdep.c:2277
> #11 0x1873104 in init_editfns () at editfns.c:89
> #12 0x1878574 in xemacs_21_2_b3_powerpc_unknown_linux (argc=9, 
>     argv=0x7ffff884, envp=0x0, restart=0) at emacs.c:1606
> #13 0x187a40c in main (argc=0, argv=0x6, envp=0x0) at emacs.c:2115
> #14 0x183fe2c in _start ()
> 
> This problem occurs ONLY my machine?
> 
> 

No, unfortunately, it is not confined to your machine.  The libraries
used by linuxppc R4 and MkLinux DR3 are not compatible with the stock
egcs-1.1 as distributed by Cygnus.  The problem is that the libc 
libraries were built with a patch to egcs 1.0.2 which is not in egcs-1.1. 
Fixing the incompatibility will require that everything be replaced on 
your system.  Which means that you have to wait for linuxppc R5 (which 
will include a new mklinux kernel/server pair) to really solve the 
problem.  The stock egcs-1.1 compiler is not 100% compatible with the 
current libraries.  If you rebuild the libraries to work with egcs-1.1, 
then many programs compiled against the old libraries will not work with 
the new libraries.

Here are your options:

1) At least some of the problems can be worked around by adding
-lresolv to the list of libraries to link to the program you are
building.

2) Revert to the egcs-1.0.2 compiler distributed with linuxppc R4 or
mklinux DR3.

3) Use the trampoline patch from the egcs-1.0.2 rpm distributed with 
linuxppc R4 and mklinux DR3 to rebuild egcs-1.1 so that it is compatible 
with your current libraries.

4) Rebuild everything on the system from scratch with the unpatched
compiler.  (Or just wait for linuxppc R5.)

A version of the egcs-1.1 has been built which contains the trampoline 
patch so that it can be used with the current libraries.  This is only 
a _temporary_ solution for the problem.  Anything which you build in this 
way will be incompatible with future linux distributions.  This can't 
be helped. (Since linuxppc R5 will move the powerpc community to glibc2, 
you would have to rebuild the program anyway.)

A version of egcs-1.1 built by Gary Thomas can be found at:

   ftp://ftp.linuxppc.org/pub/gary/redhat/RPMS/ppc/

My own version can be found at:

   ftp://bacon.ne.mediaone.net/pub/redhat/RPMS/ppc/

or through my web front end at:

   http://bacon.ne.mediaone.net/SciPPC


Gary's build would be my first choice. :-)

-- 
Fred Bacon

==========================================================================
Aerodyne Research, Inc.                   Phone:   (978) 663-9500 ext. 273
45 Manning Rd.                              FAX:   (978) 663-4918
Billerica, MA  01821-3976                  http://www.aerodyne.com
==========================================================================
bacon@aerodyne.com
[Append to This Answer]
Previous: (Answer) Problems with X libraries; e.g. "cc -o p1 p1.c -lXaw -lXmu -lXt -lX11 -lm"
Next: (Answer) I get compiler errors in netinet/in.h or linux/in.h (glibc-1.99, kernel-2.1.x)
This document is: http://www.jonh.net/cgi-bin/lppcfom/fom?file=491
[Search] [Appearance]
This is a Faq-O-Matic 2.717d.
Hosted by anduin.org and SourceForge Logo