Cross compile builds' c++ host compiler does not build in C++11 mode

RESOLVED FIXED in mozilla25

Status

()

Core
Build Config
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Away for a while, Assigned: glandium)

Tracking

Trunk
mozilla25
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
See bug 895322 comment 26.
Depends on: 896463
(Reporter)

Comment 1

5 years ago
Trevor, thanks for working on bug 896463!

With that fix in production, what do we need to do here?  Should we just modify configure.in to look for gcc and g++ before cc and c++?
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #1)
> Trevor, thanks for working on bug 896463!
> 
> With that fix in production, what do we need to do here?  Should we just
> modify configure.in to look for gcc and g++ before cc and c++?

there are two things I'm aware of that we need to do
1. change the android mozconfigs to set HOST_CXX="/tools/gcc-blah/whatever/it/is"
2. change configure to require  the host compiler support c++11 and have it had std= to HOST_CXXFLAGS, my impression from talking to glandium this morning is he's working on this part and I'm happy to leave it to him :)
(Reporter)

Comment 3

5 years ago
Cool, thanks a lot!
(Assignee)

Comment 4

5 years ago
Created attachment 779711 [details] [diff] [review]
Enforce host gcc/clang support for C++11

I think Ted is not working this week.

This happens to work despite not changing the host compiler because, guess what, since we're so bad at setting the right flags for the host compiler, we omit -fno-rtti, which is what breaks C++11 support in gcc 4.4 with libstdc++. I don't have the courage to actually fix the entire compile flags set for the host compiler with autoconf, I'll take on the occasion to make some progress on my python-based configure, but that'll be a separate bug.
Attachment #779711 - Flags: review?(khuey)
(Assignee)

Updated

5 years ago
No longer depends on: 896463
(Assignee)

Comment 5

5 years ago
Comment on attachment 779711 [details] [diff] [review]
Enforce host gcc/clang support for C++11

For whichever comes first :)
Attachment #779711 - Flags: review?(gps)

Comment 6

5 years ago
Comment on attachment 779711 [details] [diff] [review]
Enforce host gcc/clang support for C++11

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

AFAICT you simply hoisted code from configure.in into toolchain.m4. If there were actual changes, I didn't see them. If there were changes, could you point them out our upload a patch-hoist patch making them clearer?
Attachment #779711 - Flags: review?(khuey)
Attachment #779711 - Flags: review?(gps)
Attachment #779711 - Flags: review+
(Assignee)

Comment 7

5 years ago
Comment on attachment 779711 [details] [diff] [review]
Enforce host gcc/clang support for C++11

There is additional code in MOZ_CXX11 (the host c++11 part)
Attachment #779711 - Flags: review+ → review?(gps)

Comment 8

5 years ago
Comment on attachment 779711 [details] [diff] [review]
Enforce host gcc/clang support for C++11

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

I see the new code now! And I just read my previous review comment. WTF. I deserve to be slapped for writing such an incoherent mess. Sorry about that.

::: build/autoconf/toolchain.m4
@@ +185,5 @@
> +        HOST_CXXFLAGS="$HOST_CXXFLAGS -std=gnu++0x"
> +
> +	_SAVE_CXXFLAGS="$CXXFLAGS"
> +	_SAVE_CPPFLAGS="$CPPFLAGS"
> +	_SAVE_CXX="$CXX"

There are some tabs here. Splinter is failing me.

@@ +189,5 @@
> +	_SAVE_CXX="$CXX"
> +        CXXFLAGS="$HOST_CXXFLAGS"
> +        CPPFLAGS="$HOST_CPPFLAGS"
> +        CXX="$HOST_CXX"
> +        AC_CACHE_CHECK(for host gcc c++0x headers bug without rtti,

90% of this seems like a copy paste from above. While we could possibly factor out common bits, it's probably not worth it. Might be worth a short comment above explaining that any new additions should be mirrored here.
Attachment #779711 - Flags: review?(gps) → review+
(Assignee)

Updated

5 years ago
Blocks: 899405
https://hg.mozilla.org/mozilla-central/rev/f92a6dcf7361
https://hg.mozilla.org/mozilla-central/rev/37b47ffd5a40
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
(Assignee)

Updated

5 years ago
Depends on: 901149
You need to log in before you can comment on or make changes to this bug.