summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-05-07 22:01:37 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-05-07 22:01:37 +0200
commit6ab8513df36438aa2c16facc94f306891446e061 (patch)
tree1f9a82d3bef9233b968a02b7ce359dc1755a3ce7
parentfc68c08556caddcbc5dffadcf853b27262ce77c7 (diff)
downloadllvm-6ab8513df36438aa2c16facc94f306891446e061.tar.gz
llvm-6ab8513df36438aa2c16facc94f306891446e061.tar.bz2
llvm-6ab8513df36438aa2c16facc94f306891446e061.tar.xz
[Embtk]: Give ability to specify default target ABI at configure time
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r--autoconf/configure.ac8
-rwxr-xr-xconfigure18
-rw-r--r--include/llvm/Config/config.h.cmake3
-rw-r--r--include/llvm/Config/config.h.in3
-rw-r--r--include/llvm/Config/llvm-config.h.cmake3
-rw-r--r--include/llvm/Config/llvm-config.h.in3
-rw-r--r--include/llvm/Support/Host.h8
-rw-r--r--lib/Support/Unix/Host.inc8
-rw-r--r--lib/Support/Windows/Host.inc8
9 files changed, 61 insertions, 1 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 72e63b4b55..a568d550e9 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -483,6 +483,14 @@ if test "x$with_default_hash_style" != "x" ; then
[Default hash-style to use to all linker invocations.])
fi
+dnl Default cpu (-mabi=abi) to use to all compiler invocations
+AC_ARG_WITH(default-abi,
+ AS_HELP_STRING([--with-default-abi],
+ [Add by default -mabi=abi (if --with-default-abi=abi) to all compiler invocations.]),,
+ with_default_abi="")
+AC_DEFINE_UNQUOTED([LLVM_DEFAULT_TARGET_ABI],"$with_default_abi",
+ [Add by default -mabi=abi to all compiler invocations.])
+
dnl Check for the endianness of the target
AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
diff --git a/configure b/configure
index 0c3773f015..bec0443b6b 100755
--- a/configure
+++ b/configure
@@ -1463,6 +1463,8 @@ Optional Packages:
case of hard float.
Default hash-style to use to all linker invocations: gnu
+ --with-default-abi Add by default -mabi=abi (if --with-default-abi=abi)
+ to all compiler invocations.
--with-optimize-option Select the compiler options to use for optimized
builds
--with-extra-options Specify additional options to compile LLVM with
@@ -4144,6 +4146,20 @@ _ACEOF
fi
+# Check whether --with-default-abi was given.
+if test "${with_default_abi+set}" = set; then
+ withval=$with_default_abi;
+else
+ with_default_abi=""
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define LLVM_DEFAULT_TARGET_ABI "$with_default_abi"
+_ACEOF
+
+
+
{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
@@ -10602,7 +10618,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10605 "configure"
+#line 10621 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake
index 9db4a989ef..9a6caf72bc 100644
--- a/include/llvm/Config/config.h.cmake
+++ b/include/llvm/Config/config.h.cmake
@@ -570,6 +570,9 @@
/* Installation directory for data files */
#cmakedefine LLVM_DATADIR "${LLVM_DATADIR}"
+/* Add by default -mabi=abi to all compiler invocations. */
+#cmakedefine LLVM_DEFAULT_TARGET_ABI "${LLVM_DEFAULT_TARGET_ABI}"
+
/* Default float abi to use to all compiler invocations. */
#cmakedefine LLVM_DEFAULT_TARGET_FLOAT "${LLVM_DEFAULT_TARGET_FLOAT}"
diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in
index 12cf65db53..c585478f2d 100644
--- a/include/llvm/Config/config.h.in
+++ b/include/llvm/Config/config.h.in
@@ -575,6 +575,9 @@
/* Installation directory for data files */
#undef LLVM_DATADIR
+/* Add by default -mabi=abi to all compiler invocations. */
+#undef LLVM_DEFAULT_TARGET_ABI
+
/* Default float abi to use to all compiler invocations. */
#undef LLVM_DEFAULT_TARGET_FLOAT
diff --git a/include/llvm/Config/llvm-config.h.cmake b/include/llvm/Config/llvm-config.h.cmake
index 8006c74092..de6c7ea8b1 100644
--- a/include/llvm/Config/llvm-config.h.cmake
+++ b/include/llvm/Config/llvm-config.h.cmake
@@ -25,6 +25,9 @@
/* Installation directory for data files */
#cmakedefine LLVM_DATADIR "${LLVM_DATADIR}"
+/* Add by default -mabi=abi to all compiler invocations. */
+#cmakedefine LLVM_DEFAULT_TARGET_ABI "${LLVM_DEFAULT_TARGET_ABI}"
+
/* Default float abi to use to all compiler invocations. */
#cmakedefine LLVM_DEFAULT_TARGET_FLOAT "${LLVM_DEFAULT_TARGET_FLOAT}"
diff --git a/include/llvm/Config/llvm-config.h.in b/include/llvm/Config/llvm-config.h.in
index 2cebd80b28..08387d3cd6 100644
--- a/include/llvm/Config/llvm-config.h.in
+++ b/include/llvm/Config/llvm-config.h.in
@@ -25,6 +25,9 @@
/* Installation directory for data files */
#undef LLVM_DATADIR
+/* Add by default -mabi=abi to all compiler invocations. */
+#undef LLVM_DEFAULT_TARGET_ABI
+
/* Default float abi to use to all compiler invocations. */
#undef LLVM_DEFAULT_TARGET_FLOAT
diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h
index 48bc93edb7..ab52671861 100644
--- a/include/llvm/Support/Host.h
+++ b/include/llvm/Support/Host.h
@@ -79,6 +79,14 @@ namespace sys {
/// to generate by default code with a given hash-style and false otherwise.
bool hasDefaultTargetHashStyle();
+ /// getDefaultTargetAbi() - Return the default target ABI for which the
+ /// compiler is configured to generate code for, or "" if empty.
+ std::string getDefaultTargetAbi();
+
+ /// hasDefaultTargetAbi() - Return true if the compiler was configured to
+ /// generate code for a given ABI and false otherwise.
+ bool hasDefaultTargetAbi();
+
/// getProcessTriple() - Return an appropriate target triple for generating
/// code to be loaded into the current process, e.g. when using the JIT.
std::string getProcessTriple();
diff --git a/lib/Support/Unix/Host.inc b/lib/Support/Unix/Host.inc
index 5b55b4f0e9..28828eb83c 100644
--- a/lib/Support/Unix/Host.inc
+++ b/lib/Support/Unix/Host.inc
@@ -93,3 +93,11 @@ std::string sys::getDefaultTargetHashStyle() {
bool sys::hasDefaultTargetHashStyle() {
return getDefaultTargetHashStyle() != "";
}
+
+std::string sys::getDefaultTargetAbi() {
+ return LLVM_DEFAULT_TARGET_ABI;
+}
+
+bool sys::hasDefaultTargetAbi() {
+ return getDefaultTargetAbi() != "";
+}
diff --git a/lib/Support/Windows/Host.inc b/lib/Support/Windows/Host.inc
index 5c8bcaaf0c..1933bf7e87 100644
--- a/lib/Support/Windows/Host.inc
+++ b/lib/Support/Windows/Host.inc
@@ -52,3 +52,11 @@ std::string sys::getDefaultTargetHashStyle() {
bool sys::hasDefaultTargetHashStyle() {
return getDefaultTargetHashStyle() != "";
}
+
+std::string sys::getDefaultTargetAbi() {
+ return LLVM_DEFAULT_TARGET_ABI;
+}
+
+bool sys::hasDefaultTargetAbi() {
+ return getDefaultTargetAbi() != "";
+}