Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Apr 1999 10:28:04 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        obrien@NUXI.com
Cc:        dfr@nlsystems.com, gallatin@cs.duke.edu, freebsd-alpha@freebsd.org
Subject:   Re: EGCS and Alpha builds
Message-ID:  <14092.1572.540347.14698D@ett.sat.t.u-tokyo.ac.jp>
In-Reply-To: In your message of "Tue, 06 Apr 1999 18:59:39 %2B0900" <14089.56075.776196.90506E@ett.sat.t.u-tokyo.ac.jp>
References:  <19990404131610.B77056@nuxi.com> <Pine.BSF.4.05.9904042210381.74823-100000@herring.nlsystems.com> <14089.56075.776196.90506E@ett.sat.t.u-tokyo.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

I have finally finished make world on alpha with egcs.
Here is a fix.

- add missing alpha/xm-freebsd.h

- combine alpha/freebsd.h and alpha/freebsd-elf.h, remove freebsd-elf.h
- add missing bits(which are in config/freebsd.h in port) to
  alpha/freebsd.h
- fix LINK_SPEC and sync it with i386

- fix _G_config.h to use va_list as _G_va_list.
	va_list is not just "char *" on alpha.

--- /usr/src/contrib/egcs/gcc/config/alpha/xm-freebsd.h ---
/* Configuration for GCC for DEC ALPHA running FreeBSD as host.  */

#include <alpha/xm-alpha.h>
#include <xm-freebsd.h>
------

--- patch 1 ---
Index: cc_tools/Makefile
===================================================================
RCS file: /pub/FreeBSD-CVS/src/gnu/usr.bin/cc/cc_tools/Makefile,v
retrieving revision 1.18
diff -u -r1.18 Makefile
--- Makefile	1999/04/05 10:18:50	1.18
+++ Makefile	1999/04/07 04:27:47
@@ -157,8 +157,6 @@
 	echo '#include "${MACHINE_ARCH}/freebsd.h"' >> ${.TARGET}
 .if ${MACHINE_ARCH} == "i386"
 	echo '#include "${MACHINE_ARCH}/perform.h"' >> ${.TARGET}
-.elif ${MACHINE_ARCH} == "alpha"
-	echo '#include "${MACHINE_ARCH}/freebsd-elf.h"' >> ${.TARGET}
 .endif
 
 multilib.h: genmultilib
---

--- patch 2 --
Index: freebsd.h
===================================================================
RCS file: /pub/FreeBSD-CVS/src/contrib/egcs/gcc/config/alpha/freebsd.h,v
retrieving revision 1.2
diff -u -r1.2 freebsd.h
--- freebsd.h	1999/04/06 13:09:24	1.2
+++ freebsd.h	1999/04/07 14:29:14
@@ -46,14 +46,19 @@
    XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
    expect it because that's what OSF/1 does. */
 
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/alpha ELF)");
+
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
 
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "\
--D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
-CPP_FBSD_PREDEFINES \
-SUB_CPP_PREDEFINES
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) -D__ELF__" \
+CPP_FBSD_PREDEFINES
+
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
 
 /* Make gcc agree with <machine/ansi.h> */
 
@@ -376,7 +381,7 @@
 #undef SELECT_RTX_SECTION
 #define SELECT_RTX_SECTION(MODE,RTX) const_section()
 
-/* Define the strings used for the special svr4 .type and .size directives.
+/* Define the strings used for the .type, .size and .set directives.
    These strings generally do not vary from one system running svr4 to
    another, but if a given system (e.g. m88k running svr) needs to use
    different pseudo-op names for these, they may be overridden in the
@@ -384,6 +389,7 @@
 
 #define TYPE_ASM_OP	".type"
 #define SIZE_ASM_OP	".size"
+#define SET_ASM_OP	".set"
 
 /* This is how we tell the assembler that two symbols have the same value.  */
 
@@ -441,3 +447,75 @@
 
 #undef PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+
