bootstrap on ELF
This commit is contained in:
parent
332e518242
commit
a66c50e872
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.3 2002/09/07 14:02:35 naddy Exp $
|
||||
# $OpenBSD: Makefile,v 1.4 2003/05/08 01:34:43 naddy Exp $
|
||||
|
||||
ONLY_FOR_ARCHS= i386
|
||||
|
||||
@ -23,8 +23,9 @@ MASTER_SITES= ftp://ftp.FreeBSD.org/pub/FreeBSD/ \
|
||||
ftp://ftp.nectec.or.th/pub/FreeBSD/ \
|
||||
ftp://ftp.dnsbalance.ring.gr.jp/pub/FreeBSD/
|
||||
MASTER_SITES:= ${MASTER_SITES:=development/CVSup/ezm3/}
|
||||
MASTER_SITES0= http://grappa.unix-ag.uni-kl.de/~naddy/
|
||||
|
||||
DISTFILES= ${DISTNAME}-${M3ARCH}-boot.tar.bz2 \
|
||||
DISTFILES= ${DISTNAME}a-${M3ARCH}-boot.tar.bz2:0 \
|
||||
${DISTNAME}-src.tar.bz2
|
||||
|
||||
# Ezm3 provides full X11 GUI support even when compiled on systems
|
||||
|
@ -1,6 +1,6 @@
|
||||
MD5 (ezm3-1.0-OpenBSD_386-boot.tar.bz2) = c107c7636b07af246158d93fe27efcb4
|
||||
MD5 (ezm3-1.0-src.tar.bz2) = 7f85f69e420b00a51481dad92f7eb749
|
||||
RMD160 (ezm3-1.0-OpenBSD_386-boot.tar.bz2) = 4c479773e0a9ab349bda050ea7ce443e9238582d
|
||||
MD5 (ezm3-1.0a-OpenBSD_386-boot.tar.bz2) = 724c8070f19c63b24ef5786f6529dbbb
|
||||
RMD160 (ezm3-1.0-src.tar.bz2) = 42082f21bde660731e2f9e8f1c08007ec8b95d31
|
||||
SHA1 (ezm3-1.0-OpenBSD_386-boot.tar.bz2) = 53acd6a0c7ce7cdabbf9a0fdd9b35b6472680541
|
||||
RMD160 (ezm3-1.0a-OpenBSD_386-boot.tar.bz2) = 895796ff62d93ba01e066800fbbdc98e39844a7c
|
||||
SHA1 (ezm3-1.0-src.tar.bz2) = ea9443f6dc5039b471fb1da554d954f18ef44d20
|
||||
SHA1 (ezm3-1.0a-OpenBSD_386-boot.tar.bz2) = 6ca4cdd4478ec818a9cdd6d70f904f280165f5cd
|
||||
|
@ -0,0 +1,338 @@
|
||||
$OpenBSD: patch-language_modula3_m3compiler_m3bootstrap_src_m3makefile,v 1.1 2003/05/08 01:34:43 naddy Exp $
|
||||
--- language/modula3/m3compiler/m3bootstrap/src/m3makefile.orig Thu May 8 01:58:01 2003
|
||||
+++ language/modula3/m3compiler/m3bootstrap/src/m3makefile Thu May 8 01:58:04 2003
|
||||
@@ -0,0 +1,334 @@
|
||||
+%
|
||||
+% Build a specific package, residing in dir, for target
|
||||
+
|
||||
+readonly proc BootstrapPkg(dir,pkg,target,host) is
|
||||
+ local ret = 0
|
||||
+
|
||||
+ % Create a directory for the package e.g. boot-LINUXELF/m3core
|
||||
+
|
||||
+ local targetPkg = "ezm3-" & target & SL & "boot-" & target & SL & pkg
|
||||
+ ret = exec(["mkdir", targetPkg])
|
||||
+
|
||||
+ % Create a soft link to the source in the real package
|
||||
+
|
||||
+ ret = exec(["ln", "-s", ".." & SL & ".." & SL & ".." & SL & dir & SL & pkg &
|
||||
+ SL & "src", "."], [], targetPkg)
|
||||
+
|
||||
+ % Issue the m3build command for the package
|
||||
+
|
||||
+ write("---------- Building " & pkg & " ----------" & CR)
|
||||
+ ret = exec([BIN_USE & SL & "m3build", "-b", target,
|
||||
+ "-T", ".." & SL & ".." & SL & ".." & SL &
|
||||
+ ".." & SL & ".." & SL & ".." & SL &
|
||||
+ ".." & SL & ".." & SL & ".." & SL &
|
||||
+ "m3config" & SL & "src" ,
|
||||
+ "-F", ".." & SL & ".." & SL & ".." & SL & "config.tmpl" ],
|
||||
+ [], targetPkg)
|
||||
+ if not equal(ret, 0) error (BIN_USE & SL & "m3build failed for " & pkg &
|
||||
+ " in " & target & CR) end
|
||||
+
|
||||
+ >> "ezm3-" & target & SL & "config.tmpl" in
|
||||
+ write("override(\"" & pkg & "\",\".." & SL & "..\")" & CR)
|
||||
+ end
|
||||
+end
|
||||
+
|
||||
+%
|
||||
+% Remove the links to the real source directory
|
||||
+
|
||||
+readonly proc CleanPkg(pkg,target) is
|
||||
+ local ret = 0
|
||||
+ ret = exec(["rm", "ezm3-" & target & SL & "boot-" & target & SL & pkg & SL &
|
||||
+ "src"])
|
||||
+end
|
||||
+
|
||||
+%
|
||||
+% Write the command to "make" one package
|
||||
+
|
||||
+readonly proc WriteMakefileLine(pkg,target,options) is
|
||||
+ % In a makefile, only real / may work
|
||||
+ write("\tcd boot-" & target & "/" & pkg & "/" & target &
|
||||
+ "; ${MAKE} -f make.boot " & options, CR)
|
||||
+
|
||||
+end
|
||||
+
|
||||
+%
|
||||
+% Write the global bootstrap makefile
|
||||
+
|
||||
+readonly proc CreateMakefile(file,target,header,options) is
|
||||
+ local exportrpath = "-DEXPORTRPATH=binaries/" & target
|
||||
+
|
||||
+ if equal(target,"NT386GNU")
|
||||
+ exportrpath = "-DEXPORTRPATH=binaries\\\\" & target
|
||||
+ end
|
||||
+
|
||||
+ > file in
|
||||
+ write(header,CR,CR)
|
||||
+
|
||||
+ write("all: boot packages", CR, CR)
|
||||
+
|
||||
+ write("exportall: boot exportpackages", CR, CR)
|
||||
+
|
||||
+ write("packages:", CR)
|
||||
+ write("\tboot-" & target & "/" & "m3build" & "/" & target & "/" &
|
||||
+ "m3build -T ../m3config/src -DBOOTSTRAP=TRUE",
|
||||
+ " ${M3OPTIONS}",CR, CR)
|
||||
+
|
||||
+ write("exportpackages:", CR)
|
||||
+ write("\tboot-" & target & "/" & "m3build" & "/" & target & "/" &
|
||||
+ "m3build -T ../m3config/src -DBOOTSTRAP=TRUE " &
|
||||
+ "${M3OPTIONS} ",exportrpath, CR, CR)
|
||||
+
|
||||
+ write("clean: pkg-clean boot-clean",CR, CR)
|
||||
+
|
||||
+ write("pkg-clean:", CR)
|
||||
+ write("\tboot-" & target & "/" & "m3build" & "/" & target & "/" &
|
||||
+ "m3build -T ../m3config/src -DBOOTSTRAP=TRUE -DCLEAN_ALL",
|
||||
+ " ${M3OPTIONS}",CR, CR)
|
||||
+
|
||||
+ write("nothing:",CR,CR)
|
||||
+
|
||||
+ write("boot:", CR)
|
||||
+ WriteMakefileLine("m3core",target,options)
|
||||
+ WriteMakefileLine("libm3",target,options)
|
||||
+ WriteMakefileLine("m3middle",target,options)
|
||||
+ WriteMakefileLine("m3front",target,options)
|
||||
+ WriteMakefileLine("m3linker",target,options)
|
||||
+ WriteMakefileLine("m3driver",target,options)
|
||||
+ WriteMakefileLine("m3quake",target,options)
|
||||
+ WriteMakefileLine("m3templates",target,options)
|
||||
+ WriteMakefileLine("m3config",target,options)
|
||||
+ WriteMakefileLine("m3build",target,options)
|
||||
+ WriteMakefileLine("m3ship",target,options)
|
||||
+
|
||||
+ write(CR, "boot-clean:", CR)
|
||||
+ WriteMakefileLine("m3core",target, "clean " & options)
|
||||
+ WriteMakefileLine("libm3",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3middle",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3front",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3linker",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3driver",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3quake",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3templates",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3config",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3build",target, "clean " & options)
|
||||
+ WriteMakefileLine("m3ship",target, "clean " & options)
|
||||
+ end
|
||||
+end
|
||||
+
|
||||
+%
|
||||
+% Compile m3cc as a cross compiler for the specified target
|
||||
+
|
||||
+readonly proc CompileCrossCompiler(target,host) is
|
||||
+ local ret = 0
|
||||
+ local m3ccdir = "ezm3-" & target & SL & "m3cc"
|
||||
+
|
||||
+ % Create a subdirectory for m3cc and make links to the source code.
|
||||
+ % Then build it as a cross compiler.
|
||||
+
|
||||
+ write("---------- Creating cross compiler " & host & " to " & target)
|
||||
+ write(" ----------" & CR)
|
||||
+
|
||||
+ ret = exec(["mkdir", m3ccdir])
|
||||
+ ret = exec(["ln", "-s", ".." & SL & ".." & SL & ".." & SL & ".." & SL &
|
||||
+ "m3cc" & SL & "src", "."], [], m3ccdir)
|
||||
+ ret = exec(["ln", "-s", ".." & SL & ".." & SL & ".." & SL & ".." & SL &
|
||||
+ "m3cc" & SL & "gcc", "."], [], m3ccdir)
|
||||
+
|
||||
+ %
|
||||
+ % C compilation is slow, as compared to M3, cache the cross-compiler
|
||||
+ %
|
||||
+
|
||||
+ if CACHE_CROSS_COMPILERS and not(stale(CACHE_CROSS_COMPILERS & SL &
|
||||
+ "m3cgc1-" & target,m3ccdir & SL & "gcc" & SL & "m3.c"))
|
||||
+ ret = exec(["ln","-s",CACHE_CROSS_COMPILERS & SL & "m3cgc1-" & target,
|
||||
+ "ezm3-" & target])
|
||||
+ ret = exec(["rm", "src", "gcc"], [], m3ccdir)
|
||||
+ ret = exec(["rmdir", m3ccdir])
|
||||
+ return
|
||||
+ end
|
||||
+
|
||||
+ ret = exec([BIN_USE & SL & "m3build", "-b", host,
|
||||
+ "-T", ".." & SL & ".." & SL &
|
||||
+ ".." & SL & ".." & SL & ".." & SL &
|
||||
+ ".." & SL & ".." & SL & ".." & SL &
|
||||
+ "m3config" & SL & "src" ,
|
||||
+ "-DM3CC_TARGET=" & target], [], m3ccdir)
|
||||
+ if not equal(ret, 0) error ("m3build failed for m3cc in " & target & CR) end
|
||||
+
|
||||
+ % Keep the cross compiler under target-m3cgc1 and remove everything else.
|
||||
+
|
||||
+ if equal(host,target)
|
||||
+ ret = exec(["mv", host & SL & "m3cgc1", ".." & SL & "m3cgc1-" & target],
|
||||
+ [], m3ccdir)
|
||||
+ else
|
||||
+ ret = exec(["mv", host & "-" & target & SL & "m3cgc1", ".." & SL &
|
||||
+ "m3cgc1-" & target], [], m3ccdir)
|
||||
+ ret = exec(["rm", "-r", host & "-" & target], [], m3ccdir)
|
||||
+ end
|
||||
+ ret = exec(["rm", "-r", host], [], m3ccdir)
|
||||
+ ret = exec(["rm", "src", "gcc"], [], m3ccdir)
|
||||
+ ret = exec(["rmdir", m3ccdir])
|
||||
+
|
||||
+ if CACHE_CROSS_COMPILERS
|
||||
+ ret = exec(["mv","ezm3-" & target & SL & "m3cgc1-" & target,
|
||||
+ CACHE_CROSS_COMPILERS])
|
||||
+ ret = exec(["ln","-s",CACHE_CROSS_COMPILERS & SL & "m3cgc1-" & target,
|
||||
+ "ezm3-" & target])
|
||||
+ end
|
||||
+
|
||||
+ write("---------- Finished cross compiler ----------")
|
||||
+end
|
||||
+
|
||||
+%
|
||||
+% Create everything needed for bootstrapping on platform "target"
|
||||
+
|
||||
+readonly proc BootstrapTarget(target) is
|
||||
+ local ret = 0
|
||||
+ local host = TARGET
|
||||
+
|
||||
+ ret = exec(["mkdir", "ezm3-" & target])
|
||||
+
|
||||
+ CompileCrossCompiler(target,host)
|
||||
+
|
||||
+ % Prepare a config file with bootstrap specific overrides
|
||||
+ % The -O option should prevent using the integrated backend
|
||||
+ % which does not produce assembly; moreover, it may reduce the
|
||||
+ % bootstrap code size.
|
||||
+
|
||||
+ > "ezm3-" & target & SL & "config.tmpl" in
|
||||
+ write("option(\"bootstrap\",\"T\")",CR)
|
||||
+ write("option(\"shared_lib\",\"\")",CR)
|
||||
+ if equal(target,"HPPA") or equal(target,"DS3100") or equal(target,"IRIX5")
|
||||
+ or equal(target,"NT386GNU") or equal(target,"IBMR2")
|
||||
+ write("option(\"optimization\",\"\")",CR)
|
||||
+ else
|
||||
+ write("option(\"optimization\",\"T\")",CR)
|
||||
+ end
|
||||
+ if equal(target,"ALPHA_OSF") or equal(target, "Tru64v5")
|
||||
+ % m3cgc1 generates bad code when -g flag is not used
|
||||
+ write("option(\"debuginfo\",\"T\")",CR)
|
||||
+ else
|
||||
+ write("option(\"debuginfo\",\"" & BOOTDEBUG & "\")",CR)
|
||||
+ end
|
||||
+ write("HOST=\"" & host & "\"",CR)
|
||||
+ write("USE_M3DOC=\"\"",CR)
|
||||
+ write("IBACK=\"\"",CR)
|
||||
+ write("setDefault(\"\",\"\")",CR)
|
||||
+ write("BACKEND=[\"" & path() & SL & ".." & SL & host & SL & "ezm3-" &
|
||||
+ target & SL & "m3cgc1-" & target &
|
||||
+ "\",\"-fno-strength-reduce\",\"-quiet\"]", CR)
|
||||
+ end
|
||||
+
|
||||
+ write("---------- Config file ----------", CR)
|
||||
+ ret = exec(["cat", "ezm3-" & target & SL & "config.tmpl"])
|
||||
+
|
||||
+ ret = exec(["mkdir", "ezm3-" & target & SL & "boot-" & target])
|
||||
+
|
||||
+ % Build all the packages required for m3build and m3ship
|
||||
+ % to obtain a bootstrap m3build and m3ship.
|
||||
+
|
||||
+ BootstrapPkg("../../../../../text/sgmltools","m3doc",target,host)
|
||||
+ BootstrapPkg("../../../../../libs","m3core",target,host)
|
||||
+ BootstrapPkg("../../../../../libs","libm3",target,host)
|
||||
+ BootstrapPkg("../..","m3middle",target,host)
|
||||
+ BootstrapPkg("../..","m3front",target,host)
|
||||
+ BootstrapPkg("../..","m3linker",target,host)
|
||||
+ BootstrapPkg("../..","m3driver",target,host)
|
||||
+ BootstrapPkg("../../../..","m3quake",target,host)
|
||||
+ BootstrapPkg("../..","m3templates",target,host)
|
||||
+ BootstrapPkg("../../../../..","m3config",target,host)
|
||||
+ BootstrapPkg("../..","m3build",target,host)
|
||||
+ BootstrapPkg("../..","m3ship",target,host)
|
||||
+ CleanPkg("m3doc",target)
|
||||
+ CleanPkg("m3core",target)
|
||||
+ CleanPkg("libm3",target)
|
||||
+ CleanPkg("m3middle",target)
|
||||
+ CleanPkg("m3front",target)
|
||||
+ CleanPkg("m3linker",target)
|
||||
+ CleanPkg("m3driver",target)
|
||||
+ CleanPkg("m3quake",target)
|
||||
+ CleanPkg("m3templates",target)
|
||||
+ CleanPkg("m3config",target)
|
||||
+ CleanPkg("m3build",target)
|
||||
+ CleanPkg("m3ship",target)
|
||||
+
|
||||
+ local header = "M3OPTIONS=" & CR
|
||||
+ local options = "\"CC=${CC}\" \"CFLAGS=${CFLAGS}\"" &
|
||||
+ " \"AS=${AS}\" \"ASFLAGS=${ASFLAGS}\"" &
|
||||
+ " \"AR=${AR}\" \"ARFLAGS=${ARFLAGS}\"" &
|
||||
+ " \"RANLIB=${RANLIB}\" \"EXTRALIBS=${EXTRALIBS}\"" &
|
||||
+ " \"LDFLAGS=${LDFLAGS}\""
|
||||
+
|
||||
+ if equal(target,"NT386GNU")
|
||||
+ header = header & "EXTRALIBS=-ladvapi32" & CR
|
||||
+ else if equal(target,"SOLsun")
|
||||
+ header = header & "EXTRALIBS=-lsunmath -lm" & CR
|
||||
+ else if equal(target,"HPPA")
|
||||
+ header = header & "EXTRALIBS=-lm -lBSD" & CR
|
||||
+ else
|
||||
+ header = header & "EXTRALIBS=-lm" & CR
|
||||
+ end
|
||||
+ end
|
||||
+ end
|
||||
+
|
||||
+ if equal(target,"SOLgnu") or equal(target,"SOLsun")
|
||||
+ header = header & "ASFLAGS=-s -P" & CR
|
||||
+ end
|
||||
+
|
||||
+ if equal(target,"HPPA")
|
||||
+ header = header & "AS=gas" & CR
|
||||
+ header = header & "CC=gcc" & CR
|
||||
+ end
|
||||
+
|
||||
+ if equal(target,"LINUXLIBC6")
|
||||
+ include("../../../../../m3config/src/GCWRAP")
|
||||
+ header = header & "LDFLAGS=" & GCWRAPFLAGS & CR
|
||||
+ end
|
||||
+
|
||||
+ if equal(target,"ALPHA_OSF")
|
||||
+ header = header & "CFLAGS=-ieee_with_no_inexact -g3" & CR
|
||||
+ header = header & "LDFLAGS=-ieee_with_no_inexact" & CR
|
||||
+ header = header & "ASFLAGS=-g3" & CR
|
||||
+ end
|
||||
+
|
||||
+ if equal(target,"Tru64v5")
|
||||
+ header = header & "CFLAGS=-ieee_with_no_inexact -g" & CR
|
||||
+ header = header & "LDFLAGS=-ieee_with_no_inexact" & CR
|
||||
+ header = header & "ASFLAGS=-g" & CR
|
||||
+ end
|
||||
+
|
||||
+ if equal(target,"FreeBSD2") or equal(target, "OpenBSD_386")
|
||||
+ header = header & "RANLIB=ranlib" & CR
|
||||
+ else
|
||||
+ header = header & "RANLIB=touch" & CR
|
||||
+ end
|
||||
+
|
||||
+ if equal(target, "FBSD_ALPHA")
|
||||
+ header = header & "CFLAGS=-mieee" & CR
|
||||
+ end
|
||||
+
|
||||
+ CreateMakefile("ezm3-" & target & SL & "Makefile." & target,target,
|
||||
+ header, options)
|
||||
+ CreateMakefile("ezm3-" & target & SL & "Makefile",target,
|
||||
+ header, options)
|
||||
+
|
||||
+ ret = exec(["rm", "ezm3-" & target & SL & "config.tmpl"])
|
||||
+ ret = exec(["rm", "ezm3-" & target & SL & "m3cgc1-" & target])
|
||||
+ write("---------- bootstrap finished for " & target & " ----------", CR)
|
||||
+end
|
||||
+
|
||||
+% Create a bootstrap for each of these "target" in boot-target
|
||||
+%
|
||||
+
|
||||
+CACHE_CROSS_COMPILERS = lookup("CACHE_CROSS_COMPILERS","")
|
||||
+BOOTDEBUG = lookup("BOOTDEBUG","")
|
||||
+
|
||||
+if defined("BOOTTARGET")
|
||||
+ BootstrapTarget(BOOTTARGET)
|
||||
+else
|
||||
+ foreach platform in Platforms
|
||||
+ if Platforms{platform}[3] BootstrapTarget(platform) end
|
||||
+ end
|
||||
+end
|
||||
+
|
||||
+
|
@ -0,0 +1,217 @@
|
||||
$OpenBSD: patch-language_modula3_m3compiler_m3cc_gcc_config_i386_openbsdelf_h,v 1.1 2003/05/08 01:34:43 naddy Exp $
|
||||
--- language/modula3/m3compiler/m3cc/gcc/config/i386/openbsdelf.h.orig Wed May 7 23:25:22 2003
|
||||
+++ language/modula3/m3compiler/m3cc/gcc/config/i386/openbsdelf.h Wed May 7 23:38:22 2003
|
||||
@@ -0,0 +1,213 @@
|
||||
+/* Configuration for an OpenBSD i386 target.
|
||||
+
|
||||
+ Copyright (C) 1999 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. */
|
||||
+
|
||||
+/* Get generic OpenBSD definitions. */
|
||||
+#include <openbsd.h>
|
||||
+
|
||||
+/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
|
||||
+ libraries compiled with the native cc, so undef it. */
|
||||
+#undef NO_DOLLAR_IN_LABEL
|
||||
+
|
||||
+/* Override the default comment-starter of "/". */
|
||||
+#undef ASM_COMMENT_START
|
||||
+#define ASM_COMMENT_START "#"
|
||||
+
|
||||
+
|
||||
+/* This goes away when the math-emulator is fixed */
|
||||
+#undef TARGET_DEFAULT
|
||||
+#define TARGET_DEFAULT \
|
||||
+ (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
|
||||
+
|
||||
+/* Run-time target specifications */
|
||||
+#define CPP_PREDEFINES "-D__unix__ -D__ELF__ -D__i386__ -D__OpenBSD__ -Asystem(unix) -Asystem(OpenBSD) -Acpu(i386) -Amachine(i386)"
|
||||
+
|
||||
+/* As an elf system, we need crtbegin/crtend stuff. */
|
||||
+#undef STARTFILE_SPEC
|
||||
+#define STARTFILE_SPEC "\
|
||||
+ %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
|
||||
+ crtbegin%O%s} %{shared:crtbeginS%O%s}"
|
||||
+#undef ENDFILE_SPEC
|
||||
+#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
|
||||
+
|
||||
+/* Layout of source language data types. */
|
||||
+
|
||||
+/* This must agree with <machine/ansi.h> */
|
||||
+#undef SIZE_TYPE
|
||||
+#define SIZE_TYPE "unsigned int"
|
||||
+
|
||||
+#undef PTRDIFF_TYPE
|
||||
+#define PTRDIFF_TYPE "int"
|
||||
+
|
||||
+#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
|
||||
+
|
||||
+/* Assembler format: overall framework. */
|
||||
+
|
||||
+#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"
|
||||
+
|
||||
+/* The following macros were originally stolen from i386v4.h.
|
||||
+ These have to be defined to get PIC code correct. */
|
||||
+
|
||||
+/* Assembler format: dispatch tables. */
|
||||
+
|
||||
+/* 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. */
|
||||
+#undef ASM_OUTPUT_ADDR_DIFF_ELT
|
||||
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
|
||||
+ fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
|
||||
+
|
||||
+/* Use stabs instead of DWARF debug format. */
|
||||
+#undef PREFERRED_DEBUGGING_TYPE
|
||||
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
+
|
||||
+/* Copy this from the svr4 specifications... */
|
||||
+/* Define the register numbers to be used in Dwarf debugging information.
|
||||
+ The SVR4 reference port C compiler uses the following register numbers
|
||||
+ in its Dwarf output code:
|
||||
+ 0 for %eax (gnu regno = 0)
|
||||
+ 1 for %ecx (gnu regno = 2)
|
||||
+ 2 for %edx (gnu regno = 1)
|
||||
+ 3 for %ebx (gnu regno = 3)
|
||||
+ 4 for %esp (gnu regno = 7)
|
||||
+ 5 for %ebp (gnu regno = 6)
|
||||
+ 6 for %esi (gnu regno = 4)
|
||||
+ 7 for %edi (gnu regno = 5)
|
||||
+ The following three DWARF register numbers are never generated by
|
||||
+ the SVR4 C compiler or by the GNU compilers, but SDB on x86/svr4
|
||||
+ believes these numbers have these meanings.
|
||||
+ 8 for %eip (no gnu equivalent)
|
||||
+ 9 for %eflags (no gnu equivalent)
|
||||
+ 10 for %trapno (no gnu equivalent)
|
||||
+ It is not at all clear how we should number the FP stack registers
|
||||
+ for the x86 architecture. If the version of SDB on x86/svr4 were
|
||||
+ a bit less brain dead with respect to floating-point then we would
|
||||
+ have a precedent to follow with respect to DWARF register numbers
|
||||
+ for x86 FP registers, but the SDB on x86/svr4 is so completely
|
||||
+ broken with respect to FP registers that it is hardly worth thinking
|
||||
+ of it as something to strive for compatibility with.
|
||||
+ The version of x86/svr4 SDB I have at the moment does (partially)
|
||||
+ seem to believe that DWARF register number 11 is associated with
|
||||
+ the x86 register %st(0), but that's about all. Higher DWARF
|
||||
+ register numbers don't seem to be associated with anything in
|
||||
+ particular, and even for DWARF regno 11, SDB only seems to under-
|
||||
+ stand that it should say that a variable lives in %st(0) (when
|
||||
+ asked via an `=' command) if we said it was in DWARF regno 11,
|
||||
+ but SDB still prints garbage when asked for the value of the
|
||||
+ variable in question (via a `/' command).
|
||||
+ (Also note that the labels SDB prints for various FP stack regs
|
||||
+ when doing an `x' command are all wrong.)
|
||||
+ Note that these problems generally don't affect the native SVR4
|
||||
+ C compiler because it doesn't allow the use of -O with -g and
|
||||
+ because when it is *not* optimizing, it allocates a memory
|
||||
+ location for each floating-point variable, and the memory
|
||||
+ location is what gets described in the DWARF AT_location
|
||||
+ attribute for the variable in question.
|
||||
+ Regardless of the severe mental illness of the x86/svr4 SDB, we
|
||||
+ do something sensible here and we use the following DWARF
|
||||
+ register numbers. Note that these are all stack-top-relative
|
||||
+ numbers.
|
||||
+ 11 for %st(0) (gnu regno = 8)
|
||||
+ 12 for %st(1) (gnu regno = 9)
|
||||
+ 13 for %st(2) (gnu regno = 10)
|
||||
+ 14 for %st(3) (gnu regno = 11)
|
||||
+ 15 for %st(4) (gnu regno = 12)
|
||||
+ 16 for %st(5) (gnu regno = 13)
|
||||
+ 17 for %st(6) (gnu regno = 14)
|
||||
+ 18 for %st(7) (gnu regno = 15)
|
||||
+*/
|
||||
+#undef DBX_REGISTER_NUMBER
|
||||
+#define DBX_REGISTER_NUMBER(n) \
|
||||
+((n) == 0 ? 0 \
|
||||
+ : (n) == 1 ? 2 \
|
||||
+ : (n) == 2 ? 1 \
|
||||
+ : (n) == 3 ? 3 \
|
||||
+ : (n) == 4 ? 6 \
|
||||
+ : (n) == 5 ? 7 \
|
||||
+ : (n) == 6 ? 5 \
|
||||
+ : (n) == 7 ? 4 \
|
||||
+ : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
|
||||
+ : (-1))
|
||||
+
|
||||
+/* Assembler format: sections. */
|
||||
+
|
||||
+/* Indicate when jump tables go in the text section. This is
|
||||
+ necessary when compiling PIC code. */
|
||||
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
|
||||
+
|
||||
+/* Stack & calling: aggregate returns. */
|
||||
+
|
||||
+/* Don't default to pcc-struct-return, because gcc is the only compiler, and
|
||||
+ we want to retain compatibility with older gcc versions. */
|
||||
+#define DEFAULT_PCC_STRUCT_RETURN 0
|
||||
+
|
||||
+/* Assembler format: alignment output. */
|
||||
+
|
||||
+#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
|
||||
+ if ((LOG) != 0) {\
|
||||
+ if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
|
||||
+ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+/* Stack & calling: profiling. */
|
||||
+
|
||||
+/* OpenBSD's profiler recovers all information from the stack pointer.
|
||||
+ The icky part is not here, but in machine/profile.h. */
|
||||
+#undef FUNCTION_PROFILER
|
||||
+#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
+ fputs (flag_pic ? "\tcall mcount@PLT\n": "\tcall mcount\n", FILE);
|
||||
+
|
||||
+/* Assembler format: exception region output. */
|
||||
+
|
||||
+/* All configurations that don't use elf must be explicit about not using
|
||||
+ dwarf unwind information. egcs doesn't try too hard to check internal
|
||||
+ configuration files... */
|
||||
+#define DWARF2_UNWIND_INFO 0
|
||||
+
|
||||
+/* Assembler format: alignment output. */
|
||||
+
|
||||
+/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
|
||||
+
|
||||
+/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
|
||||
+
|
||||
+#undef LINK_SPEC
|
||||
+#define LINK_SPEC \
|
||||
+ "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
|
||||
+ %{shared:-shared} %{R*} \
|
||||
+ %{static:-Bstatic} \
|
||||
+ %{!static:-Bdynamic} \
|
||||
+ %{assert*} \
|
||||
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
|
@ -1,10 +1,13 @@
|
||||
$OpenBSD: patch-language_modula3_m3compiler_m3cc_gcc_config_openbsd_h,v 1.1.1.1 2002/02/23 12:30:18 naddy Exp $
|
||||
--- language/modula3/m3compiler/m3cc/gcc/config/openbsd.h.orig Wed May 2 16:11:00 2001
|
||||
+++ language/modula3/m3compiler/m3cc/gcc/config/openbsd.h Wed May 2 16:11:00 2001
|
||||
@@ -0,0 +1,228 @@
|
||||
$OpenBSD: patch-language_modula3_m3compiler_m3cc_gcc_config_openbsd_h,v 1.2 2003/05/08 01:34:43 naddy Exp $
|
||||
--- language/modula3/m3compiler/m3cc/gcc/config/openbsd.h.orig Sun May 4 01:48:54 2003
|
||||
+++ language/modula3/m3compiler/m3cc/gcc/config/openbsd.h Sun May 4 16:47:56 2003
|
||||
@@ -0,0 +1,231 @@
|
||||
+#define STANDARD_STARTFILE_PREFIX "/usr/lib"
|
||||
+#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
|
||||
+#define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
|
||||
+
|
||||
+/* LIB_SPEC appropriate for OpenBSD. Include -lpthread if -pthread is
|
||||
+ specified on the command line. */
|
||||
+#define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
|
||||
+
|
||||
+#ifndef OBSD_HAS_CORRECT_SPECS
|
||||
+
|
||||
|
@ -1,12 +1,12 @@
|
||||
$OpenBSD: patch-language_modula3_m3compiler_m3cc_gcc_configure,v 1.1.1.1 2002/02/23 12:30:21 naddy Exp $
|
||||
--- language/modula3/m3compiler/m3cc/gcc/configure.orig Wed May 2 15:34:58 2001
|
||||
+++ language/modula3/m3compiler/m3cc/gcc/configure Wed May 2 15:52:47 2001
|
||||
$OpenBSD: patch-language_modula3_m3compiler_m3cc_gcc_configure,v 1.2 2003/05/08 01:34:43 naddy Exp $
|
||||
--- language/modula3/m3compiler/m3cc/gcc/configure.orig Mon Jan 29 00:56:13 2001
|
||||
+++ language/modula3/m3compiler/m3cc/gcc/configure Wed May 7 23:19:10 2003
|
||||
@@ -1040,6 +1040,15 @@ for machine in $canon_build $canon_host
|
||||
fixincludes=Makefile.in
|
||||
xmake_file=i386/x-freebsd
|
||||
;;
|
||||
+ i[3456]86-*-openbsd*)
|
||||
+ tm_file=i386/openbsd.h
|
||||
+ tm_file="i386/i386.h i386/att.h svr4.h i386/openbsdelf.h i386/perform.h"
|
||||
+ xm_file=i386/xm-openbsd.h
|
||||
+ # On OpenBSD, the headers are already ok.
|
||||
+ fixincludes=Makefile.in
|
||||
|
@ -1,7 +1,7 @@
|
||||
$OpenBSD: patch-m3config_src_COMMON,v 1.1.1.1 2002/02/23 12:30:15 naddy Exp $
|
||||
--- m3config/src/COMMON.orig Wed May 2 18:03:57 2001
|
||||
+++ m3config/src/COMMON Wed May 2 18:23:51 2001
|
||||
@@ -312,9 +312,9 @@ proc import_DECPEX() is
|
||||
$OpenBSD: patch-m3config_src_COMMON,v 1.2 2003/05/08 01:34:43 naddy Exp $
|
||||
--- m3config/src/COMMON.orig Mon Dec 31 01:00:37 2001
|
||||
+++ m3config/src/COMMON Sun May 4 01:48:54 2003
|
||||
@@ -316,9 +316,9 @@ proc import_DECPEX() is
|
||||
end
|
||||
|
||||
proc import_OpenGL() is
|
||||
@ -14,7 +14,7 @@ $OpenBSD: patch-m3config_src_COMMON,v 1.1.1.1 2002/02/23 12:30:15 naddy Exp $
|
||||
end
|
||||
|
||||
proc import_TCP() is
|
||||
@@ -602,7 +602,7 @@ readonly Platforms = {
|
||||
@@ -606,7 +606,7 @@ readonly Platforms = {
|
||||
"NT386" : [ "WIN32", "32BITS", "i486--nt", "" ],
|
||||
"NT386GNU" : [ "WIN32", "32BITS", "i486--cygwin32", "T" ],
|
||||
"OKI" : [ "POSIX", "32BITS", "i860--sysv4.0", "" ],
|
||||
|
Loading…
Reference in New Issue
Block a user