This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] preliminary QNX i386-nto support
- From: <gp at qnx dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 22 Jul 2003 17:31:09 -0000
- Subject: [PATCH] preliminary QNX i386-nto support
This is a much delayed response to
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00902.html
I have made the changes Jim Wilson suggested.
- Changed CPP_PREDEFINES to TARGET_OS_CPP_BUILTINS (I think I got it right).
- Changed the SYSROOT_SUBDIR_SPEC to SYSROOT_SUFFIX_SPEC.
- Removed the duplicate default EH_FRAME_SECTION_NAME define.
I also cleaned up the multilib stuff.
Let me know if I may add/commit.
Thanks
GP
*** fsf.orig/gcc/gcc/config.gcc Tue Jul 22 10:43:52 2003
--- fsf/gcc/gcc/config.gcc Mon Jul 21 14:11:20 2003
*************** i[34567]86-*-mach*)
*** 1056,1061 ****
--- 1056,1067 ----
# tmake_file=t-libc-ok
use_collect2=yes
;;
+ i[34567]86-*-nto-qnx*)
+ tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h svr4.h i386/nto.h"
+ tmake_file=i386/t-nto
+ gnu_ld=yes
+ gas=yes
+ ;;
i[34567]86-*-rtems*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h"
extra_parts="crtbegin.o crtend.o crti.o crtn.o"
diff -rc3p -N -x fastjar -x doc -x ada -x .#* -x CVS -x Makefile.in -x configure -x ntox86 fsf.orig/gcc/gcc/config/i386/nto.h fsf/gcc/gcc/config/i386/nto.h
*** fsf.orig/gcc/gcc/config/i386/nto.h Wed Dec 31 19:00:00 1969
--- fsf/gcc/gcc/config/i386/nto.h Mon Jul 21 16:46:18 2003
***************
*** 0 ****
--- 1,101 ----
+ /* Definitions for Intel 386 running QNX/Neutrino.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+ 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. */
+
+ #include "i386/unix.h"
+
+ #undef DEFAULT_PCC_STRUCT_RETURN
+ #define DEFAULT_PCC_STRUCT_RETURN 1
+
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fprintf (stderr, " (QNX/Neutrino/i386 ELF)");
+
+ #undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define_std ("__X86__"); \
+ builtin_define_std ("__QNXNTO__"); \
+ builtin_define_std ("__QNX__"); \
+ builtin_define_std ("__ELF__"); \
+ builtin_define_std ("__LITTLEENDIAN__");\
+ builtin_assert ("system=qnx"); \
+ builtin_assert ("system=qnxnto"); \
+ builtin_assert ("system=nto"); \
+ builtin_assert ("system=unix"); \
+ if (flag_pic) \
+ { \
+ builtin_define ("__PIC__"); \
+ builtin_define ("__pic__"); \
+ } \
+ } \
+ while (0)
+
+ #undef THREAD_MODEL_SPEC
+ #define THREAD_MODEL_SPEC "posix"
+
+ #ifdef CROSS_COMPILE
+ #define SYSROOT_SUFFIX_SPEC "x86"
+ #endif
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+ "%{!shared: \
+ %{!symbolic: \
+ %{pg:mcrt1.o%s} \
+ %{!pg:%{p:mcrt1.o%s} \
+ %{!p:crt1.o%s}}}} \
+ crti.o%s \
+ %{fexceptions: crtbegin.o%s} \
+ %{!fexceptions: %R/lib/crtbegin.o}"
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+ "crtend.o%s crtn.o%s"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+ "%{h*} %{v:-V} \
+ %{b} \
+ %{static:-dn -Bstatic} \
+ %{shared:-G -dy -z text} \
+ %{symbolic:-Bsymbolic -G -dy -z text} \
+ %{G:-G} \
+ %{YP,*} \
+ %{!YP,*:%{p:-Y P,%R/lib} \
+ %{!p:-Y P,%R/lib}} \
+ %{Qy:} %{!Qn:-Qy} \
+ -m i386nto \
+ %{!shared: --dynamic-linker /usr/lib/ldqnx.so.2}"
+
+
+ #undef SIZE_TYPE
+ #define SIZE_TYPE "unsigned int"
+
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "int"
+
+ #undef WCHAR_TYPE
+ #define WCHAR_TYPE "long unsigned int"
+
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE BITS_PER_WORD
+
+ #define NO_IMPLICIT_EXTERN_C 1
+
diff -rc3p -N -x fastjar -x doc -x ada -x .#* -x CVS -x Makefile.in -x configure -x ntox86 fsf.orig/gcc/gcc/config/i386/t-nto fsf/gcc/gcc/config/i386/t-nto
*** fsf.orig/gcc/gcc/config/i386/t-nto Wed Dec 31 19:00:00 1969
--- fsf/gcc/gcc/config/i386/t-nto Tue Jul 22 11:00:36 2003
***************
*** 0 ****
--- 1,7 ----
+ # Don't run fixproto
+ STMP_FIXPROTO =
+
+ CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fPIC
+ TARGET_LIBGCC2_CFLAGS = -fPIC -fexceptions
+
+ EXTRA_PARTS = crtbegin.o
*** fsf.orig/gcc/gcc/ChangeLog Tue Jul 22 10:48:14 2003
--- fsf/gcc/gcc/ChangeLog Tue Jul 22 14:31:51 2003
***************
*** 1,3 ****
--- 1,9 ----
+ 2003-07-22 Graeme Peterson <gp@qnx.com>
+
+ * config/i386/nto.h: New.
+ * config/i386/t-nto: New.
+ * config.gcc (i[34567]86-*-nto-qnx*): New.
+
2003-07-16 Nathan Sidwell <nathan@codesourcery.com>
* c-common.c (handle_packed_attribute): Don't pack a struct via a