This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patches to remove dependance on linux.h for FreeBSD
- To: egcs-patches at egcs dot cygnus dot com
- Subject: patches to remove dependance on linux.h for FreeBSD
- From: "David O'Brien" <obrien at NUXI dot com>
- Date: Wed, 19 May 1999 21:01:43 -0700
- Organization: The NUXI BSD group
- Reply-To: obrien at NUXI dot com
Here is a set of patches against the 1999-05-17 snapshot. The primary
goal of these patches is to remove the dependence of linux.h by
freebsd-elf.h. The patches also reduces all the tm_files for
FreeBSD/ELF. They also effectively move config/i386/t-freebsd to config/
as this file is also used as-is by alpha/freebsd.h (to be donated at a
future time).
GCC
~~~
David O'Brien <obrien@FreeBSD.org>
* configure.in (i[34567]86-*-freebsdelf): don't include linux.h,
i386/freebsd-elf.h no longer requires it.
* i386/freebsd-elf.h (FreeBSD): Don't depend on linux.h, i386.h, and
perform.h being included for FreeBSD i386 ELF targets. freebsd-elf.h
no longer depends on linux.h, and freebsd-elf.h now includes i386.h
and perform.h directly.
* i386/freebsd.h (FreeBSD): Remove the "FREEBSD_NATIVE" cruft that
does not even match what was used in config/i386/freebsd.h in the FreeBSD
2.x base tree.
* config/t-freebsd: moved from config/i386/ so it can used for all
FreeBSD targets
diff -ruN egcs-19990517/gcc/config/i386/freebsd-elf.h egcs-19990517.new/gcc/config/i386/freebsd-elf.h
--- egcs-19990517/gcc/config/i386/freebsd-elf.h Fri Apr 9 13:31:31 1999
+++ egcs-19990517.new/gcc/config/i386/freebsd-elf.h Wed May 19 20:43:10 1999
@@ -3,6 +3,7 @@
Contributed by Eric Youngdale.
Modified for stabs-in-ELF by H.J. Lu.
Adapted from GNU/Linux version by John Polstra.
+ Continued development by David O'Brien <obrien@freebsd.org>
This file is part of GNU CC.
@@ -21,6 +22,18 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+
+#include <i386/i386.h> /* Base i386 target machine definitions */
+#include <i386/att.h> /* Use the i386 AT&T assembler syntax */
+
+/* Use stabs instead of DWARF debug format. */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#include <svr4.h>
+
+/* Get perform_* macros to build libgcc.a. */
+#include <i386/perform.h>
+
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
@@ -34,6 +47,23 @@
libraries compiled with the native cc, so undef it. */
#undef NO_DOLLAR_IN_LABEL
+/* Use more efficient ``thunks'' to implement C++ vtables. */
+#undef DEFAULT_VTABLE_THUNKS
+#define DEFAULT_VTABLE_THUNKS 1
+
+/* Override the default comment-starter of "/". */
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "#"
+
+#undef ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+#undef ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
+
+#undef SET_ASM_OP
+#define SET_ASM_OP ".set"
+
/* This is how to output an element of a case-vector that is relative.
This is only used for PIC code. See comments by the `casesi' insn in
i386.md for an explanation of the expression this outputs. */
@@ -140,6 +170,9 @@
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
+
+#undef WCHAR_UNSIGNED
+#define WCHAR_UNSIGNED 0
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
@@ -149,6 +182,17 @@
#undef CPP_SPEC
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+
+/* This defines which switch letters take arguments. On FreeBSD, most of
+ the normal cases (defined in gcc.c) apply, and we also have -h* and
+ -z* options (for the linker) (comming from svr4).
+ We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
+
+#define SWITCH_TAKES_ARG(CHAR) \
+ (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
+ || (CHAR) == 'h' \
+ || (CHAR) == 'z' \
+ || (CHAR) == 'R')
#undef LIB_SPEC
#if 1
diff -ruN egcs-19990517/gcc/config/i386/freebsd.h egcs-19990517.new/gcc/config/i386/freebsd.h
--- egcs-19990517/gcc/config/i386/freebsd.h Tue Mar 23 13:34:48 1999
+++ egcs-19990517.new/gcc/config/i386/freebsd.h Wed May 19 20:18:22 1999
@@ -245,30 +245,3 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-
-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
- */
-
-#ifdef FREEBSD_NATIVE
-
-#define INCLUDE_DEFAULTS { \
- { "/usr/include", 0, 0, 0 }, \
- { "/usr/include/g++", "G++", 1, 1 }, \
- { 0, 0, 0, 0} \
- }
-
-#undef MD_EXEC_PREFIX
-#define MD_EXEC_PREFIX "/usr/libexec/"
-
-#undef STANDARD_STARTFILE_PREFIX
-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
-
-#if 0 /* This is very wrong!!! */
-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
-#endif
-
-#endif /* FREEBSD_NATIVE */
diff -ruN egcs-19990517/gcc/config/i386/t-freebsd egcs-19990517.new/gcc/config/i386/t-freebsd
--- egcs-19990517/gcc/config/i386/t-freebsd Wed Dec 16 13:04:28 1998
+++ egcs-19990517.new/gcc/config/i386/t-freebsd Wed May 19 20:22:17 1999
@@ -1,5 +0,0 @@
-# Don't run fixproto
-STMP_FIXPROTO =
-# Use only native include files
-USER_H = $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
-
diff -ruN egcs-19990517/gcc/config/t-freebsd egcs-19990517.new/gcc/config/t-freebsd
--- egcs-19990517/gcc/config/t-freebsd Wed Dec 31 16:00:00 1969
+++ egcs-19990517.new/gcc/config/t-freebsd Wed Dec 16 13:04:28 1998
@@ -0,0 +1,5 @@
+# Don't run fixproto
+STMP_FIXPROTO =
+# Use only native include files
+USER_H = $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
+
diff -ruN egcs-19990517/gcc/configure.in egcs-19990517.new/gcc/configure.in
--- egcs-19990517/gcc/configure.in Wed May 12 10:38:26 1999
+++ egcs-19990517.new/gcc/configure.in Wed May 19 20:21:45 1999
@@ -1137,9 +1137,9 @@
changequote(,)dnl
i[34567]86-*-freebsdelf*)
changequote([,])dnl
- tm_file="i386/i386.h i386/att.h linux.h i386/freebsd-elf.h i386/perform.h"
+ tm_file="i386/freebsd-elf.h"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+ tmake_file=t-freebsd
gas=yes
gnu_ld=yes
stabs=yes
@@ -1148,7 +1148,7 @@
i[34567]86-*-freebsd*)
changequote([,])dnl
tm_file=i386/freebsd.h
- tmake_file=i386/t-freebsd
+ tmake_file=t-freebsd
;;
changequote(,)dnl
i[34567]86-*-netbsd*)