Subject: Re: binutils 2.9.1 TESTERS NEEDED /macppc
To: Todd Vierling <tv@pobox.com>
From: Erik Bertelsen <erik@mediator.uni-c.dk>
List: tech-toolchain
Date: 02/04/1999 23:24:28
On Tue, Feb 02, 1999 at 09:23:33PM -0500, Todd Vierling wrote:
> I have imported binutils/bfd 2.9.1 into src/gnu/dist, and have tested it
> thoroughly on i386 and alpha, and partly on arm32.  I need some testers to
> verify operation on all other platforms.
> 

My experiments with the new binutils on NetBSD/macppc have the 
results shown below.

Actually I have been running for some time with the patches to 
the original binutils 2.9.1 that Todd sent out earlier.

With the patches shown below, gas and ld have been used in
successive recompilations with make installs inbetween.

Egcs has also been completely recompiled after updating
lib/bfd.

Furthermore the machine is now running a kernel built with
the new tools, and it is currently recompiling /usr/src/lib
in preparation for a compilation of the rest of userland.

gas.new:
=======

I made a powerpc configuration by cloning the alpha configuration
and then changing at shown in the following diff:

Only in alpha: CVS
diff alpha/Makefile.inc powerpc/Makefile.inc
3c3
< TARG_CPU_C=	tc-alpha.c
---
> TARG_CPU_C=	tc-ppc.c
diff alpha/config.h powerpc/config.h
51,53c51,53
< #define TARGET_ALIAS "alpha--netbsd"
< #define TARGET_CPU "alpha"
< #define TARGET_CANONICAL "alpha--netbsd"
---
> #define TARGET_ALIAS "powerpc--netbsd"
> #define TARGET_CPU "powerpc"
> #define TARGET_CANONICAL "powerpc--netbsd"
diff alpha/targ-cpu.h powerpc/targ-cpu.h
3c3
< #include "tc-alpha.h"
---
> #include "tc-ppc.h"

When I compare to the config.h generated by configure
with the stock binutils 2.9.1 with Todds patches, I'm
in doubt of whether TARGET_BYTES_BIG_ENDIAN should
be undefined or defined to 1.

ld.new:
======

I added a ppc entry to ldemul-list.h, maybe another
one for little endian ppc should be added. Further-
more I wrote a _powerpc.mk as shown below.

? _powerpc.mk
Index: ldemul-list.h
===================================================================
RCS file: /home/cvs-base/src/gnu/usr.bin/ld.new/ldemul-list.h,v
retrieving revision 1.1.1.5
diff -c -r1.1.1.5 ldemul-list.h
*** ldemul-list.h	1999/01/11 15:00:50	1.1.1.5
--- ldemul-list.h	1999/02/04 21:42:25
***************
*** 16,18 ****
--- 16,21 ----
  extern ld_emulation_xfer_type ld_elf64_sparc_emulation;
  extern ld_emulation_xfer_type ld_sun4_emulation;
  extern ld_emulation_xfer_type ld_sparcnbsd_emulation;
+ 
+ /* powerpc emulations */
+ extern ld_emulation_xfer_type ld_elf32ppc_emulation;


============_powerpc.mk===========================
#	$NetBSD:$

# is elf32lpcc relevant for NetBSD ?
EMULS=		elf32ppc

DEFAULT_EMUL=	elf32ppc





gdb:
===

Just a failure report, no fix.

cc -O  -Werror   -I/home/src/gnu/usr.bin/gdb/obj.macppc -I/home/src/gnu/usr.bin/gdb -I/home/src/gnu/usr.bin/gdb/../../dist/gdb -I/home/src/gnu/usr.bin/gdb/../../dist/gdb/config -I/home/src/gnu/usr.bin/gdb/../../dist/readline -I/home/src/gnu/lib/bfd/obj.macppc -I/home/src/gnu/usr.bin/gdb/../../dist/bfd -I/home/src/gnu/usr.bin/gdb/../../dist/include -DNO_MMALLOC -c /home/src/gnu/usr.bin/gdb/../../dist/gdb/rs6000-nat.c
/home/src/gnu/usr.bin/gdb/../../dist/gdb/rs6000-nat.c:33: sys/reg.h: No such file or directory
/home/src/gnu/usr.bin/gdb/../../dist/gdb/rs6000-nat.c:46: sys/ldr.h: No such file or directory
*** Error code 1

Stop.

regards
Erik Bertelsen

ps: your C++ experiment resulted in:

g3 cat > x2.cc 
#include <iostream.h>
extern int i;
int main(void) { cout << i << '\n'; }
g3 cat > x1.cc

int i;
struct X { X() { i = 42; } } x;

g3 c++ -fPIC -c x1.cc
g3 ld -shared -o libx.so x1.o
g3 c++ -o x x2.cc -L. -lx
/usr/lib/libstdc++.so: warning: reference to compatibility vfork(); include <unistd.h> for correct reference
g3 env LD_LIBRARY_PATH=. ./x
0


I just did a complete rebuild in /usr/src/gnu/lib/libstdc+++,
but it still prints 0.
/erik