summaryrefslogtreecommitdiff
path: root/debian/patches/libgnatprj-cross-hack.diff
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/libgnatprj-cross-hack.diff')
-rw-r--r--debian/patches/libgnatprj-cross-hack.diff66
1 files changed, 66 insertions, 0 deletions
diff --git a/debian/patches/libgnatprj-cross-hack.diff b/debian/patches/libgnatprj-cross-hack.diff
new file mode 100644
index 0000000..d24be75
--- /dev/null
+++ b/debian/patches/libgnatprj-cross-hack.diff
@@ -0,0 +1,66 @@
+This is a gross hack to cross build libgnatprj without having the
+gmp.h header for the target architecture. Are libgnatvsn and libgnatprj
+really target libraries, or host libraries? The odd thing is that
+the gnat cross build tools are not linked against these two libraries.
+
+Index: b/src/gcc/wide-int.h
+===================================================================
+--- a/src/gcc/wide-int.h
++++ b/src/gcc/wide-int.h
+@@ -3106,8 +3106,10 @@ namespace wi
+ wide_int from_buffer (const unsigned char *, unsigned int);
+
+ #ifndef GENERATOR_FILE
++#ifndef LIBGNATPRJ_CROSS_HACK
+ void to_mpz (const wide_int_ref &, mpz_t, signop);
+ #endif
++#endif
+
+ wide_int mask (unsigned int, bool, unsigned int);
+ wide_int shifted_mask (unsigned int, unsigned int, bool, unsigned int);
+Index: b/src/gcc/system.h
+===================================================================
+--- a/src/gcc/system.h
++++ b/src/gcc/system.h
+@@ -678,8 +678,10 @@ extern int vsnprintf (char *, size_t, co
+
+ /* Do not introduce a gmp.h dependency on the build system. */
+ #ifndef GENERATOR_FILE
++#ifndef LIBGNATPRJ_CROSS_HACK
+ #include <gmp.h>
+ #endif
++#endif
+
+ /* Get libiberty declarations. */
+ #include "libiberty.h"
+Index: b/src/libgnatprj/Makefile.in
+===================================================================
+--- a/src/libgnatprj/Makefile.in
++++ b/src/libgnatprj/Makefile.in
+@@ -37,7 +37,7 @@ TOOLS_TARGET_PAIRS := @TOOLS_TARGET_PAIR
+ LN_S := @LN_S@
+
+ ifneq (@build@,@host@)
+- CFLAGS += -b @host@
++ override CFLAGS += -DLIBGNATPRJ_CROSS_HACK
+ endif
+
+ .PHONY: libgnatprj install
+Index: b/src/gcc/double-int.h
+===================================================================
+--- a/src/gcc/double-int.h
++++ b/src/gcc/double-int.h
+@@ -429,11 +429,13 @@ double_int::popcount () const
+
+
+ #ifndef GENERATOR_FILE
++#ifndef LIBGNATPRJ_CROSS_HACK
+ /* Conversion to and from GMP integer representations. */
+
+ void mpz_set_double_int (mpz_t, double_int, bool);
+ double_int mpz_get_double_int (const_tree, mpz_t, bool);
+ #endif
++#endif
+
+ namespace wi
+ {