Re: 答复: How to build openjdk mobile project android platform successfully and how does the mobile project adapt to bionic C ?
gary.adams at oracle.com
gary.adams at oracle.com
Sat Aug 25 11:32:03 UTC 2018
It looks like there was an update in the toolchain and the workaround was
removed in perfMemory_linux.cpp when andoid-arm support was
included in the mobile repos.
http://hg.openjdk.java.net/mobile/jdk9/hotspot/rev/647ec6c17c56
You could try adding back the code that was removed, or
move up to a newer toolchain. e.g android-ndk-13b was the last
toolchain we used
On 8/25/18 6:57 AM, gary.adams at oracle.com wrote:
> The android compiler will set the __ANDROID__ build flag.
> The __ANDROID__ workarounds are in the mobile repos.
>
> From the LOG=debug output can you provide the command line
> used to compile the file that is failing.
>
> I'm not sure you have the right sources or toolchain setup.
>
> On 8/25/18 2:15 AM, zhangfan (AZ) wrote:
>> Hi,
>>
>> Thank you for your quick response.
>> I tried the "make jre-image" command and failed in the same way.
>> Do I need to enable the "__ANDROID__" manually? Because the build
>> errors occur due to the use of the lacking functions the bionic
>> doesn't provide.
>>
>>
>> -----邮件原件-----
>> 发件人: mobile-dev [mailto:mobile-dev-bounces at openjdk.java.net] 代表
>> gary.adams at oracle.com
>> 发送时间: 2018年8月24日 18:45
>> 收件人: guoge (A) <guoge1 at huawei.com>; mobile-dev at openjdk.java.net
>> 抄送: xietuo <xietuo at huawei.com>
>> 主题: Re: How to build openjdk mobile project android platform
>> successfully and how does the mobile project adapt to bionic C ?
>>
>> Only the java runtime libraries were ported to run in the Android app
>> environment.
>> You can not build a full jdk image.
>>
>> The mobile repos already has the needed "#if defined(__ANDROID__) ..."
>> directives with alternate implementations for missing bionic functions.
>>
>> To debug build errors it helps to add "LOG=debug" to your make
>> command line.
>> The error may be in the creation of a local build-jdk image prior to
>> the building of the target platform jre libraries.
>>
>> On 8/24/18 4:13 AM, guoge (A) wrote:
>>> Hi mobile-dev,
>>>
>>> I want to build an android openjdk from the mobile
>>> project.(http://hg.openjdk.java.net/mobile/jdk9/)
>>> I followed the
>>> guide(http://openjdk.java.net/projects/mobile/android.html) but
>>> failed in the "make images" phase.
>>> I tried two versions of NDK
>>> toolchains(android-ndk32-r10b-linux-x86_64 and
>>> android-ndk-r10e-linux-x86_64) and the followings are the configure
>>> and make images command outputs, could you help figure out why the
>>> project can't be built successfully?
>>>
>>> In addition, could you tell me how the mobile
>>> project adapts to the bionic C when bionic C lacks some functions
>>> the openjdk needs(such as ucontext.h, getpwuid_r etc.)?
>>>
>>> Thanks.
>>>
>>>
>>> android-ndk-r10b
>>> ----------------------------------------------------------------------
>>> ----
>>> configure:
>>> Configuration summary:
>>> * Debug level: release
>>> * HS debug level: product
>>> * JDK variant: normal
>>> * JVM variants: zero
>>> * OpenJDK target: OS: android, CPU architecture: arm, address length:
>>> 32
>>> * Version string: 9-internal+0-adhoc.zhangfan.mobile-jdk9 (9-internal)
>>>
>>> Tools summary:
>>> * Boot JDK: java version "1.8.0_192-ea" Java(TM) SE Runtime
>>> Environment (build 1.8.0_192-ea-b04) Java HotSpot(TM) 64-Bit Server
>>> VM (build 25.192-b04, mixed mode) (at
>>> /home/zhangfan/tools/openjdk-builds/jdk1.8.0_192)
>>> * Toolchain: gcc (GNU Compiler Collection)
>>> * C Compiler: Version 4.6 (at
>>> /home/zhangfan/code/dev/jdk9mobile/android-ndk-r10b/generated-toolchains/android-arm-toolchain/bin/arm-linux-androideabi-gcc)
>>> * C++ Compiler: Version 4.6 (at
>>> /home/zhangfan/code/dev/jdk9mobile/android-ndk-r10b/generated-toolchains/android-arm-toolchain/bin/arm-linux-androideabi-g++)
>>>
>>> make images:
>>> /home/zhangfan/code/dev/jdk9mobile/mobile-jdk9/hotspot/src/share/vm/ut
>>> ilities/globalDefinitions_gcc.hpp:79:22: fatal error: ucontext.h: No
>>> such file or directory compilation terminated.
>>>
>>>
>>> android-ndk-r10e
>>> ----------------------------------------------------------------------
>>> ----
>>> configure:
>>> Configuration summary:
>>> * Debug level: release
>>> * HS debug level: product
>>> * JDK variant: normal
>>> * JVM variants: zero
>>> * OpenJDK target: OS: android, CPU architecture: arm, address length:
>>> 32
>>> * Version string: 9-internal+0-adhoc.zhangfan.mobile-jdk9 (9-internal)
>>>
>>> Tools summary:
>>> * Boot JDK: java version "1.8.0_192-ea" Java(TM) SE Runtime
>>> Environment (build 1.8.0_192-ea-b04) Java HotSpot(TM) 64-Bit Server
>>> VM (build 25.192-b04, mixed mode) (at
>>> /home/zhangfan/tools/openjdk-builds/jdk1.8.0_192)
>>> * Toolchain: gcc (GNU Compiler Collection)
>>> * C Compiler: Version 4.8 (at
>>> /home/zhangfan/code/dev/jdk9mobile/android-ndk-r10e/generated-toolchains/android-arm-toolchain/bin/arm-linux-androideabi-gcc)
>>> * C++ Compiler: Version 4.8 (at
>>> /home/zhangfan/code/dev/jdk9mobile/android-ndk-r10e/generated-toolchains/android-arm-toolchain/bin/arm-linux-androideabi-g++)
>>>
>>> make images:
>>> /home/zhangfan/code/dev/jdk9mobile/mobile-jdk9/hotspot/src/os/linux/vm/perfMemory_linux.cpp:
>>> In function 'char* get_user_name(uid_t)':
>>> /home/zhangfan/code/dev/jdk9mobile/mobile-jdk9/hotspot/src/os/linux/vm/perfMemory_linux.cpp:458:66:
>>> error: 'getpwuid_r' was not declared in this scope
>>> int result = getpwuid_r(uid, &pwent, pwbuf, (size_t)bufsize, &p);
>>>
>>> Best Regards,
>>> Guoge
>>
>
More information about the mobile-dev
mailing list