+#undef LINK_SPEC
+#define LINK_SPEC "-m elf64alpha 				\
+  %{p:%e`-p' not supported; use `-pg' and gprof(1)}		\
+  %{Wl,*:%*}							\
+  %{assert*} %{R*} %{rpath*} %{defsym*}				\
+  %{shared:-Bshareable %{h*} %{soname*}}			\
+  %{symbolic:-Bsymbolic}					\
+  %{!shared:							\
+    %{!static:							\
+      %{rdynamic:-export-dynamic}				\
+      %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
+    %{static:-Bstatic}}"
+
+#undef	STARTFILE_SPEC
+#define STARTFILE_SPEC \
+  "%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
+     %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* Provide a ENDFILE_SPEC appropriate for ELF.  Here we tack on the
+   magical crtend.o file which provides part of the support for
+   getting C++ file-scope static object constructed before entering
+   `main', followed by a normal ELF "finalizer" file, `crtn.o'.  */
+
+#undef	ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  "%{!shared:crtend.o%s} %{shared:crtendS.o%s}"
+
+/* Provide a LIB_SPEC appropriate for FreeBSD.  Just select the appropriate
+   libc, depending on whether we're doing profiling.  */
+
+#undef LIB_SPEC
+#define LIB_SPEC "%{!shared:%{!pg:%{!pthread:%{!kthread:-lc}%{kthread:-lpthread-lc}}%{pthread:-lc_r}}%{pg:%{!pthread:%{!kthread:-lc_p}%{kthread:-lpthread_p -lc_p}}%{pthread:-lc_r_p}}}"
+
+/* Implicit library calls should use memcpy, not bcopy, etc.  */
+
+#define TARGET_MEM_FUNCTIONS
+
+/* Handle #pragma weak and #pragma pack.  */
+
+#define HANDLE_SYSV_PRAGMA
+
+/*
+ * Some imports from svr4.h in support of shared libraries.
+ * Currently, we need the DECLARE_OBJECT_SIZE stuff.
+ */
+
+/* This is how we tell the assembler that a symbol is weak.  */
+
+#undef ASM_WEAKEN_LABEL
+#define ASM_WEAKEN_LABEL(FILE,NAME) \
+  do { fputs ("\t.globl\t", FILE); assemble_name (FILE, NAME); \
+       fputc ('\n', FILE); \
+       fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
+       fputc ('\n', FILE); } while (0)
+
+/* The following macro defines the format used to output the second
+   operand of the .type assembler directive.  Different svr4 assemblers
+   expect various different forms for this operand.  The one given here
+   is just a default.  You may need to override it in your machine-
+   specific tm.h file (depending upon the particulars of your assembler).  */
+
+#undef TYPE_OPERAND_FMT
+#define TYPE_OPERAND_FMT	"@%s"
+
+/* Write the extra assembler code needed to declare a function's result.
+   Most svr4 assemblers don't require any special declaration of the
+   result value, but there are exceptions.  */
+
+#ifndef ASM_DECLARE_RESULT
+#define ASM_DECLARE_RESULT(FILE, RESULT)
+#endif

---

--- patch 3 ---
Index: _G_config.h
===================================================================
RCS file: /pub/FreeBSD-CVS/src/gnu/lib/libstdc++/_G_config.h,v
retrieving revision 1.6
diff -u -r1.6 _G_config.h
--- _G_config.h	1999/04/07 07:48:23	1.6
+++ _G_config.h	1999/04/07 16:32:41
@@ -74,7 +74,8 @@
 #endif
 typedef int _G_ssize_t;
 typedef int /* default */ _G_wint_t;
-typedef char * _G_va_list;
+#define _G_NEED_STDARG_H
+#define _G_va_list va_list
 #define _G_signal_return_type void
 #define _G_sprintf_return_type int
 #define _G_HAVE_ATEXIT 1
---

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14092.1572.540347.14698D>