aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-11 16:14:42 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-11 16:14:42 +0200
commitadc23369a9cdbae235916bf44560b8469dd4831f (patch)
treee8510681b9eaa6a4e663ce29a87e2a504b4839c1
parentfa27e482f043116bb39ff4d410f12f0b09a18f3b (diff)
downloadcompcert-kvx-adc23369a9cdbae235916bf44560b8469dd4831f.tar.gz
compcert-kvx-adc23369a9cdbae235916bf44560b8469dd4831f.zip
cleaner: put all the special types, defines etc. in one header file
-rwxr-xr-xconfigure2
-rw-r--r--runtime/Makefile3
-rw-r--r--runtime/include/ccomp_k1c_fixes.h11
3 files changed, 15 insertions, 1 deletions
diff --git a/configure b/configure
index 5852205e..d1880167 100755
--- a/configure
+++ b/configure
@@ -448,7 +448,7 @@ if test "$arch" = "mppa_k1c"; then
libdir="$HOME/.usr/lib"
clinker_options="$model_options -L$libdir -Wl,-rpath=$libdir"
cprepro="k1-mbr-gcc"
- cprepro_options="$model_options -std=c99 -U__GNUC__ -U__SIZEOF_INT128__ -E -D__thread='' -D__int128='struct { long __int128_ccomp_low; long __int128_ccomp_high; }'"
+ cprepro_options="$model_options -std=c99 -E -include ccomp_k1c_fixes.h"
libmath="-lm"
system="linux"
fi
diff --git a/runtime/Makefile b/runtime/Makefile
index 6be85728..174a0a41 100644
--- a/runtime/Makefile
+++ b/runtime/Makefile
@@ -41,6 +41,9 @@ LIB=libcompcert.a
INCLUDES=include/float.h include/stdarg.h include/stdbool.h \
include/stddef.h include/varargs.h include/stdalign.h \
include/stdnoreturn.h
+ifeq ($(ARCH),mppa_k1c)
+INCLUDES += include/ccomp_k1c_fixes.h
+endif
VPATH=$(ARCH)
diff --git a/runtime/include/ccomp_k1c_fixes.h b/runtime/include/ccomp_k1c_fixes.h
new file mode 100644
index 00000000..679ab1ac
--- /dev/null
+++ b/runtime/include/ccomp_k1c_fixes.h
@@ -0,0 +1,11 @@
+#ifndef __CCOMP_KIC_FIXES_H
+#define __CCOMP_KIC_FIXES_H
+
+#undef __GNUC__
+#define __thread
+
+struct __int128_ccomp { long __int128_ccomp_low; long __int128_ccomp_high; };
+
+#define __int128 struct __int128_ccomp
+
+#endif