public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] GNU/kFreeBSD systems running on MIPS
@ 2011-07-21 23:28 Robert Millan
  2011-07-25 21:28 ` Richard Sandiford
  0 siblings, 1 reply; 9+ messages in thread
From: Robert Millan @ 2011-07-21 23:28 UTC (permalink / raw)
  To: gcc-patches, Eric Christopher, Richard Sandiford

[-- Attachment #1: Type: text/plain, Size: 85 bytes --]

This patch adds support for GNU/kFreeBSD systems running on MIPS.

-- 
Robert Millan

[-- Attachment #2: mips_kfreebsd.diff --]
[-- Type: text/x-patch, Size: 6540 bytes --]

2011-07-22  Robert Millan  <rmh@gnu.org>

	Support for GNU/kFreeBSD systems running on MIPS.

	* config.gcc: Detect mips*-*-kfreebsd*-gnu.
	* config.host: Likewise.
	* config/mips/kfreebsd-gnu.h: New file.
	* config/mips/kfreebsd-gnu64.h: New file.
	* config/mips/gnu-user.h: Restrict `-march=native' support to GNU/Linux.

Index: libgcc/config.host
===================================================================
--- libgcc/config.host	(revision 176595)
+++ libgcc/config.host	(working copy)
@@ -478,6 +478,14 @@
 	tmake_file="{$tmake_file} t-crtfm"
 	md_unwind_header=mips/linux-unwind.h
 	;;
+mips64*-*-kfreebsd*-gnu)
+	extra_parts="$extra_parts crtfastmath.o"
+	tmake_file="{$tmake_file} t-crtfm"
+	;;
+mips*-*-kfreebsd*-gnu)			# GNU/kFreeBSD MIPS, either endian.
+	extra_parts="$extra_parts crtfastmath.o"
+	tmake_file="{$tmake_file} t-crtfm"
+	;;
 mips*-*-openbsd*)
 	;;
 mipsisa32-*-elf* | mipsisa32el-*-elf*)
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 176595)
+++ gcc/config.gcc	(working copy)
@@ -1819,20 +1819,28 @@
 	tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
 	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 	;;
-mips64*-*-linux* | mipsisa64*-*-linux*)
-	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h"
+mips64*-*-linux* | mipsisa64*-*-linux* | mips64*-*-kfreebsd*-gnu | mipsisa64*-*-kfreebsd*-gnu)
+	tm_file="dbxelf.h elfos.h gnu-user.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h"
 	tmake_file="${tmake_file} mips/t-linux64 mips/t-libgcc-mips16"
 	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
+	case ${target_os} in
+		linux*)
+			tm_file="${tm_file} linux.h mips/linux64.h"
+			;;
+		kfreebsd*-gnu)
+			tm_file="${tm_file} kfreebsd-gnu.h mips/kfreebsd-gnu64.h"
+			;;
+	esac
 	case ${target} in
-		mips64el-st-linux-gnu)
+		mips64el-st-*)
 			tm_file="${tm_file} mips/st.h"
 			tmake_file="${tmake_file} mips/t-st"
 			;;
-		mips64octeon*-*-linux*)
+		mips64octeon*-*-*)
 			tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
 			target_cpu_default=MASK_SOFT_FLOAT_ABI
 			;;
-		mipsisa64r2*-*-linux*)
+		mipsisa64r2*-*-*)
 			tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
 			;;
 	esac
@@ -1841,11 +1849,27 @@
 	gas=yes
 	test x$with_llsc != x || with_llsc=yes
 	;;
-mips*-*-linux*)				# Linux MIPS, either endian.
-        tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h"
+mips*-*-linux* | mips*-*-kfreebsd*-gnu)			# GNU/* MIPS, either endian.
+        tm_file="dbxelf.h elfos.h gnu-user.h glibc-stdint.h ${tm_file} mips/gnu-user.h"
 	tmake_file="${tmake_file} mips/t-libgcc-mips16"
