[prev in list] [next in list] [prev in thread] [next in thread]
List: pcc-list
Subject: [Pcc] (no subject)
From: Antoine LECA <antoine64leca () hotmail ! com>
Date: 2014-12-12 18:40:05
Message-ID: BLU436-SMTP493273CEDCD3DF0DDE24EDB0600 () phx ! gbl
[Download RAW message or body]
From 24eb5b618cf2df95bd245fa395d13030d3c3d677 Mon Sep 17 00:00:00 2001
From: Antoine Leca <antoine64leca@hotmail.com>
To: pcc@lists.ludd.ltu.se
Date: Fri, 12 Dec 2014 19:23:58 +0100
Subject: [PATCH 6/9#2] Adapt new driver to MINIX
X-Mailer: git-send-email 1.8.0.msysgit.0
In-Reply-To: <BLU437-SMTP852E7D1E6836E73071E9D8B0600@phx.gbl>
<1418397841-1316-1-git-send-email-antoine64leca@hotmail.com>
References: <1418397841-1316-1-git-send-email-antoine64leca@hotmail.com>
Hi again,
Sorry for that, but it seems I mixed some versions of the patches while
sending and there is a small (minor) error within that patch.
Here is a corrected version:
Antoine
---
cc/cc/cc.c | 2 +-
configure | 2 ++
configure.ac | 2 ++
os/minix/ccconfig.h | 75 ++++++++++++++++++++++++++++++++++-------------------
4 files changed, 53 insertions(+), 28 deletions(-)
diff --git a/cc/cc/cc.c b/cc/cc/cc.c
index 11dd04b..803a60a 100644
--- a/cc/cc/cc.c
+++ b/cc/cc/cc.c
@@ -1584,7 +1584,7 @@ static char *fpflags[] = {
#ifdef TARGET_FLT_EVAL_METHOD
"-D__FLT_EVAL_METHOD__=" MKS(TARGET_FLT_EVAL_METHOD),
#endif
-#if defined(os_darwin) || defined(os_netbsd)
+#if defined(os_darwin) || defined(os_netbsd) || defined(os_minix)
"-D__FLT_RADIX__=2",
#if defined(mach_vax)
"-D__FLT_DIG__=6",
diff --git a/configure b/configure
index 854ec84..3ab12e6 100755
--- a/configure
+++ b/configure
@@ -2429,6 +2429,8 @@ case "$target_os" in
case "$target_cpu" in
i86) targmach=i86 ;;
i?86) targmach=i386 ;;
+ arm*) targmach=arm ;;
+ x86_64) targmach=amd64 ;;
esac
;;
diff --git a/configure.ac b/configure.ac
index 5aba115..1e014ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,6 +134,8 @@ case "$target_os" in
case "$target_cpu" in
i86) targmach=i86 ;;
i?86) targmach=i386 ;;
+ arm*) targmach=arm ;;
+ x86_64) targmach=amd64 ;;
esac
;;
diff --git a/os/minix/ccconfig.h b/os/minix/ccconfig.h
index 97d7dfe..3aad6e9 100644
--- a/os/minix/ccconfig.h
+++ b/os/minix/ccconfig.h
@@ -31,50 +31,67 @@
* MINIX (http://www.minix3.org), both Classic a.out=PC/IX and ELF
*/
-#ifndef LIBDIR
-#ifdef LIBEXECDIR
-#define LIBDIR LIBEXECDIR "../lib/"
-#else
-#define LIBDIR "/usr/lib/"
-#endif
-#endif
-
#ifdef ELFABI
+/* MINIX versions 3.2 (2011) and up, using NetBSD userland. */
+
/* common cpp predefines */
#define CPPADD { "-D__minix", "-D__ELF__", NULL }
-/* linker stuff */
-#define STARTLABEL "_start"
-#define CRT0FILE LIBDIR "crt1.o"
-#define CRT0FILE_PROFILE LIBDIR "gcrt1.o"
-#define LIBCLIBS { "-lc", "-lpcc", NULL }
+/* host-independent */
+#define DYNLINKER { "-dynamic-linker", "/libexec/ld.elf_so", NULL }
-#define STARTFILES { LIBDIR "crti.o", /*LIBDIR "crtbegin.o",*/ NULL }
-#define ENDFILES { /*LIBDIR "crtend.o",*/ LIBDIR "crtn.o", NULL }
+#define CRTEND_T "crtend.o"
-#define STARTFILES_S { LIBDIR "crti.o", /*LIBDIR "crtbeginS.o",*/ NULL }
-#define ENDFILES_S { /*LIBDIR "crtendS.o",*/ LIBDIR "crtn.o", NULL }
+#define DEFLIBS { "-lc", NULL }
+#define DEFPROFLIBS { "-lc_p", NULL }
+#define DEFCXXLIBS { "-lp++", "-lc", NULL }
+
+#if defined(mach_amd64)
+#include "../inc/amd64.h"
+#define PCC_SIZE_TYPE "unsigned long"
+#define PCC_PTRDIFF_TYPE "long"
+#elif defined(mach_arm)
+#define CPPMDADD { "-D__arm__", NULL, }
+#elif defined(mach_i386)
+#define CPPMDADD { "-D__i386", "-D__i386__", NULL, }
+#else
+#error defines for arch missing
+#endif
+
+#ifndef PCC_WINT_TYPE
+#define PCC_WINT_TYPE "int"
+#endif
+#ifndef PCC_SIZE_TYPE
+#define PCC_SIZE_TYPE "unsigned int"
+#endif
+#ifndef PCC_PTRDIFF_TYPE
+#define PCC_PTRDIFF_TYPE "int"
+#endif
#elif defined(AOUTABI)
+/* MINIX 2 or 3.1.x, a.out-like format derived from PC/IX. */
/* common cpp predefines */
#define CPPADD { "-D__minix", NULL }
/* linker stuff */
#define STARTLABEL "crtso"
-#define CRT0FILE LIBDIR "crtso.o"
-/* #define CRT0FILE_PROFILE "/usr/lib/pcc/gcrtso.o" */
-#define LIBCLIBS { "-L" LIBDIR "pcc", \
- "-lc", "-lpcc", "-lend", NULL }
-#define noSTARTFILES { LIBDIR "crti.o", LIBDIR "crtbegin.o", NULL }
-#define noENDFILES { LIBDIR "crtend.o", LIBDIR "crtn.o", NULL }
-
-#else
-#error defines for ABI missing
+#define CRT0 "crtso.o"
+#ifdef notyet
+#define GCRT0 "/usr/lib/pcc/gcrtso.o"
#endif
+#define CRTBEGIN 0
+#define CRTEND 0
+#define CRTBEGIN_S 0
+#define CRTEND_S 0
+#define CRTBEGIN_T 0
+#define CRTEND_T 0
+#define CRTI ((char*)0)
+#define CRTN "-lend"
+
#if defined(mach_i386)
-#define CPPMDADD { "-D__i386", \
+#define CPPMDADD { "-D__i386", "-D__i386__", \
"-D_EM_WSIZE=4", "-D_EM_PSIZE=4", "-D_EM_LSIZE=4", \
"-D_EM_SSIZE=2", "-D_EM_FSIZE=4", "-D_EM_DSIZE=8", \
NULL, }
@@ -84,3 +101,7 @@
"-D_EM_SSIZE=2", "-D_EM_FSIZE=4", "-D_EM_DSIZE=8", \
NULL, }
#endif
+
+#else
+#error defines for ABI missing
+#endif
--
1.8.0.msysgit.0
_______________________________________________
Pcc mailing list
Pcc@lists.ludd.ltu.se
https://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic