Subject: misc/37453: [PATCH] add support for cross-building NetBSD on FreeBSD 7.X and 8.X
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <keramida@FreeBSD.org>
List: netbsd-bugs
Date: 11/30/2007 08:40:00
>Number: 37453
>Category: misc
>Synopsis: [PATCH] add support for cross-building NetBSD on FreeBSD 7.X and 8.X
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: misc-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Nov 30 08:40:00 +0000 2007
>Originator: Giorgos Keramidas
>Release: release-3-1
>Organization:
FreeBSD Project
>Environment:
>Description:
Trying to cross-build NetBSD 3.X on FreeBSD 8.0-CURRENT fails,
because of missing *freebsd* parts in gnu/dist/gcc/gcc/config.gcc
The attached patch adds the bits I could see so far, and build.sh
has been merrily churning along for a while now, cross-building
NetBSD release-3-1 on my FreeBSD 8.0-CURRENT installation.
>How-To-Repeat:
freebsd8> env HOST_SH=ksh ksh build.sh -U -m i386
>Fix:
%%%
diff -r 7868e4c78b0d -r 2705eb4209ff gnu/dist/gcc/gcc/config.gcc
--- a/gnu/dist/gcc/gcc/config.gcc Fri Nov 30 01:46:57 2007 +0200
+++ b/gnu/dist/gcc/gcc/config.gcc Fri Nov 30 02:50:35 2007 +0200
@@ -475,6 +475,8 @@ case $machine in
*-*-freebsd4 | *-*-freebsd[4].*) fbsd_tm_file="freebsd4.h";;
*-*-freebsd5 | *-*-freebsd[5].*) fbsd_tm_file="freebsd5.h";;
*-*-freebsd6 | *-*-freebsd[6].*) fbsd_tm_file="freebsd6.h";;
+ *-*-freebsd7 | *-*-freebsd[7].*) fbsd_tm_file="freebsd7.h";;
+ *-*-freebsd8 | *-*-freebsd[8].*) fbsd_tm_file="freebsd8.h";;
*) echo 'Please update *-*-freebsd* in gcc/config.gcc'; exit 1;;
esac
tmake_file="t-slibgcc-elf-ver t-freebsd"
diff -r 7868e4c78b0d -r 2705eb4209ff gnu/dist/gcc/gcc/config/freebsd7.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gnu/dist/gcc/gcc/config/freebsd7.h Fri Nov 30 02:50:35 2007 +0200
@@ -0,0 +1,22 @@
+/* FreeBSD version number setting for FreeBSD 7.x systems.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#define FBSD_MAJOR 7
diff -r 7868e4c78b0d -r 2705eb4209ff gnu/dist/gcc/gcc/config/freebsd8.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gnu/dist/gcc/gcc/config/freebsd8.h Fri Nov 30 02:50:35 2007 +0200
@@ -0,0 +1,22 @@
+/* FreeBSD version number setting for FreeBSD 8.x systems.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#define FBSD_MAJOR 8
%%%