Index: config.gcc =================================================================== RCS file: /cvs/gcc/gcc/gcc/config.gcc,v retrieving revision 1.260 diff -c -r1.260 config.gcc *** config.gcc 21 Nov 2002 21:39:16 -0000 1.260 --- config.gcc 24 Nov 2002 23:25:15 -0000 *************** *** 370,375 **** --- 370,384 ---- tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS" ;; esac + + # NetBSD 1.7 and later are set up to use GCC's crtstuff for + # ELF configurations. We will clear extra_parts in the + # a.out configurations. + case $machine in + *-*-netbsd*1.[7-9]* | *-*-netbsd*[2-9]*) + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" + ;; + esac ;; *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*) # This is the place-holder for the generic a.out configuration *************** *** 623,628 **** --- 632,638 ---- arm*-*-netbsd*) tm_file="arm/aout.h arm/arm.h netbsd.h netbsd-aout.h arm/netbsd.h" tmake_file="t-netbsd arm/t-netbsd" + extra_parts="" use_collect2=yes ;; arm*-*-linux*) # ARM GNU/Linux with ELF *************** *** 1068,1073 **** --- 1078,1084 ---- i[34567]86-*-netbsd*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h" tmake_file=t-netbsd + extra_parts="" use_collect2=yes ;; x86_64-*-netbsd*) *************** *** 1631,1636 **** --- 1642,1648 ---- m68k*-*-netbsd*) tm_file=m68k/netbsd.h tmake_file=t-netbsd + extra_parts="" use_collect2=yes ;; m68k*-*-openbsd*) *************** *** 1928,1933 **** --- 1940,1946 ---- tm_file="${tm_file} netbsd.h netbsd-aout.h ns32k/netbsd.h" # On NetBSD, the headers are already okay, except for math.h. tmake_file="t-netbsd ns32k/t-ns32k" + extra_parts="" use_collect2=yes ;; pdp11-*-bsd) *************** *** 2320,2325 **** --- 2333,2339 ---- sparc-*-netbsd*) tm_file="${tm_file} sparc/aout.h netbsd.h netbsd-aout.h sparc/netbsd.h" tmake_file=t-netbsd + extra_parts="" use_collect2=yes ;; sparc-*-openbsd*) *************** *** 2638,2643 **** --- 2652,2658 ---- vax-*-netbsd*) tm_file="${tm_file} netbsd.h netbsd-aout.h vax/netbsd.h" tmake_file=t-netbsd + extra_parts="" use_collect2=yes ;; vax-*-openbsd*) Index: config/t-netbsd =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/t-netbsd,v retrieving revision 1.5 diff -c -r1.5 t-netbsd *** config/t-netbsd 17 May 2001 03:15:44 -0000 1.5 --- config/t-netbsd 24 Nov 2002 23:25:27 -0000 *************** *** 1,2 **** --- 1,5 ---- # Don't run fixproto STMP_FIXPROTO = + + # Always build crtstuff with PIC. + CRTSTUFF_T_CFLAGS = -fPIC