Closed Bug 1153154 Opened 4 years ago Closed 4 years ago

[gcc 5.0] elfhack: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /builds/slave/try-lx-00000000000000000000000/build/src/obj-firefox/build/unix/elfhack/elfhack)

Categories

(Firefox Build System :: General, defect)

All
Linux
defect
Not set

Tracking

(firefox40 fixed)

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(2 files, 1 obsolete file)

I guess the same happens with non-elfhack binaries.
And host binaries are not running the CHECK_BINARY checks...
Attachment #8592514 - Flags: review?(mshal) → review+
Comment on attachment 8592515 [details] [diff] [review]
Add stdc++-compat hack for std::string::_S_compare and std::runtime_error::runtime_error

Review of attachment 8592515 [details] [diff] [review]:
-----------------------------------------------------------------

::: build/unix/stdc++compat/stdc++compat.cpp
@@ +21,5 @@
>     GLIBCXX_3.4.17 is from gcc 4.7.0 (174383)
>     GLIBCXX_3.4.18 is from gcc 4.8.0 (190787)
>     GLIBCXX_3.4.19 is from gcc 4.8.1 (199309)
> +   GLIBCXX_3.4.20 is from gcc 4.9.0 (199307)
> +   GLIBCXX_3.4.21 is from gcc 5.0 (210290) */

What are these numbers in parentheses supposed to be?  SVN revision numbers?

@@ +187,5 @@
> +/* While we generally don't build with exceptions, we have some host tools
> + * that do use them. GCC 5.0 added exception constructors with char const*
> + * arguments. Unfortunately, we can't call a constructor from a constructor
> + * with C++ syntax, so cheat by using the mangled form, exported as a C
> + * symbol. */

We can't use C++ delegating constructors here?  I guess we can't insert the constructor definition into the declaration of runtime_error.  Maybe reword the comment to reflect that?
Attachment #8592515 - Flags: review?(nfroyd) → review+
(In reply to Nathan Froyd [:froydnj] [:nfroyd] from comment #3)
> Comment on attachment 8592515 [details] [diff] [review]
> Add stdc++-compat hack for std::string::_S_compare and
> std::runtime_error::runtime_error
> 
> Review of attachment 8592515 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: build/unix/stdc++compat/stdc++compat.cpp
> @@ +21,5 @@
> >     GLIBCXX_3.4.17 is from gcc 4.7.0 (174383)
> >     GLIBCXX_3.4.18 is from gcc 4.8.0 (190787)
> >     GLIBCXX_3.4.19 is from gcc 4.8.1 (199309)
> > +   GLIBCXX_3.4.20 is from gcc 4.9.0 (199307)
> > +   GLIBCXX_3.4.21 is from gcc 5.0 (210290) */
> 
> What are these numbers in parentheses supposed to be?  SVN revision numbers?

Yes. I don't actually know why Rafael added them, I've been keeping the tradition.

> @@ +187,5 @@
> > +/* While we generally don't build with exceptions, we have some host tools
> > + * that do use them. GCC 5.0 added exception constructors with char const*
> > + * arguments. Unfortunately, we can't call a constructor from a constructor
> > + * with C++ syntax, so cheat by using the mangled form, exported as a C
> > + * symbol. */
> 
> We can't use C++ delegating constructors here?  I guess we can't insert the
> constructor definition into the declaration of runtime_error.  Maybe reword
> the comment to reflect that?

Actually, since this is in a GLIBCXX_VERSION(3, 4, 21) block (meaning a) the headers have the definition and b) we're building with gcc 5 or a modern clang), we *can* use a C++11 delegating constructor. And the generated machine code is exactly the same.
This looks so much better.
Attachment #8592515 - Attachment is obsolete: true
Attachment #8593099 - Flags: review?(nfroyd)
Comment on attachment 8593099 [details] [diff] [review]
Add stdc++-compat hack for std::string::_S_compare and std::runtime_error::runtime_error

Review of attachment 8593099 [details] [diff] [review]:
-----------------------------------------------------------------

Yay for nicer code.
Attachment #8593099 - Flags: review?(nfroyd) → review+
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.