Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Kundrát" <jan.kundrat@cesnet.cz>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] gcc: Fix build failure related to -fPIC for x86_64 -> i686 builds
Date: Wed, 12 Apr 2017 23:09:01 +0200	[thread overview]
Message-ID: <mailman.0.1492031512.22514.buildroot@busybox.net> (raw)

Without this patch, I cannot build the toolchain (both host-gcc-initial
and -final) on Gentoo's amd64 using GCC 4.9.3:

  /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld:
  gcov.o: relocation R_X86_64_32 against `.rodata.str1.8' can not
  be used when making a shared object; recompile with -fPIC

According to the GCC mailing list, a similar problem [1] related to
libgccjit was fixed by passing --enable-host-shared. My failure doesn't
appear to have anything in common with libgccjit, but that configure
flag fixed my build as well.

I wonder if we actually need gcov in the first stage of a GCC build...

[1] https://gcc.gnu.org/ml/gcc-help/2016-03/msg00026.html

Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>
---
 package/gcc/gcc.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index b52f945..1e760d0 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -92,6 +92,7 @@ HOST_GCC_COMMON_CONF_OPTS = \
 	--with-gnu-ld \
 	--disable-libssp \
 	--disable-multilib \
+	--enable-host-shared \
 	--with-gmp=$(HOST_DIR)/usr \
 	--with-mpc=$(HOST_DIR)/usr \
 	--with-mpfr=$(HOST_DIR)/usr \
-- 
2.10.2

             reply	other threads:[~2017-04-12 21:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 21:09 Jan Kundrát [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-04-19 16:23 [Buildroot] [PATCH] gcc: Fix build failure related to -fPIC for x86_64 -> i686 builds Jan Kundrát
2017-04-23 22:06 ` Arnout Vandecappelle
2017-04-24 11:19   ` Jan Kundrát
2017-04-24 20:21     ` Arnout Vandecappelle
2017-04-25 11:17       ` Jan Kundrát

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.0.1492031512.22514.buildroot@busybox.net \
    --to=jan.kundrat@cesnet.cz \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox