Building for Android

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Andrew Gilbertson

Building for Android

Unread post by Andrew Gilbertson » 2017-02-28, 00:46

I decided that I wanted to take a look at the code for Pale Moon for Android to see if I can help in reviving that particular branch of the project. I've worked with Android before, although it's been a couple of years at this point; and I'm familiar with Pale Moon as a user, but not from a development standpoint (so let's get to work on changing that, since the project needs more devs).

I cloned the Android branch of the Pale-Moon repo on Github and have been working on getting it to build. After installing a number of needed -devel packages on my Linux, I finally got to the point where "./mach build" found everything that it think it needs, checked for beer in the fridge, and began compiling. All went well for a few minutes, then I got a series of messages all similar to this:

Code: Select all

 4:46.93 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct()’:
 4:46.93 ../../dist/include/mozilla/Util.h:166:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.93        MOZ_ASSERT(!constructed);
 4:46.93                               ^
 4:46.93 ../../dist/include/mozilla/Util.h:166:30: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
If I add -fpermissive to ./browser/config/mozconfig, the error changes to:

Code: Select all

 4:49.70 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct()’:
 4:49.70 ../../dist/include/mozilla/Util.h:166:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:49.70        MOZ_ASSERT(!constructed);
 4:49.70                               ^
 4:49.70 ../../dist/include/mozilla/Util.h:166:30: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
And again, there are quite a few of them.

So, a few questions:
Is this expected when building the Android branch?
Should I be using the -fpermissive flag?
If so, where do I put it?

I've put more complete output from the first pass inside a hide tag below, in case it's useful.

