Patchwork [v3] fix bootstrap/54419

login
register
mail settings
Submitter Jonathan Wakely
Date Sept. 9, 2012, 7:47 p.m.
Message ID <CAH6eHdQf4gdr2zrDch0vRvvreiR+u5CwCY56nHXsh9ar=vM2Ng@mail.gmail.com>
Download mbox | patch
Permalink /patch/182648/
State New
Headers show

Comments

Jonathan Wakely - Sept. 9, 2012, 7:47 p.m.
On 9 September 2012 20:43, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> On Sun, 9 Sep 2012, Jonathan Wakely wrote:
>> I've committed the patch from
>> http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00466.html (with some
>> fixes to the changelog entry)
>>
>>     2012-09-09  Ulrich Drepper  <drepper@gmail.com>
>>             Dominique d'Humieres  <dominiq@lps.ens.fr>
>>             Jack Howarth  <howarth@bromo.med.uc.edu>
>>
>>         PR bootstrap/54419
>>         * acinclude.m4: Define GLIBCXX_CHECK_X86_RDRAND.
>>         * configure.ac: Use GLIBCXX_CHECK_X86_RDRAND to test for rdrand
>>         support in assembler.
>>         * src/c++11/random.cc (__x86_rdrand): Depend on _GLIBCXX_X86_RDRAND.
>>         (random_device::_M_init): Likewise.
>>         (random_device::_M_getval): Likewise.
>>         * configure: Regenerated.
>>         * config.h.in: Regenerated.
>
> amd64-unknown-freebsd8.3 doesn't like this, I'm afraid:
>
> configure: visibility supported: yes
> checking for rdrand support in assembler... eval: ${+...}: Bad substitution
> gmake[2]: *** [configure-stage1-target-libstdc++-v3] Error 2
>
> Note, this is BSD sh, not bash.  I'll admit that I had a look, and
> did not find the culprit right away.

Yes, I don't know why it didn't show up in testing, but that patch was
not correct, it failed on netbsd too.

Fixed by this patch.  Tested x86_64-linux and x86_64-netbsd, committed to trunk.

Also, Jack, why is the variable called ac_cv_x86_rdrand rather than
glibcxx_x86_rdrand to be consistent with every other variable in
libstdc++-v3/acinclude.m4?  And why _GLIBCXX_X86_RDRAND not something
like _GLIBCXX_HAVE_AS_X86_RDRAND?  The bootstrap failure is fixed, but
I think we should change those names.
commit 1594fd2acc7453aeed22cec16dff41e0dc490eee
Author: Jonathan Wakely <jwakely.gcc@gmail.com>
Date:   Sun Sep 9 20:00:16 2012 +0100

    	PR bootstrap/54419
    	* acinclude.m4 (GLIBCXX_CHECK_X86_RDRAND): Remove stray character.
    	* configure: Regenerated.
Dominique Dhumieres - Sept. 9, 2012, 8:34 p.m.
> Also, Jack, why is the variable called ac_cv_x86_rdrand rather than
> glibcxx_x86_rdrand to be consistent with every other variable in
> libstdc++-v3/acinclude.m4?  And why _GLIBCXX_X86_RDRAND not something
> like _GLIBCXX_HAVE_AS_X86_RDRAND?  The bootstrap failure is fixed, but

Although I cannot answer for Jack, let me note that this was so in the
original non-working patch at

http://gcc.gnu.org/bugzilla/attachment.cgi?id=28127

Aren't the "c++ runtime libs" maintainers know what they are doing?

> I think we should change those names.

You are on the driver seat;-)

Dominique

Patch

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 267302d..c9b8d37 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3363,7 +3363,7 @@  dnl
 dnl Check whether rdrand is supported in the assembler.
 AC_DEFUN([GLIBCXX_CHECK_X86_RDRAND], [
   AC_MSG_CHECKING([for rdrand support in assembler])
-  AC_CACHE_VAL($ac_cv_x86_rdrand, [
+  AC_CACHE_VAL(ac_cv_x86_rdrand, [
   ac_cv_x86_rdrand=no
   case "$target" in
     i?86-*-* | \