Building jdk-8u on AIX 7.2 problems: sizeof

Adam Roberts AROBERTS at uk.ibm.com
Tue Jun 13 12:39:24 UTC 2017


Thanks Thomas, getting xlc 13.1 installed (including the C++ compiler 
instead of just the C compiler) resolves my problem: 

I set my path to include both the xlc/bin and xlC/bin (notice the 
uppercase C for C++) directories and the configure step passes.

Next problem is to do with missing pthread symbols now when building the 
VM, but I'll have a good go at fixing this first before potentially asking 
for help here again

Cheers,




From:   Thomas Stüfe <thomas.stuefe at gmail.com>
To:     Adam Roberts <AROBERTS at uk.ibm.com>
Cc:     "ppc-aix-port-dev at openjdk.java.net" 
<ppc-aix-port-dev at openjdk.java.net>
Date:   12/06/2017 17:23
Subject:        Re: Building jdk-8u on AIX 7.2 problems: sizeof



Hi Adam,

I think (not sure) that defining CC=xlc may the problem. Try to remove it, 
and CXX too, setting it should not be necessary if xlc is in the path.

See toolchain.m4:

    412   # Option used to tell the compiler whether to create 32- or 
64-bit executables
    413   # Notice that CC contains the full compiler path at this point.
    414   case $CC in
    415     *xlc_r) COMPILER_TARGET_BITS_FLAG="-q";;
    416     *)      COMPILER_TARGET_BITS_FLAG="-m";;
    417   esac

"xlc" != "xlc_r", so we pick up COMPILER_TARGET_BITS_FLAG=-m, so we call 
xlc with -m64, which it does not understand. The resulting binary has 
whatever is the default, with OBJECT_MODE unset this is probably 32 bit. 
Which gives the wrong sizeof().

This is just a guess, I was not able to try it for myself.

Kind Regards, Thomas 




On Mon, Jun 12, 2017 at 4:57 PM, Adam Roberts <AROBERTS at uk.ibm.com> wrote:
Hi, I'm looking to get OpenJDK 8 built on Power big-endian using AIX 7.2. 

I have xlc 12.1 and a small configuration script that currently does the 
following to overcome initial hurdles when configuring. I'm working off 
the latest 8 head. 

bash-4.3# cat AdamConfig.sh 
export CC="xlc" 
export CXX="xlc" 
export JDK_BOOT_DIR=/usr/java7_64 
export 
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java7_64/jre/bin:/usr/java7_64/bin:/usr/local/bin:/usr/vac/bin 


I source this first and then go on to ./configure. 

bash-4.3# cat openjdk/config.log | grep "The tested" 
configure:29034: The tested number of bits in the target (0) differs from 
the number of bits expected to be found in the target (64). 
configure:29100: error: The tested number of bits in the target (0) 
differs from the number of bits expected to be found in the target (64) 

As above, when configuring I can't get past the checking size of int* 
step. 

Two observations 
1) I can compile and run a regular C application with xlc using 64 bit 
pointers with either OBJECT_MODE=64 set as an environment variable or -q64 
set as a build option 
2) If I look in config.log I see this - notice the lack of -q64 being used 


configure:28993: checking size of int * 
configure:28998: /usr/vac/bin/xlc -o conftest  -m64   -m64 conftest.cpp 
 >&5 
/usr/vac/bin/xlc: 1501-216 (W) command option -64 is not recognized - 
passed to ld 
/usr/vac/bin/xlc: 1501-216 (W) command option -64 is not recognized - 
passed to ld 
ld: 0706-012 The -6 flag is not recognized. 
ld: 0706-012 The -4 flag is not recognized. 
ld: 0706-012 The -6 flag is not recognized. 
configure:28965: /usr/vac/bin/xlc -E  conftest.cpp 
configure:28965: $? = 0 
configure:28965: result: yes 
configure:28965: checking for stdio.h 
configure:28965: result: yes 
configure:28993: checking size of int * 
configure:28998: /usr/vac/bin/xlc -o conftest  -m64   -m64 conftest.cpp 
 >&5 
/usr/vac/bin/xlc: 1501-216 (W) command option -64 is not recognized - 
passed to ld 
/usr/vac/bin/xlc: 1501-216 (W) command option -64 is not recognized - 
passed to ld 
ld: 0706-012 The -6 flag is not recognized. 

Is there some option I'm not aware of that'll enable me to build trivially 
with xlc? Perhaps some extra work to be done to enable this? 

The sizeof check is defined as 

AC_CHECK_SIZEOF([int *], [1111]) 

in openjdk/common/autoconf/platform.m4 

Full configure log available on request, it does mention 
COMPILER_NAME=gcc. But surely I can't use gcc because I see we do a 
-qversion call with xlc to determine the compiler version (and that is an 
xlc specific option AFAIK). 

Feels like I'm missing something here! 

Cheers in advance 


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/attachments/20170613/e718d94c/attachment.html>


More information about the ppc-aix-port-dev mailing list