From: Thomas Schwinge <tschwinge@gnu.org>
To: gcc-patches@gcc.gnu.org, bug-hurd@gnu.org
Cc: debian-bsd@lists.debian.org
Subject: [PATCH] GNU/Hurd target configuration
Date: Wed, 08 Oct 2008 20:23:00 -0000 [thread overview]
Message-ID: <20081008201404.GM7127@fencepost.gnu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 6207 bytes --]
Hello!
Here is a patch to bring the target configuration for GNU/Hurd up to a
level so that GCC trunk is buildable for GNU/Hurd again (together with
other patches that are already available or are still to be written; see
my other posts). This GCC does even ;-) produce working binaries.
Please discuss with the goal to have this eventually committed to the GCC
trunk.
No ChangeLog yet.
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc (Revision 140963)
+++ gcc/config.gcc (Arbeitskopie)
@@ -480,16 +480,28 @@
esac
fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h"
;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
- # Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*)
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
- extra_options="${extra_options} linux.opt"
gas=yes
gnu_ld=yes
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
esac
tmake_file="t-slibgcc-elf-ver t-linux"
+ case $target in
+ *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
+ :;;
+ *-*-gnu*)
+ tmake_file="$tmake_file t-gnu";;
+ esac
+ # glibc / uclibc switch. uclibc isn't usable for GNU/Hurd and neither for
+ # GNU/k*BSD.
+ case $target in
+ *linux*)
+ extra_options="${extra_options} linux.opt";;
+ *)
+ tm_defines="$tm_defines OPTION_GLIBC=1";;
+ esac
case ${target} in
*-*-*uclibc*)
tm_defines="${tm_defines} UCLIBC_DEFAULT=1"
@@ -502,30 +514,6 @@
default_use_cxa_atexit=yes
use_gcc_tgmath=no
;;
-*-*-gnu*)
- # On the Hurd, the setup is just about the same on
- # each different CPU. The specific machines that we
- # support are matched above and just set $cpu_type.
- tm_file="${cpu_type}/gnu.h"
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
- # GNU tools are the only tools.
- gas=yes
- gnu_ld=yes
- # These details are the same as for Linux.
- # But here we need a little extra magic.
- tmake_file="t-slibgcc-elf-ver t-linux t-gnu"
- case ${target} in
- alpha*)
- tm_file="${cpu_type}/${cpu_type}.h alpha/elf.h alpha/linux.h alpha/linux-elf.h gnu.h ${tm_file}"
- ;;
- i[34567]86-*-*)
- tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h gnu.h ${tm_file}"
- ;;
- esac
- # Assume that glibc is being used and so __cxa_atexit is provided.
- default_use_cxa_atexit=yes
- use_gcc_tgmath=no
- ;;
*-*-netbsd*)
tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd t-libgcc-pic"
gas=yes
@@ -618,6 +606,7 @@
tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha alpha/t-ieee alpha/t-linux"
;;
alpha*-*-gnu*)
+ tm_file="$tm_file alpha/elf.h alpha/linux.h alpha/linux-elf.h gnu.h alpha/gnu.h"
target_cpu_default="MASK_GAS"
tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha alpha/t-ieee"
;;
@@ -1085,7 +1075,7 @@
i[34567]86-*-coff*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
;;
-i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
+i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu*)
# Intel 80386's running GNU/*
# with ELF format using glibc 2
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h"
@@ -1116,6 +1106,7 @@
;;
i[34567]86-*-knetbsd*-gnu) tm_file="${tm_file} i386/linux.h knetbsd-gnu.h i386/knetbsd-gnu.h" ;;
i[34567]86-*-kfreebsd*-gnu) tm_file="${tm_file} i386/linux.h kfreebsd-gnu.h i386/kfreebsd-gnu.h" ;;
+ i[34567]86-*-gnu*) tm_file="$tm_file i386/linux.h gnu.h i386/gnu.h";;
esac
tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules"
;;
@@ -1128,8 +1119,6 @@
esac
tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules"
;;
-i[34567]86-*-gnu*)
- ;;
i[34567]86-pc-msdosdjgpp*)
xm_file=i386/xm-djgpp.h
tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h"
Index: gcc/config/i386/gnu.h
===================================================================
--- gcc/config/i386/gnu.h (Revision 140963)
+++ gcc/config/i386/gnu.h (Arbeitskopie)
@@ -1,30 +1,17 @@
/* Configuration for an i386 running GNU with ELF as the target machine. */
+#undef GLIBC_DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so"
+
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (i386 GNU)");
-#undef TARGET_OS_CPP_BUILTINS /* config.gcc includes i386/linux.h. */
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- HURD_TARGET_OS_CPP_BUILTINS(); \
- } \
- while (0)
-
#undef CPP_SPEC
#define CPP_SPEC "%{pthread:-D_REENTRANT} %{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"
#undef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu)"
-#undef LINK_SPEC
-#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so}} \
- %{static:-static}}"
-
#undef STARTFILE_SPEC
#if defined HAVE_LD_PIE
#define STARTFILE_SPEC \
@@ -42,3 +29,8 @@
/* FIXME: Is a Hurd-specific fallback mechanism necessary? */
#undef MD_UNWIND_SUPPORT
+
+#ifdef TARGET_LIBC_PROVIDES_SSP
+/* Not supported yet. */
+#undef TARGET_THREAD_SSP_OFFSET
+#endif
Index: gcc/config/gnu.h
===================================================================
--- gcc/config/gnu.h (Revision 140963)
+++ gcc/config/gnu.h (Arbeitskopie)
@@ -12,10 +12,8 @@
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR "/include"
-/* The system headers under GNU are C++-aware. */
-#define NO_IMPLICIT_EXTERN_C
-
-#define HURD_TARGET_OS_CPP_BUILTINS() \
+#undef LINUX_TARGET_OS_CPP_BUILTINS
+#define LINUX_TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__gnu_hurd__"); \
builtin_define ("__GNU__"); \
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
next reply other threads:[~2008-10-08 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 20:23 Thomas Schwinge [this message]
2008-10-09 8:37 ` Paolo Bonzini
2008-10-09 13:24 ` Thomas Schwinge
2008-10-10 11:53 ` [PATCH] Add missing copyright and licensing header Thomas Schwinge
2008-11-09 23:03 ` [COMMITTED] " Thomas Schwinge
2008-11-10 0:01 ` [PATCH] GNU/Hurd target configuration Thomas Schwinge
2008-11-10 12:07 ` Paolo Bonzini
2008-11-14 0:28 ` Thomas Schwinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081008201404.GM7127@fencepost.gnu.org \
--to=tschwinge@gnu.org \
--cc=bug-hurd@gnu.org \
--cc=debian-bsd@lists.debian.org \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).