cross-compile JDK 14 with arm-linux-gnueabihf target

Bob Vandette bob.vandette at oracle.com
Mon Apr 20 21:27:50 UTC 2020


Is the ARM compiler on your path?

I use the —with-devkit configure option to point to the compiler.

Bob.


> On Apr 20, 2020, at 5:04 PM, Choe, Jiwon <jiwon_choe at brown.edu> wrote:
> 
> Hello all,
> 
> I'm trying to cross-compile OpenJDK 14 to target arm-linux-gnueabihf, and
> the build is failing for me with these errors:
> 
> === Output from failing command(s) repeated here ===
> * For target buildjdk_hotspot_variant-server_libjvm_objs_os_linux_x86.o:
> /home/sim32/jdk14/jdk14/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp: In
> static member function 'static u_char* os::Linux::ucontext_get_pc(const
> ucontext_t*)':
> /home/sim32/jdk14/jdk14/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp:120:35:
> error: 'const mcontext_t' has no member named 'gregs'
>   return (address)uc->uc_mcontext.gregs[REG_PC];
>                                   ^
> /home/sim32/jdk14/jdk14/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp:90:16:
> error: 'REG_EIP' was not declared in this scope
> #define REG_PC REG_EIP
>                ^
> /home/sim32/jdk14/jdk14/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp:120:41:
> note: in expansion of macro 'REG_PC'
>   return (address)uc->uc_mcontext.gregs[REG_PC];
>                                         ^
> /home/sim32/jdk14/jdk14/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp: In
> static member function 'static void os::Linux::ucontext_set_pc(ucontext_t*,
> address)':
> /home/sim32/jdk14/jdk14/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp:124:19:
> error: 'mcontext_t' has no member named 'gregs'
>   uc->uc_mcontext.gregs[REG_PC] = (intptr_t)pc;
>                   ^
> /home/sim32/jdk14/jdk14/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp:90:16:
> error: 'REG_EIP' was not declared in this scope
>   ... (rest of output omitted)
> 
> 
> Although my build system is 32-bit x86 Linux, I'm confused because it seems
> odd that a cross-compile for ARM would need to compile something in a
> linux_x86 directory.
> 
> 
> These are the steps I took for the build:
> 
> 1.  sudo qemu-debootstrap --arch=armhf --verbose
> --include=fakeroot,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libfreetype6-dev,libasound2-dev,libc6-dev,gcc-multilib,g++-multilib
> --resolve-deps trusty /opt/sysroot/
> 
> 2.  bash configure --openjdk-target=arm-linux-gnueabihf
> --with-sysroot=/opt/sysroot/
> --with-freetype-include=/opt/sysroot/usr/include/freetype2
> --with-freetype-lib=/opt/sysroot/usr/lib/arm-linux-gnueabihf
> --with-extra-cflags='-Wno-error
> -I/opt/sysroot/usr/include/arm-linux-gnueabihf/c++/4.8
> -I/opt/sysroot/usr/include/c++/4.8' --with-extra-cxxflags='-Wno-error
> -I/opt/sysroot/usr/include/arm-linux-gnueabihf/c++/4.8
> -I/opt/sysroot/usr/include/c++/4.8' --with-stdc++lib=static
> CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++
> 
> 3.  make images
> 
> 
> The steps above worked for me when I tried the same cross-compile for JDK
> 8. I had an additional flag --with-jvm-variants=client in the configure
> stage for JDK 8. I tried both client and server variants for JDK 14, and I
> get the same error.
> 
> If anyone has insight into how to fix or work around this issue, please let
> me know!
> 
> Thanks in advance,
> Jiwon Choe




More information about the build-dev mailing list