From owner-freebsd-ppc@FreeBSD.ORG Tue Jul 1 07:15:18 2003 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5BC037B401; Tue, 1 Jul 2003 07:15:18 -0700 (PDT) Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.120.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DA1943F93; Tue, 1 Jul 2003 07:15:18 -0700 (PDT) (envelope-from welchsm@earthlink.net) Received: from bert.psp.pas.earthlink.net ([207.217.78.217]) by gull.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 19XLuf-0000DO-00; Tue, 01 Jul 2003 07:15:17 -0700 Received: from [207.217.78.14] by EarthlinkWAM via HTTP; Tue Jul 01 07:15:17 PDT 2003 Message-ID: <2398508.1057068917810.JavaMail.nobody@bert.psp.pas.earthlink.net> Date: Tue, 1 Jul 2003 07:15:10 -0500 (GMT) From: Sean Welch To: grehan@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Earthlink Web Access Mail version 3.0 cc: freebsd-ppc@freebsd.org Subject: Attempting to cross-compile newest -CURRENT X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Sean_Welch@alum.wofford.org List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2003 14:15:19 -0000 Well, I gave it a shot last night with mixed results. First I had trouble with the toolchain patch I had copied out of the lists a while back. Turns out it had a few extra line breaks (not surprising since I cut and pasted from a webpage) but it also seemed to have an extra "endif" in the part applied to freebsd.h; the build failed pretty quickly on that last. I glued the lines together and got rid of the endif (adjusted all the line numbers in the patch to take it into account) and it applied just fine but then the build broke on ps (???) telling me: /usr/src/bin/ps/print.c: In function `state': /usr/src/bin/ps/print.c:250: warning: comparison is always false due to limited range of data type *** Error code 1 Not sure it wasn't me, I cleaned out /usr/obj, did a make clean under /usr/src, cvsup'd again, reapplied the patch and started off the build again this morning. I suspect it will fail in the same place as I didn't see any changes to print.c, but again it could be just me. I figured I'd double check my procedure with you. I'm still using the following for a make command: make -DNO_BIND -DNOINFO -DNOGAMES -DNOPROFILE -DNOCRYPT -DNOSECURE -DNOLIBC_R -DNO_IPFILTER -DNOFORTH -DNO_FORTH TARGET_ARCH=powerpc buildworld | & tee /tmp/powerpc.log Are all of these options still needed? (It sure would be nice to have an ssh!) The patch I used on /usr/src is as follows (please post a new copy if this one has problems): Index: contrib/gcc/config/rs6000/freebsd.h =================================================================== RCS file: /home/ncvs/src/contrib/gcc/config/rs6000/freebsd.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 freebsd.h --- contrib/gcc/config/rs6000/freebsd.h 1 Feb 2002 18:15:22 -0000 1.1.1.1 +++ contrib/gcc/config/rs6000/freebsd.h 21 Mar 2003 17:11:00 -0000 @@ -23,6 +23,14 @@ #undef CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_freebsd)" +/* XXX */ +#undef CPP_ENDIAN_BIG_SPEC +#define CPP_ENDIAN_BIG_SPEC "-D__BIG_ENDIAN__ -Amachine=bigendian" + +/* XXX */ +#undef CPP_ENDIAN_LITTLE_SPEC +#define CPP_ENDIAN_LITTLE_SPEC "-D__LITTLE_ENDIAN__ -Amachine=littleendian" + #undef STARTFILE_DEFAULT_SPEC #define STARTFILE_DEFAULT_SPEC "%(startfile_freebsd)" @@ -38,6 +48,11 @@ #undef LINK_OS_DEFAULT_SPEC #define LINK_OS_DEFAULT_SPEC "%(link_os_freebsd)" +/* XXX: This is wrong for many platforms in sysv4.h. + We should work on getting that defination fixed. */ +#undef LINK_SHLIB_SPEC +#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" + /************************[ Target stuff ]***********************************/ @@ -47,6 +62,18 @@ /* rs6000.h gets this wrong for FreeBSD. We use the GCC defaults instead. */ #undef WCHAR_TYPE + +/* +XXX: SIZE_TYPE setting fixes: +/usr/obj/powerpc/usr/src/i386/usr/include/string.h:65: warning: conflicting types for built-in function `memcmp' +/usr/obj/powerpc/usr/src/i386/usr/include/string.h:66: warning: conflicting types for built-in function `memcpy' +/usr/obj/powerpc/usr/src/i386/usr/include/string.h:68: warning: conflicting types for built-in function `memset' +/usr/obj/powerpc/usr/src/i386/usr/include/string.h:94: warning: conflicting types for built-in function `strncat' +/usr/obj/powerpc/usr/src/i386/usr/include/string.h:95: warning: conflicting types for built-in function `strncmp' +/usr/obj/powerpc/usr/src/i386/usr/include/string.h:96: warning: conflicting types for built-in function `strncpy' +*/ +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" #undef WCHAR_UNSIGNED #define WCHAR_UNSIGNED 0 Index: contrib/gcc/config/rs6000/sysv4.h =================================================================== RCS file: /home/ncvs/src/contrib/gcc/config/rs6000/sysv4.h,v retrieving revision 1.1.1.5 diff -u -r1.1.1.5 sysv4.h --- contrib/gcc/config/rs6000/sysv4.h 10 Feb 2003 05:41:43 -0000 1.1.1.5 +++ contrib/gcc/config/rs6000/sysv4.h 21 Mar 2003 17:04:49 -0000 @@ -326,7 +326,7 @@ /* Define this to set the endianness to use in libgcc2.c, which can not depend on target_flags. */ -#if !defined(_LITTLE_ENDIAN) && !defined(__sun__) +#if !defined(__LITTLE_ENDIAN__) && !defined(__sun__) #define LIBGCC2_WORDS_BIG_ENDIAN 1 #else #define LIBGCC2_WORDS_BIG_ENDIAN 0 @@ -1207,7 +1207,7 @@ /* FreeBSD support. */ #define CPP_OS_FREEBSD_SPEC "\ - -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \ + -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ -D__ELF__ \ -Acpu=powerpc -Amachine=powerpc" #define STARTFILE_FREEBSD_SPEC FBSD_STARTFILE_SPEC @@ -1216,7 +1216,17 @@ #define LINK_START_FREEBSD_SPEC "" #define LINK_OS_FREEBSD_SPEC "\ - %{symbolic:-Bsymbolic}" + %{p:%e`-p' not supported; use `-pg' and gprof(1)} \ + %{Wl,*:%*} \ + %{v:-V} \ + %{assert*} %{R*} %{rpath*} %{defsym*} \ + %{shared:-Bshareable %{h*} %{soname*}} \ + %{!shared: \ + %{!static: \ + %{rdynamic: -export-dynamic} \ + %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}} \ + %{static:-Bstatic}} \ + %{symbolic:-Bsymbolic}" /* GNU/Linux support. */ #ifdef USE_GNULIBC_1