+	case ${target_os} in
+		linux*)
+			tm_file="${tm_file} linux.h mips/linux.h"
+			;;
+		kfreebsd*-gnu)
+			tm_file="${tm_file} kfreebsd-gnu.h mips/kfreebsd-gnu.h"
+			;;
+	esac
 	if test x$enable_targets = xall; then
-		tm_file="${tm_file} mips/gnu-user64.h mips/linux64.h"
+		tm_file="${tm_file} mips/gnu-user64.h"
+		case ${target_os} in
+			linux*)
+				tm_file="${tm_file} mips/linux64.h"
+				;;
+			kfreebsd*-gnu)
+				tm_file="${tm_file} mips/kfreebsd-gnu64.h"
+				;;
+		esac
 		tmake_file="${tmake_file} mips/t-linux64"
 		tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32"
 	fi
Index: gcc/config/mips/gnu-user.h
===================================================================
--- gcc/config/mips/gnu-user.h	(revision 176595)
+++ gcc/config/mips/gnu-user.h	(working copy)
@@ -106,8 +106,8 @@
 #endif
 
 /* -march=native handling only makes sense with compiler running on
-   a MIPS chip.  */
-#if defined(__mips__)
+   a MIPS chip.  Also, for now only Linux targets are supported.  */
+#if defined(__mips__) && defined(__linux__)
 extern const char *host_detect_local_cpu (int argc, const char **argv);
 # define EXTRA_SPEC_FUNCTIONS \
   { "local_cpu_detect", host_detect_local_cpu },
