Re: sun2 vs. gcc48
Chuck Silvers <[email protected]> Sun, 1 Feb 2015 14:02:58 -0800
| Newsgroups | gmane.os.netbsd.devel.toolchain,gmane.os.netbsd.ports.sun2,gmane.os.netbsd.ports.m68k |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Nov 21, 2014 at 08:14:02AM -0800, Matt Thomas wrote: > Unfortunately it's the wrong fix. > > The problem is that -fPIC is being used to build libgcc.a when sun2 doesn't support PIC at all. Removing that from external/gpl3/gcc/lib/libgcc/arch/m68000/defs.mk also fixes the problem. > > In fact, since we have libgcc_s.so, I wonder if -fPIC should be used for building libgcc for any platform. here's a patch that implements shared libraries for sun2: http://ftp.netbsd.org/pub/NetBSD/misc/chs/diff.sun2-shlib.6 I've tested a fair bit in tme and I don't think there's any new breakage from this patch. the change I'd particularly like someone to look at is the one in src/lib/libc/compiler_rt/Makefile.inc I'm pretty sure that's not correct but I don't know what would be better. without that change I get this error trying to link libc.so: /home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/libgcc.a(_float.o): In function `__negsf2': (.text+0x686): multiple definition of `__negsf2' libc_pic.a(negsf2.pico):(.text+0x0): first defined here /home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/libgcc.a(_double.o): In function `__negdf2': (.text+0x8ce): multiple definition of `__negdf2' libc_pic.a(negdf2.pico):(.text+0x0): first defined here collect2: error: ld returned 1 exit status *** [libc.so.12.197] Error code 1 maybe we should exclude the compiler_rt versions of neg* only on m68000? more generally, what are the rules on what should go in libgcc vs. in libc? I also noticed that we have a __mulsi3() definition in src/common/lib/libc/arch/m68k/gen/mulsi3.S and there's another one in libgcc. we currently use the libgcc version, and in this diff I changed things around to use the version in src/common, but now I don't know why I did that. everything appears to work fine with the libgcc version. should we just delete the src/common version? -Chuck