Closed Bug 911893 Opened 11 years ago Closed 11 years ago

cannot use --enable-android-libstdcxx configure option

Categories

(Firefox Build System :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla26

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(1 file, 1 obsolete file)

--enable-android-libstdcxx configure option is landed by bug 807423, but we cannot still build Fennec with this option.
Blocks: 911896
Attached patch fix (obsolete) — Splinter Review
Comment on attachment 798706 [details] [diff] [review]
fix

_GLIBCXX_PERMIT_BACKWARD_HASH requires using hash_map.  and atform is defined as std::vector<AtForkFuncs, SpecialAllocator<AtForkFuncs> >.
Attachment #798706 - Flags: review?(mh+mozilla)
Comment on attachment 798706 [details] [diff] [review]
fix

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

::: build/autoconf/android.m4
@@ +243,5 @@
>                  STLPORT_LIBS="-lstdc++"
>              else
>                  AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
>              fi
> +            CPPFLAGS="$CPPFLAGS -D_GLIBCXX_PERMIT_BACKWARD_HASH"

Why is this needed?

@@ +250,5 @@
>              STLPORT_LIBS="$_objdir/build/stlport/libstlport_static.a -static-libstdc++"
>          fi
>      fi
>      CXXFLAGS="$CXXFLAGS $STLPORT_CPPFLAGS"
> +    LDFLAGS="$LDFLAGS $STLPORT_LDFLAGS"

Put STLPORT_LDFLAGS in STLPORT_LIBS instead.

::: mozglue/build/BionicGlue.cpp
@@ +101,5 @@
>  extern "C" NS_EXPORT pid_t
>  WRAP(fork)(void)
>  {
>    pid_t pid;
> +  for (std::vector<AtForkFuncs, SpecialAllocator<AtForkFuncs> >::reverse_iterator it = atfork.rbegin();

Just use auto, but please file a separate bug for this, and make it block bug 850332.
Attachment #798706 - Flags: review?(mh+mozilla) → review-
(In reply to Mike Hommey [:glandium] from comment #3)
> Comment on attachment 798706 [details] [diff] [review]
> fix
> 
> Review of attachment 798706 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: build/autoconf/android.m4
> @@ +243,5 @@
> >                  STLPORT_LIBS="-lstdc++"
> >              else
> >                  AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
> >              fi
> > +            CPPFLAGS="$CPPFLAGS -D_GLIBCXX_PERMIT_BACKWARD_HASH"
> 
> Why is this needed?

has_map tries including backward_warning.h, but there is no backward_warning.h using current include path.  backward_warning.h is into gnu-libstdc++/<version>/include/backward.  Should I add this path to STLPORT_CPPFLAGS instead of?


In file included from /home/makoto/Development/hg.mozilla.org/mobile/ipc/chromium/src/base/hash_tables.h:43:0,
                 from /home/makoto/Development/hg.mozilla.org/mobile/ipc/chromium/src/base/file_path.h:72,
                 from /home/makoto/Development/hg.mozilla.org/mobile/ipc/chromium/src/chrome/common/ipc_message_utils.h:12,
                 from ../../dist/include/ipc/IPCMessageUtils.h:11,
                 from ../../ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h:14,
                 from ../../ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h:9,
                 from ../../dist/include/mozilla/dom/ContentParent.h:12,
                 from /home/makoto/Development/hg.mozilla.org/mobile/xpcom/base/nsMemoryInfoDumper.cpp:15:
/home/makoto/bin/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.8/include/ext/hash_map:60:30: fatal error: backward_warning.h: No such file or directory
 #include "backward_warning.h"



> 
> @@ +250,5 @@
> >              STLPORT_LIBS="$_objdir/build/stlport/libstlport_static.a -static-libstdc++"
> >          fi
> >      fi
> >      CXXFLAGS="$CXXFLAGS $STLPORT_CPPFLAGS"
> > +    LDFLAGS="$LDFLAGS $STLPORT_LDFLAGS"
> 
> Put STLPORT_LDFLAGS in STLPORT_LIBS instead.

OK

> ::: mozglue/build/BionicGlue.cpp
> @@ +101,5 @@
> >  extern "C" NS_EXPORT pid_t
> >  WRAP(fork)(void)
> >  {
> >    pid_t pid;
> > +  for (std::vector<AtForkFuncs, SpecialAllocator<AtForkFuncs> >::reverse_iterator it = atfork.rbegin();
> 
> Just use auto, but please file a separate bug for this, and make it block
> bug 850332.

OK. I will file it.
(In reply to Makoto Kato (:m_kato) from comment #4)
> > Why is this needed?
> 
> has_map tries including backward_warning.h, but there is no
> backward_warning.h using current include path.  backward_warning.h is into
> gnu-libstdc++/<version>/include/backward.  Should I add this path to
> STLPORT_CPPFLAGS instead of?

yes.

You can also probably file bugs about the use of the deprecated ext/hash_* headers in ipc/chromium and breakpad's glog.
Comment on attachment 798706 [details] [diff] [review]
fix

does webrtc build for you with this?  I was trying with gcc 4.7, but I had to work around bug 908201
(In reply to Trevor Saunders (:tbsaunde) from comment #6)
> Comment on attachment 798706 [details] [diff] [review]
> fix
> 
> does webrtc build for you with this?  I was trying with gcc 4.7, but I had
> to work around bug 908201

No, I intend to file a new bug after investigating upstream's webrtc code.  Actually, we need that bug's workaround, now.
(In reply to Makoto Kato (:m_kato) from comment #7)
> (In reply to Trevor Saunders (:tbsaunde) from comment #6)
> > Comment on attachment 798706 [details] [diff] [review]
> > fix
> > 
> > does webrtc build for you with this?  I was trying with gcc 4.7, but I had
> > to work around bug 908201
> 
> No, I intend to file a new bug after investigating upstream's webrtc code. 
> Actually, we need that bug's workaround, now.

what I didn't wasn't very nice, I just renamed the things to random permutations, you probably aught to talk to the webrtc people about how they'd like to handle it, but the cleanest thing might just be #ifdef #undef for now :/
Attachment #798706 - Attachment is obsolete: true
Comment on attachment 799342 [details] [diff] [review]
Update STLPORT flags

I have no old NDK, I cannot test using it.
But new NDK, it has backward directory.
Attachment #799342 - Flags: review?(mh+mozilla)
Attachment #799342 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/c9985bea4d21
Assignee: nobody → m_kato
Target Milestone: --- → mozilla26
https://hg.mozilla.org/mozilla-central/rev/c9985bea4d21
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: