Cross compile issue with OpenJDK 8
Erik Joelsson
erik.joelsson at oracle.com
Thu Aug 8 01:09:52 PDT 2013
This is indeed broken as we are treating the search for the compiler
like a special case and missed this usecase. As a workaround you could
try setting CC=x86_64-klom-linux-gcc CXX=x86_64-klom-linux-g++ on the
configure command line.
/Erik
On 2013-08-08 09:01, yuyinyang wrote:
> I am working on a linux x86_64 machine, and trying to cross compile
> OpenJDK 8 for the Intel Xeon Phi coprocessor. The cross compiler
> toolchain for Xeon Phi is in /usr/linux-k1om-4.7/bin, which contains
> x86_64-k1om-linux-gcc, x86_64-k1om-linux-g++, etc.
>
> I'm using code cloned from Mercurial repository, tip at 5eb3c1dc348f.
> I ran the configure script as follows:
>
> ./configure --openjdk-target=x86_64-k1om-linux
>
> Is this the correct way to cross compile OpenJDK8?
>
> Currently I encountered a problem that the x86_64-k1om-linux-gcc seems
> not correctly resolved, while the other compiler tools like ar, nm are
> correctly resolved.
>
> Here's the problematic log lines, it's trying to find
> "x86_64-k1om-linux-/usr/bin/gcc" instead of "x86_64-k1om-linux-gcc":
>
> configure: Using gcc (GCC) 4.4.7 20120313 (Red Hat-3) C compiler
> version 4.4.7-3) (located at /usr/bin/gcc)
> checking for x86_64-k1om-linux-/usr/bin/gcc... /usr/bin/gcc
>
> For tools like ar, the log lines are:
>
> checking for x86_64-k1om-linux-ar... x86_64-k1om-linux-ar
> configure: Rewriting AR to "/usr/linux-k1om-4.7/bin/x86_64-k1om-linux-ar"
>
> Below is an excerpt of the configure log which I think is related to the issue.
>
> ...
> checking for javah in Boot JDK... ok
> checking for javap in Boot JDK... ok
> checking for jar in Boot JDK... ok
> checking for rmic in Boot JDK... ok
> checking for native2ascii in Boot JDK... ok
> checking for jtreg... no
> checking for cl... no
> checking for cc... /usr/bin/cc
> configure: Resolving BUILD_CC (as /usr/bin/cc) failed, using
> /usr/bin/cc directly.
> checking for cl... no
> checking for CC... no
> checking for g++... /usr/bin/g++
> configure: Resolving BUILD_CXX (as /usr/bin/g++) failed, using
> /usr/bin/g++ directly.
> checking for ld... /usr/bin/ld
> configure: Resolving BUILD_LD (as /usr/bin/ld) failed, using
> /usr/bin/ld directly.
> checking for gcc... /usr/bin/gcc
> configure: Resolving CC (as /usr/bin/gcc) failed, using /usr/bin/gcc directly.
> checking resolved symbolic links for CC... /usr/bin/gcc
> checking if CC is disguised ccache... no, keeping CC
> configure: Using gcc (GCC) 4.4.7 20120313 (Red Hat-3) C compiler
> version 4.4.7-3) (located at /usr/bin/gcc)
> checking for x86_64-k1om-linux-/usr/bin/gcc... /usr/bin/gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... yes
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether /usr/bin/gcc accepts -g... yes
> checking for /usr/bin/gcc option to accept ISO C89... none needed
> checking for g++... /usr/bin/g++
> configure: Resolving CXX (as /usr/bin/g++) failed, using /usr/bin/g++ directly.
> checking resolved symbolic links for CXX... /usr/bin/g++
> checking if CXX is disguised ccache... no, keeping CXX
> configure: Using g++ (GCC) 4.4.7 20120313 (Red Hat-3) C++ compiler
> version 4.4.7-3) (located at /usr/bin/g++)
> checking whether we are using the GNU C++ compiler... yes
> checking whether /usr/bin/g++ accepts -g... yes
> checking for x86_64-k1om-linux-ar... x86_64-k1om-linux-ar
> configure: Rewriting AR to "/usr/linux-k1om-4.7/bin/x86_64-k1om-linux-ar"
> checking how to run the C preprocessor... /usr/bin/gcc -E
> configure: Resolving CPP (as /usr/bin/gcc) failed, using /usr/bin/gcc directly.
> checking how to run the C++ preprocessor... /usr/bin/g++ -E
> configure: Resolving CXXCPP (as /usr/bin/g++) failed, using
> /usr/bin/g++ directly.
> checking for x86_64-k1om-linux-nm... x86_64-k1om-linux-nm
> configure: Rewriting NM to "/usr/linux-k1om-4.7/bin/x86_64-k1om-linux-nm"
> checking for x86_64-k1om-linux-strip... x86_64-k1om-linux-strip
> configure: Rewriting STRIP to "/usr/linux-k1om-4.7/bin/x86_64-k1om-linux-strip"
> checking for x86_64-k1om-linux-gobjcopy... no
> checking for x86_64-k1om-linux-objcopy... x86_64-k1om-linux-objcopy
> configure: Rewriting OBJCOPY to
> "/usr/linux-k1om-4.7/bin/x86_64-k1om-linux-objcopy"
> ...
>
More information about the build-infra-dev
mailing list