Patchwork Fix in-tree libelf parallel build

login
register
mail settings
Submitter Alexandre Oliva
Date June 10, 2010, 10:35 a.m.
Message ID <ory6ennpk1.fsf@livre.localdomain>
Download mbox | patch
Permalink /patch/55196/
State New
Headers show

Comments

Alexandre Oliva - June 10, 2010, 10:35 a.m.
The test for libelf featuers in gcc/configure.ac doesn't take into
acount the possibility that the libelf to be used might be the one in
the build tree.  The toplevel one does.

This results in a problem if you're running a parallel build that
configures gcc before building libelf: toplevel will assume libelf is
fine, but GCC will misdetect HAVE_ELF_GETSHDRSTRNDX if you have an old
version of libelf installed, and then lto-elf.c will fail to compile in
stage2, at the elf_getshstrndx call, because the declaration is marked
as deprecated in the new libelf headers.

This patch arranges for us to build the build-tree libelf before
configuring the gcc subdir, so that we don't depend on lucky chance to
have it already in place by the time of the gcc configure tests.

I'm checking it in shortly.

Patch

for  ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* Makefile.def (configure-gcc): Depend on all-libelf.
	* Makefile.in: Rebuild.

Index: Makefile.def
===================================================================
--- Makefile.def.orig	2010-06-09 05:32:52.000000000 -0300
+++ Makefile.def	2010-06-09 05:33:18.000000000 -0300
@@ -322,6 +322,7 @@  dependencies = { module=configure-gcc; o
 dependencies = { module=configure-gcc; on=all-gas; };
 dependencies = { module=configure-gcc; on=all-ld; };
 dependencies = { module=configure-gcc; on=all-gold; };
+dependencies = { module=configure-gcc; on=all-libelf; };
 dependencies = { module=all-gcc; on=all-libiberty; hard=true; };
 dependencies = { module=all-gcc; on=all-gmp; };
 dependencies = { module=all-gcc; on=all-intl; };
@@ -329,7 +330,6 @@  dependencies = { module=all-gcc; on=all-
 dependencies = { module=all-gcc; on=all-mpc; };
 dependencies = { module=all-gcc; on=all-ppl; };
 dependencies = { module=all-gcc; on=all-cloog; };
-dependencies = { module=all-gcc; on=all-libelf; };
 dependencies = { module=all-gcc; on=all-build-texinfo; };
 dependencies = { module=all-gcc; on=all-build-bison; };
 dependencies = { module=all-gcc; on=all-build-byacc; };
Index: Makefile.in
===================================================================
--- Makefile.in.orig	2010-06-09 05:32:53.000000000 -0300
+++ Makefile.in	2010-06-09 05:33:39.000000000 -0300
@@ -57763,6 +57763,14 @@  configure-stage3-gcc: maybe-all-stage3-g
 configure-stage4-gcc: maybe-all-stage4-gold
 configure-stageprofile-gcc: maybe-all-stageprofile-gold
 configure-stagefeedback-gcc: maybe-all-stagefeedback-gold
+configure-gcc: maybe-all-libelf
+
+configure-stage1-gcc: maybe-all-stage1-libelf
+configure-stage2-gcc: maybe-all-stage2-libelf
+configure-stage3-gcc: maybe-all-stage3-libelf
+configure-stage4-gcc: maybe-all-stage4-libelf
+configure-stageprofile-gcc: maybe-all-stageprofile-libelf
+configure-stagefeedback-gcc: maybe-all-stagefeedback-libelf
 all-gcc: all-libiberty
 
 all-stage1-gcc: all-stage1-libiberty
@@ -57819,14 +57827,6 @@  all-stage3-gcc: maybe-all-stage3-cloog
 all-stage4-gcc: maybe-all-stage4-cloog
 all-stageprofile-gcc: maybe-all-stageprofile-cloog
 all-stagefeedback-gcc: maybe-all-stagefeedback-cloog
-all-gcc: maybe-all-libelf
-
-all-stage1-gcc: maybe-all-stage1-libelf
-all-stage2-gcc: maybe-all-stage2-libelf
-all-stage3-gcc: maybe-all-stage3-libelf
-all-stage4-gcc: maybe-all-stage4-libelf
-all-stageprofile-gcc: maybe-all-stageprofile-libelf
-all-stagefeedback-gcc: maybe-all-stagefeedback-libelf
 all-gcc: maybe-all-build-texinfo
 
 all-stage1-gcc: maybe-all-build-texinfo