Code: Select all

 4:46.92 In file included from ../../dist/include/mozilla/throw_gcc.h:12:0,
 4:46.92                  from ../../dist/stl_wrappers/new:66,
 4:46.92                  from ../../dist/include/mozilla/mozalloc.h:18,
 4:46.92                  from ../../dist/stl_wrappers/cstdlib:39,
 4:46.92                  from /usr/include/c++/6.3.1/stdlib.h:36,
 4:46.93                  from ../../dist/system_wrappers/stdlib.h:3,
 4:46.93                  from ../../dist/include/mozilla/Assertions.h:17,
 4:46.93                  from /home/andrew/work/Pale-Moon/xpcom/glue/nsCOMPtr.h:24,
 4:46.93                  from /home/andrew/work/Pale-Moon/xpcom/glue/nsArrayUtils.h:9,
 4:46.93                  from /home/andrew/work/Pale-Moon/xpcom/glue/nsArrayUtils.cpp:6:
 4:46.93 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct()’:
 4:46.93 ../../dist/include/mozilla/Util.h:166:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.93        MOZ_ASSERT(!constructed);
 4:46.93                               ^
 4:46.93 ../../dist/include/mozilla/Util.h:166:30: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
 4:46.93 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&)’:
 4:46.93 ../../dist/include/mozilla/Util.h:173:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.93        MOZ_ASSERT(!constructed);
 4:46.93                               ^
 4:46.93 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&)’:
 4:46.93 ../../dist/include/mozilla/Util.h:180:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.93        MOZ_ASSERT(!constructed);
 4:46.93                               ^
 4:46.93 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&)’:
 4:46.93 ../../dist/include/mozilla/Util.h:187:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.93        MOZ_ASSERT(!constructed);
 4:46.93                               ^
 4:46.93 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&)’:
 4:46.93 ../../dist/include/mozilla/Util.h:194:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.93        MOZ_ASSERT(!constructed);
 4:46.93                               ^
 4:46.94 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&)’:
 4:46.94 ../../dist/include/mozilla/Util.h:201:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.94        MOZ_ASSERT(!constructed);
 4:46.94                               ^
 4:46.94 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&)’:
 4:46.95 ../../dist/include/mozilla/Util.h:210:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.95        MOZ_ASSERT(!constructed);
 4:46.95                               ^
 4:46.95 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&)’:
 4:46.95 ../../dist/include/mozilla/Util.h:219:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.95        MOZ_ASSERT(!constructed);
 4:46.95                               ^
 4:46.95 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&)’:
 4:46.95 ../../dist/include/mozilla/Util.h:228:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.95        MOZ_ASSERT(!constructed);
 4:46.95                               ^
 4:46.95 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&, const T9&)’:
 4:46.95 ../../dist/include/mozilla/Util.h:237:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.95        MOZ_ASSERT(!constructed);
 4:46.95                               ^
 4:46.95 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&, const T9&, const T10&)’:
 4:46.95 ../../dist/include/mozilla/Util.h:246:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.95        MOZ_ASSERT(!constructed);
 4:46.95                               ^
 4:46.95 ../../dist/include/mozilla/Util.h: In member function ‘T* mozilla::Maybe<T>::addr()’:
 4:46.95 ../../dist/include/mozilla/Util.h:252:29: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.95        MOZ_ASSERT(constructed);
 4:46.95                              ^
 4:46.95 ../../dist/include/mozilla/Util.h: In member function ‘T& mozilla::Maybe<T>::ref()’:
 4:46.95 ../../dist/include/mozilla/Util.h:257:29: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.96        MOZ_ASSERT(constructed);
 4:46.96                              ^
 4:46.96 ../../dist/include/mozilla/Util.h: In member function ‘const T& mozilla::Maybe<T>::ref() const’:
 4:46.96 ../../dist/include/mozilla/Util.h:262:29: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:46.96        MOZ_ASSERT(constructed);
 4:46.96                              ^
 4:46.96 nsClassInfoImpl.cpp
 4:47.01 
 4:47.03 In the directory  /home/andrew/work/Pale-Moon/obj-x86_64-unknown-linux-gnu/xpcom/glue
 4:47.03 The following command failed to execute properly:
 4:47.03 c++ -o nsArrayUtils.o -c -I../../dist/stl_wrappers -I../../dist/system_wrappers -include /home/andrew/work/Pale-Moon/config/gcc_hidden.h -DMOZ_GLUE_IN_PROGRAM -DNO_NSPR_10_SUPPORT -DTARGET_XPCOM_ABI="x86_64-gcc3" -I/home/andrew/work/Pale-Moon/xpcom/glue/../build -I/home/andrew/work/Pale-Moon/xpcom/glue -I. -I../../dist/include -I/home/andrew/work/Pale-Moon/obj-x86_64-unknown-linux-gnu/dist/include/nspr -I/home/andrew/work/Pale-Moon/obj-x86_64-unknown-linux-gnu/dist/include/nss -fPIC -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wcast-align -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe -DNDEBUG -DTRIMMED -g -freorder-blocks -Os -fomit-frame-pointer -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MP -MF .deps/nsArrayUtils.o.pp /home/andrew/work/Pale-Moon/xpcom/glue/nsArrayUtils.cpp
 4:47.03 /home/andrew/work/Pale-Moon/config/rules.mk:1104: recipe for target 'nsArrayUtils.o' failed
 4:47.03 gmake[6]: *** [nsArrayUtils.o] Error 1
 4:47.03 gmake[6]: *** Waiting for unfinished jobs....
 4:47.05 In file included from ../../dist/include/mozilla/throw_gcc.h:12:0,
 4:47.05                  from ../../dist/stl_wrappers/new:66,
 4:47.05                  from ../../dist/include/mozilla/mozalloc.h:18,
 4:47.05                  from ../../dist/stl_wrappers/cstdlib:39,
 4:47.05                  from /usr/include/c++/6.3.1/stdlib.h:36,
 4:47.05                  from ../../dist/system_wrappers/stdlib.h:3,
 4:47.05                  from ../../dist/include/mozilla/Assertions.h:17,
 4:47.05                  from /home/andrew/work/Pale-Moon/xpcom/glue/nsCOMPtr.h:24,
 4:47.05                  from /home/andrew/work/Pale-Moon/xpcom/glue/nsCOMPtr.cpp:6:
 4:47.05 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct()’:
 4:47.05 ../../dist/include/mozilla/Util.h:166:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.05        MOZ_ASSERT(!constructed);
 4:47.05                               ^
 4:47.05 ../../dist/include/mozilla/Util.h:166:30: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
 4:47.05 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&)’:
 4:47.05 ../../dist/include/mozilla/Util.h:173:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.05        MOZ_ASSERT(!constructed);
 4:47.05                               ^
 4:47.05 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&)’:
 4:47.05 ../../dist/include/mozilla/Util.h:180:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.05        MOZ_ASSERT(!constructed);
 4:47.05                               ^
 4:47.05 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&)’:
 4:47.05 ../../dist/include/mozilla/Util.h:187:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(!constructed);
 4:47.06                               ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&)’:
 4:47.06 ../../dist/include/mozilla/Util.h:194:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(!constructed);
 4:47.06                               ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&)’:
 4:47.06 ../../dist/include/mozilla/Util.h:201:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(!constructed);
 4:47.06                               ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&)’:
 4:47.06 ../../dist/include/mozilla/Util.h:210:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(!constructed);
 4:47.06                               ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&)’:
 4:47.06 ../../dist/include/mozilla/Util.h:219:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(!constructed);
 4:47.06                               ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&)’:
 4:47.06 ../../dist/include/mozilla/Util.h:228:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(!constructed);
 4:47.06                               ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&, const T9&)’:
 4:47.06 ../../dist/include/mozilla/Util.h:237:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(!constructed);
 4:47.06                               ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘void mozilla::Maybe<T>::construct(const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&, const T9&, const T10&)’:
 4:47.06 ../../dist/include/mozilla/Util.h:246:30: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(!constructed);
 4:47.06                               ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘T* mozilla::Maybe<T>::addr()’:
 4:47.06 ../../dist/include/mozilla/Util.h:252:29: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.06        MOZ_ASSERT(constructed);
 4:47.06                              ^
 4:47.06 ../../dist/include/mozilla/Util.h: In member function ‘T& mozilla::Maybe<T>::ref()’:
 4:47.07 ../../dist/include/mozilla/Util.h:257:29: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.07        MOZ_ASSERT(constructed);
 4:47.07                              ^
 4:47.07 ../../dist/include/mozilla/Util.h: In member function ‘const T& mozilla::Maybe<T>::ref() const’:
 4:47.07 ../../dist/include/mozilla/Util.h:262:29: error: there are no arguments to ‘MOZ_ASSERT’ that depend on a template parameter, so a declaration of ‘MOZ_ASSERT’ must be available [-fpermissive]
 4:47.07        MOZ_ASSERT(constructed);
 4:47.07                              ^
 4:47.11 
 4:47.11 In the directory  /home/andrew/work/Pale-Moon/obj-x86_64-unknown-linux-gnu/xpcom/glue
 4:47.11 The following command failed to execute properly:
 4:47.11 c++ -o nsCOMPtr.o -c -I../../dist/stl_wrappers -I../../dist/system_wrappers -include /home/andrew/work/Pale-Moon/config/gcc_hidden.h -DMOZ_GLUE_IN_PROGRAM -DNO_NSPR_10_SUPPORT -DTARGET_XPCOM_ABI="x86_64-gcc3" -I/home/andrew/work/Pale-Moon/xpcom/glue/../build -I/home/andrew/work/Pale-Moon/xpcom/glue -I. -I../../dist/include -I/home/andrew/work/Pale-Moon/obj-x86_64-unknown-linux-gnu/dist/include/nspr -I/home/andrew/work/Pale-Moon/obj-x86_64-unknown-linux-gnu/dist/include/nss -fPIC -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wcast-align -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe -DNDEBUG -DTRIMMED -g -freorder-blocks -Os -fomit-frame-pointer -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MP -MF .deps/nsCOMPtr.o.pp /home/andrew/work/Pale-Moon/xpcom/glue/nsCOMPtr.cpp
 4:47.11 /home/andrew/work/Pale-Moon/config/rules.mk:1104: recipe for target 'nsCOMPtr.o' failed
 4:47.11 gmake[6]: *** [nsCOMPtr.o] Error 1
 4:47.38 /home/andrew/work/Pale-Moon/config/makefiles/target_libs.mk:59: recipe for target 'libs' failed
 4:47.38 gmake[5]: *** [libs] Error 2
 4:47.39 /home/andrew/work/Pale-Moon/config/makefiles/target_libs.mk:16: recipe for target 'libs_tier_platform' failed
 4:47.39 gmake[4]: *** [libs_tier_platform] Error 2
 4:47.39 /home/andrew/work/Pale-Moon/config/rules.mk:723: recipe for target 'tier_platform' failed
 4:47.39 gmake[3]: *** [tier_platform] Error 2
 4:47.39 /home/andrew/work/Pale-Moon/config/rules.mk:656: recipe for target 'default' failed
 4:47.39 gmake[2]: *** [default] Error 2
 4:47.39 /home/andrew/work/Pale-Moon/client.mk:372: recipe for target 'realbuild' failed
 4:47.39 gmake[1]: *** [realbuild] Error 2
 4:47.39 client.mk:172: recipe for target 'build' failed
 4:47.39 gmake: *** [build] Error 2
 4:47.41 77 compiler warnings present.

Fedor2

Re: Building for Android

Unread post by Fedor2 » 2017-02-28, 15:44

Try build regular palemoon first, to find that is all good with your setup.

I had alike errors when i did building from my experiment setup. -std=c++11 helped for me

Fedor2

Re: Building for Android

Unread post by Fedor2 » 2017-08-31, 11:56

Hey i myself became interested to build for android, but on windows.
Now i know nothing how to do.

Locked