diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-12-15 19:33:19 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-12-15 19:33:19 +0000 |
commit | 252ffd50cd2a49c054617be4525073f5550059ac (patch) | |
tree | 1af095bada1c9c7758bc2b2d6a15aa4eb4010c36 /net-misc/socat/files | |
parent | Stable for AMD64, wrt bug #392787 (diff) | |
download | gentoo-2-252ffd50cd2a49c054617be4525073f5550059ac.tar.gz gentoo-2-252ffd50cd2a49c054617be4525073f5550059ac.tar.bz2 gentoo-2-252ffd50cd2a49c054617be4525073f5550059ac.zip |
Fix cross-compilation with shift defines.
(Portage version: 2.2.0_alpha79/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/socat/files')
-rw-r--r-- | net-misc/socat/files/socat-1.7.1.3-cross-compile.patch | 45 | ||||
-rw-r--r-- | net-misc/socat/files/socat-1.7.2.0-cross-compile.patch | 45 |
2 files changed, 90 insertions, 0 deletions
diff --git a/net-misc/socat/files/socat-1.7.1.3-cross-compile.patch b/net-misc/socat/files/socat-1.7.1.3-cross-compile.patch new file mode 100644 index 000000000000..f4f391626612 --- /dev/null +++ b/net-misc/socat/files/socat-1.7.1.3-cross-compile.patch @@ -0,0 +1,45 @@ +already sent upstream + +From ceff276b495884e0b6904814f2bcc93dc98da132 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Thu, 15 Dec 2011 14:16:50 -0500 +Subject: [PATCH] add compile-only tests for shift sizes + +We can take advantage of array limits to calculate the shift size +required for constants. If we compile to a value we don't like, +then the array limit will be -1 and trigger a compile error. + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +--- + configure.in | 15 ++++++++++++++- + 1 files changed, 14 insertions(+), 1 deletions(-) + +diff --git a/configure.in b/configure.in +index 45cb88a..15c4d7d 100644 +--- a/configure.in ++++ b/configure.in +@@ -1331,7 +1331,20 @@ AC_CACHE_CHECK(shift offset of $1, $2, + ], + [$2=`cat $conftestoffset`], + [$2=-1], +- [AC_MSG_RESULT(please determine $1_SHIFT manually)] ++ [ ++ i=0 ++ $2=-1 ++ while test $i -lt 64 -a $$2 -eq -1; do ++ AC_TRY_COMPILE([ ++ #include <errno.h> ++ #include <stdio.h> ++ #include <termios.h> ++ #include <string.h> ++ ],[char c[(($1 >> $i) & 1) - 1];], ++ [$2=$i]) ++ i=$(( $i + 1 )) ++ done ++ ] + ) + LIBS="$LIBS1"]) + AC_DEFINE_UNQUOTED($1_SHIFT, ${$2}) +-- +1.7.6.1 + diff --git a/net-misc/socat/files/socat-1.7.2.0-cross-compile.patch b/net-misc/socat/files/socat-1.7.2.0-cross-compile.patch new file mode 100644 index 000000000000..3e854c31958f --- /dev/null +++ b/net-misc/socat/files/socat-1.7.2.0-cross-compile.patch @@ -0,0 +1,45 @@ +already sent upstream + +From ceff276b495884e0b6904814f2bcc93dc98da132 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Thu, 15 Dec 2011 14:16:50 -0500 +Subject: [PATCH] add compile-only tests for shift sizes + +We can take advantage of array limits to calculate the shift size +required for constants. If we compile to a value we don't like, +then the array limit will be -1 and trigger a compile error. + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +--- + configure.in | 15 ++++++++++++++- + 1 files changed, 14 insertions(+), 1 deletions(-) + +diff --git a/configure.in b/configure.in +index 45cb88a..15c4d7d 100644 +--- a/configure.in ++++ b/configure.in +@@ -1331,7 +1331,20 @@ AC_CACHE_CHECK(shift offset of $1, $2, + ], + [$2=`cat $conftestoffset`], + [$2=-1], +- [$2=-1] ++ [ ++ i=0 ++ $2=-1 ++ while test $i -lt 64 -a $$2 -eq -1; do ++ AC_TRY_COMPILE([ ++ #include <errno.h> ++ #include <stdio.h> ++ #include <termios.h> ++ #include <string.h> ++ ],[char c[(($1 >> $i) & 1) - 1];], ++ [$2=$i]) ++ i=$(( $i + 1 )) ++ done ++ ] + ) + LIBS="$LIBS1"]) + AC_DEFINE_UNQUOTED($1_SHIFT, ${$2}) +-- +1.7.6.1 + |