Index: gcc/config/mips/kfreebsd-gnu64.h
===================================================================
--- gcc/config/mips/kfreebsd-gnu64.h	(revision 0)
+++ gcc/config/mips/kfreebsd-gnu64.h	(revision 0)
@@ -0,0 +1,31 @@
+/* Definitions for MIPS running kFreeBSD-based GNU systems with ELF format
+   using n32/64 abi.
+   Copyright (C) 2011
+   Free Software Foundation, Inc.
+   Contributed by Robert Millan.
+
+This file is part of GCC.
+
+GCC 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 3, or (at your option)
+any later version.
+
+GCC 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 GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#define GNU_USER_LINK_EMULATION32	"elf32%{EB:b}%{EL:l}tsmip_fbsd"
+#define GNU_USER_LINK_EMULATION64	"elf64%{EB:b}%{EL:l}tsmip_fbsd"
+#define GNU_USER_LINK_EMULATIONN32	"elf32%{EB:b}%{EL:l}tsmipn32_fbsd"
+
+#define GLIBC_DYNAMIC_LINKER32		"/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER64		"/lib64/ld.so.1"
+#define GLIBC_DYNAMIC_LINKERN32		"/lib32/ld.so.1"
+
+#define GNU_USER_DYNAMIC_LINKERN32	GLIBC_DYNAMIC_LINKERN32
Index: gcc/config/mips/kfreebsd-gnu.h
===================================================================
--- gcc/config/mips/kfreebsd-gnu.h	(revision 0)
+++ gcc/config/mips/kfreebsd-gnu.h	(revision 0)
@@ -0,0 +1,22 @@
+/* Definitions for MIPS running kFreeBSD-based GNU systems with ELF format
+   Copyright (C) 2011
+   Free Software Foundation, Inc.
+   Contributed by Robert Millan.
+
+This file is part of GCC.
+
+GCC 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 3, or (at your option)
+any later version.
+
+GCC 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 GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] GNU/kFreeBSD systems running on MIPS
  2011-07-21 23:28 [PATCH] GNU/kFreeBSD systems running on MIPS Robert Millan
@ 2011-07-25 21:28 ` Richard Sandiford
  2011-07-26  7:41   ` Robert Millan
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Sandiford @ 2011-07-25 21:28 UTC (permalink / raw)
  To: Robert Millan; +Cc: gcc-patches, Eric Christopher

Robert Millan <rmh@gnu.org> writes:
> This patch adds support for GNU/kFreeBSD systems running on MIPS.

Looks good.  However, Rainer's in the middle of moving things from gcc/
to libgcc/ -- where they belong -- and committing a new port now would
interfere with that.  If it's OK, I'd like to hold off applying this
until Rainer's finished his changes.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] GNU/kFreeBSD systems running on MIPS
  2011-07-25 21:28 ` Richard Sandiford
@ 2011-07-26  7:41   ` Robert Millan
  2011-07-26 11:37     ` Rainer Orth
  0 siblings, 1 reply; 9+ messages in thread
From: Robert Millan @ 2011-07-26  7:41 UTC (permalink / raw)
  To: Robert Millan, gcc-patches, Eric Christopher, rdsandiford

2011/7/25 Richard Sandiford <rdsandiford@googlemail.com>:
> Robert Millan <rmh@gnu.org> writes:
>> This patch adds support for GNU/kFreeBSD systems running on MIPS.
>
> Looks good.  However, Rainer's in the middle of moving things from gcc/
> to libgcc/ -- where they belong -- and committing a new port now would
> interfere with that.  If it's OK, I'd like to hold off applying this
> until Rainer's finished his changes.

It's ok.  Could you give a rough estimate? (few days / weeks / months)

-- 
Robert Millan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] GNU/kFreeBSD systems running on MIPS
  2011-07-26  7:41   ` Robert Millan
@ 2011-07-26 11:37     ` Rainer Orth
  2011-07-26 14:00       ` Robert Millan
  2011-08-17 13:50       ` Robert Millan
  0 siblings, 2 replies; 9+ messages in thread
From: Rainer Orth @ 2011-07-26 11:37 UTC (permalink / raw)
  To: Robert Millan; +Cc: gcc-patches, Eric Christopher, rdsandiford

Robert,

> 2011/7/25 Richard Sandiford <rdsandiford@googlemail.com>:
>> Robert Millan <rmh@gnu.org> writes:
>>> This patch adds support for GNU/kFreeBSD systems running on MIPS.
>>
>> Looks good.  However, Rainer's in the middle of moving things from gcc/
>> to libgcc/ -- where they belong -- and committing a new port now would
>> interfere with that.  If it's OK, I'd like to hold off applying this
>> until Rainer's finished his changes.

thanks.

> It's ok.  Could you give a rough estimate? (few days / weeks / months)

I'm in the middle of moving shlib support (another day), need to rebase
crtstuff and libgcc1, and finish libgcc2.

I hope to be ready within two or three weeks.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] GNU/kFreeBSD systems running on MIPS
  2011-07-26 11:37     ` Rainer Orth
@ 2011-07-26 14:00       ` Robert Millan
  2011-08-17 13:50       ` Robert Millan
  1 sibling, 0 replies; 9+ messages in thread
From: Robert Millan @ 2011-07-26 14:00 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Eric Christopher, rdsandiford

2011/7/26 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
> I'm in the middle of moving shlib support (another day), need to rebase
> crtstuff and libgcc1, and finish libgcc2.
>
> I hope to be ready within two or three weeks.

Ok then.  I'd appreciate if you can send me a reminder via private
mail when you've finished.

Best regards

-- 
Robert Millan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] GNU/kFreeBSD systems running on MIPS
  2011-07-26 11:37     ` Rainer Orth
  2011-07-26 14:00       ` Robert Millan
@ 2011-08-17 13:50       ` Robert Millan
  2011-08-17 15:28         ` Rainer Orth
  1 sibling, 1 reply; 9+ messages in thread
From: Robert Millan @ 2011-08-17 13:50 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Eric Christopher, rdsandiford

Hi!

2011/7/26 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
> Robert,
>
>> 2011/7/25 Richard Sandiford <rdsandiford@googlemail.com>:
>>> Robert Millan <rmh@gnu.org> writes:
>>>> This patch adds support for GNU/kFreeBSD systems running on MIPS.
>>>
>>> Looks good.  However, Rainer's in the middle of moving things from gcc/
>>> to libgcc/ -- where they belong -- and committing a new port now would
>>> interfere with that.  If it's OK, I'd like to hold off applying this
>>> until Rainer's finished his changes.
> I'm in the middle of moving shlib support (another day), need to rebase
> crtstuff and libgcc1, and finish libgcc2.

My patch still applies cleanly to current HEAD, has this migration
happened already?  If not, what's the current ETA?  I'll have almost
no spare time after this week, I'd like to sort this out before/during
the weekend if possible.

Thanks!

-- 
Robert Millan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] GNU/kFreeBSD systems running on MIPS
  2011-08-17 13:50       ` Robert Millan
@ 2011-08-17 15:28         ` Rainer Orth
  2011-09-23 22:23           ` Robert Millan
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Orth @ 2011-08-17 15:28 UTC (permalink / raw)
  To: Robert Millan; +Cc: gcc-patches, Eric Christopher, rdsandiford

Hi Robert,

> My patch still applies cleanly to current HEAD, has this migration
> happened already?  If not, what's the current ETA?  I'll have almost
> no spare time after this week, I'd like to sort this out before/during
> the weekend if possible.

all the relevant patches have been posted by now.  One needs a bit work,
the others are awaiting review.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] GNU/kFreeBSD systems running on MIPS
  2011-08-17 15:28         ` Rainer Orth
@ 2011-09-23 22:23           ` Robert Millan
  2011-09-26 13:24             ` Rainer Orth
  0 siblings, 1 reply; 9+ messages in thread
From: Robert Millan @ 2011-09-23 22:23 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Eric Christopher, rdsandiford

Hi there,

2011/8/17 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
> Hi Robert,
>
>> My patch still applies cleanly to current HEAD, has this migration
>> happened already?  If not, what's the current ETA?  I'll have almost
>> no spare time after this week, I'd like to sort this out before/during
>> the weekend if possible.
>
> all the relevant patches have been posted by now.  One needs a bit work,
> the others are awaiting review.

Is there any news about this?

-- 
Robert Millan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] GNU/kFreeBSD systems running on MIPS
  2011-09-23 22:23           ` Robert Millan
@ 2011-09-26 13:24             ` Rainer Orth
  0 siblings, 0 replies; 9+ messages in thread
From: Rainer Orth @ 2011-09-26 13:24 UTC (permalink / raw)
  To: Robert Millan; +Cc: gcc-patches, Eric Christopher, rdsandiford

Hi Robert,

> 2011/8/17 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
>> Hi Robert,
>>
>>> My patch still applies cleanly to current HEAD, has this migration
>>> happened already?  If not, what's the current ETA?  I'll have almost
>>> no spare time after this week, I'd like to sort this out before/during
>>> the weekend if possible.
>>
>> all the relevant patches have been posted by now.  One needs a bit work,
>> the others are awaiting review.
>
> Is there any news about this?

Paolo is currently reviewing the outstanding patches.  If it's really
urgent, I'd say go ahead and commit your patch.

Besides, there are two typos:

Index: libgcc/config.host
===================================================================
--- libgcc/config.host	(revision 176595)
+++ libgcc/config.host	(working copy)
@@ -478,6 +478,14 @@
 	tmake_file="{$tmake_file} t-crtfm"
 	md_unwind_header=mips/linux-unwind.h
 	;;
+mips64*-*-kfreebsd*-gnu)
+	extra_parts="$extra_parts crtfastmath.o"
+	tmake_file="{$tmake_file} t-crtfm"

                    ${tmake_file} or omit the brackets completely

+	;;
+mips*-*-kfreebsd*-gnu)			# GNU/kFreeBSD MIPS, either endian.
+	extra_parts="$extra_parts crtfastmath.o"
+	tmake_file="{$tmake_file} t-crtfm"

                    likewise

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-09-26 12:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-21 23:28 [PATCH] GNU/kFreeBSD systems running on MIPS Robert Millan
2011-07-25 21:28 ` Richard Sandiford
2011-07-26  7:41   ` Robert Millan
2011-07-26 11:37     ` Rainer Orth
2011-07-26 14:00       ` Robert Millan
2011-08-17 13:50       ` Robert Millan
2011-08-17 15:28         ` Rainer Orth
2011-09-23 22:23           ` Robert Millan
2011-09-26 13:24             ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).