gccfix.diff 887 B

12345678910111213141516171819202122232425262728
  1. From ea0c2d76c4f16eccaafcb2c0741f76825505bafc Mon Sep 17 00:00:00 2001
  2. From: Nico Huber <nico.huber@secunet.com>
  3. Date: Thu, 22 Dec 2016 16:05:54 +0100
  4. Subject: [PATCH] DONOTMERGE buildgcc: Build GMP `--with-pic` if GCC defaults to `-pie`
  5. Change-Id: I5f3185af9c8d599379a628e18724b217b88be974
  6. Signed-off-by: Nico Huber <nico.huber@secunet.com>
  7. ---
  8. diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
  9. index 97c38b8..4eefd43 100755
  10. --- a/util/crossgcc/buildgcc
  11. +++ b/util/crossgcc/buildgcc
  12. @@ -515,6 +515,13 @@
  13. }
  14. build_GMP() {
  15. + # Check if GCC enables `-pie` by default (likely on Debian Stretch).
  16. + # We have to use `--with-pic` then.
  17. + if "${CC}" -dumpspecs 2>/dev/null | grep -q '[{;][[:space:]]*:-pie\>'
  18. + then
  19. + OPTIONS="$OPTIONS --with-pic"
  20. + fi
  21. +
  22. CC="$CC" ../${GMP_DIR}/configure --disable-shared --enable-fat \
  23. --prefix=$TARGETDIR $OPTIONS \
  24. || touch .failed