From dde586de6c22edfeb34117d1875100bef9faf6b4 Mon Sep 17 00:00:00 2001 From: Idwer Vollering Date: Wed, 8 Mar 2017 15:31:22 +0100 Subject: [PATCH] UPSTREAM: toolchain: fix compilation of GMP on FreeBSD Built on FreeBSD -CURRENT Obtained from FreeBSD: https://github.com/freebsd/freebsd-ports/commit/bbedec80e36fe22a4f55433c3e6c2a64828fd9da BUG=none BRANCH=none TEST=none Change-Id: I42ee886299c2383abc05b44bb0c2f3190a0483c9 Signed-off-by: Patrick Georgi Original-Commit-Id: 171d1a5979800e3f8d3fc4c55fe08d50367f1dba Original-Change-Id: Ic6b6db8e3a9d86a30c50a09d58566846446031ea Original-Signed-off-by: Idwer Vollering Original-Reviewed-on: https://review.coreboot.org/18675 Original-Reviewed-by: Paul Menzel Original-Reviewed-by: Patrick Georgi Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Nico Huber Reviewed-on: https://chromium-review.googlesource.com/452462 --- .../patches/gmp-6.1.2_freebsd-configure.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 util/crossgcc/patches/gmp-6.1.2_freebsd-configure.patch diff --git a/util/crossgcc/patches/gmp-6.1.2_freebsd-configure.patch b/util/crossgcc/patches/gmp-6.1.2_freebsd-configure.patch new file mode 100644 index 0000000000..5770af6921 --- /dev/null +++ b/util/crossgcc/patches/gmp-6.1.2_freebsd-configure.patch @@ -0,0 +1,20 @@ +--- gmp-6.1.2.orig/configure 2016-12-16 16:45:32.000000000 +0100 ++++ gmp-6.1.2/configure 2017-03-08 14:26:11.194245000 +0100 +@@ -6776,7 +6776,7 @@ + long i; + for (i = 0; i < 88 + 1; i++) + a[i] = ~0L; +- r = malloc (10000 * sizeof (unsigned long)); ++ r = calloc (10000, sizeof (unsigned long)); + r2 = r; + for (i = 0; i < 528; i += 23) + { +@@ -8394,7 +8394,7 @@ + long i; + for (i = 0; i < 88 + 1; i++) + a[i] = ~0L; +- r = malloc (10000 * sizeof (unsigned long)); ++ r = calloc (10000, sizeof (unsigned long)); + r2 = r; + for (i = 0; i < 528; i += 23) + {