Closed Bug 1457669 Opened 2 years ago Closed 7 months ago

Android system header wrappers are only generated for toolkit android builds, not standalone spidermonkey

Categories

(Core :: JavaScript Engine, defect, P5)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: 773749686, Assigned: jdm)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36

Steps to reproduce:

I compile the latest version of spidermonkey52 (downloaded compressed file) on ubuntu16.04 as a library embedded in android app,which is the parameter:
../configure --enable-project=mobile/android --target=aarch64-linux-android --with-android-sdk="/home/xxx/.mozbuild/android-sdk-linux"   --with-android-ndk="/home/xxx/.mozbuild/android-ndk-r15c" --with-android-version=23 


Actual results:

 But I have always encountered the error of " hidden symbol'__android_log_print'is not defined locally"。I don't know what went wrong. I hope the big god can solve my problem. Thank you very much.


Expected results:

The result of my hope is that the latest version of spidermonkey52 can be used to build the so library that can be embedded into android app.
tracking-fennec: --- → ?
Component: General → Build Config & IDE Support
Component: Build Config & IDE Support → JavaScript Engine
Product: Firefox for Android → Core
Status: UNCONFIRMED → RESOLVED
tracking-fennec: ? → ---
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1457668
This sounds like an Android NDK headers issue, probably because you're specifying --with-android-version=23 and I think we need 9, 15, or 16.

jchen is likely to know more about this detail; redirecting.

Generally, Mozilla doesn't care about supporting ancient versions of the JS engine on Android, so if it's not obvious you might have to either use a newer (!) version or work it out yourself.  But hopefully Jim knows what this means.
(In reply to Nick Alexander :nalexander from comment #2)
> This sounds like an Android NDK headers issue, probably because you're
> specifying --with-android-version=23 and I think we need 9, 15, or 16.
> 
> jchen is likely to know more about this detail; redirecting.
> 
> Generally, Mozilla doesn't care about supporting ancient versions of the JS
> engine on Android, so if it's not obvious you might have to either use a
> newer (!) version or work it out yourself.  But hopefully Jim knows what
> this means.

I was use the latest version of the build of like before, I had followed your advice but he is not working, - with android - version = 16 complains because minimum support 21 .with androidstudio I create a new c + + support android project in CmakeLists.txt links into the android log of library, and I set up the same version of the NDK, there is no problem,In constructing spidermonkey when I feel I am configuration parameters have a problem but I don't know where the problem is, he is only a mistake is "hidden symbol '_android_log_print' is not defined locally".
(In reply to 773749686 from comment #3)
> (In reply to Nick Alexander :nalexander from comment #2)
> > This sounds like an Android NDK headers issue, probably because you're
> > specifying --with-android-version=23 and I think we need 9, 15, or 16.
> > 
> > jchen is likely to know more about this detail; redirecting.
> > 
> > Generally, Mozilla doesn't care about supporting ancient versions of the JS
> > engine on Android, so if it's not obvious you might have to either use a
> > newer (!) version or work it out yourself.  But hopefully Jim knows what
> > this means.
> 
> I was use the latest version of the build of like before, I had followed
> your advice but he is not working, - with android - version = 16 complains
> because minimum support 21 .with androidstudio I create a new c + + support
> android project in CmakeLists.txt links into the android log of library, and
> I set up the same version of the NDK, there is no problem,In constructing
> spidermonkey when I feel I am configuration parameters have a problem but I
> don't know where the problem is, he is only a mistake is "hidden symbol
> '_android_log_print' is not defined locally".

I solved my problem, and this is my way of thinking about it.Because only "hidden symbol.'_android_log_print' is not defined locally "is this a mistake, the android log library, he simply used to output the log, has no effect on the program logic, and avoid the mistakes so that I can't find the way, why don't I involved in this log library code is commented out, fortunately, according to the error prompt involves the library file is not much, only two files, and the wrong place also very few.I do what my idea in accordance with the original steps, so he can hit the library I need, and also no problem to run, no matter how I will thank you very much for your answer to my questions.
Glad you solved it! Since you're building SM by itself, I'm not really sure where the problem lies.
Flags: needinfo?(nchen)
Reopening because I hit this error building a standalone SM 60 for android. The root problem is that mozjs/config/system-headers.mozbuild uses CONFIG['MOZ_WIDGET_TOOLKIT'] to detect an Android build, for which there needs to be more system wrappers. Since CONFIG['MOZ_WIDGET_TOOLKIT'] isn't set for a standalone build, there's no wrapper generated for android/log.h, which causes its symbols to be hidden.

The Servo patch is https://github.com/servo/mozjs/pull/138/commits/6ba4904b3b9858ae5a066e500e0df4ef421664fd

The IRC conversation with :froydnj is at https://mozilla.logbot.info/jsapi/20180808#c15136454
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---
Priority: -- → P5
Summary: An error occurred when building the spidermonkey android library. → Error building the spidermonkey android library
Assignee: nobody → josh
Summary: Error building the spidermonkey android library → Android system header wrappers are only generated for toolkit android builds, not standalone spidermonkey
Attachment #9061995 - Attachment is obsolete: true
Pushed by jmatthews@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0ffeaa8ab59c
Support Android system headers for standalone SpiderMonkey builds. r=froydnj
Status: REOPENED → RESOLVED
Closed: 2 years ago7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.