From owner-freebsd-java@FreeBSD.ORG Wed Feb 26 04:32:18 2014 Return-Path: Delivered-To: java@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19321529; Wed, 26 Feb 2014 04:32:18 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CBEC41804; Wed, 26 Feb 2014 04:32:17 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s1Q4W9GF080388; Tue, 25 Feb 2014 20:32:13 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201402260432.s1Q4W9GF080388@gw.catspoiler.org> Date: Tue, 25 Feb 2014 20:32:09 -0800 (PST) From: Don Lewis Subject: Re: Openjdk6 and clang 3.4 To: antoine@FreeBSD.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: java@FreeBSD.org X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 04:32:18 -0000 On 26 Feb, Antoine Brodin wrote: > Hi, > > I am not sure if you are already aware of this or not. > Clang 3.4 has been imported in head 10 days ago. This new version > errors on unknown flags. > Openjdk6 no longer builds with clang 3.4 because of this (-fcheck-new > unknown by clang): > > gmake[7]: Entering directory > `/wrkdirs/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' > Compiling /wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/share/vm/adlc/adlparse.cpp > rm -f ../generated/adfiles/adlparse.o > c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 > -I/wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/share/vm/prims > -I/wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/share/vm > -I/wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/share/vm/precompiled > -I/wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/cpu/x86/vm > -I/wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/os_cpu/bsd_x86/vm > -I/wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/os/bsd/vm > -I/wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/os/posix/vm > -I/wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/share/vm/adlc > -I../generated -DASSERT -O2 -pipe -fno-strict-aliasing > -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 > -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 > -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno-rtti > -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMILY_bsd > -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 > -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 > -DCOMPILER1 -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe > -g -c -o ../generated/adfiles/adlparse.o > /wrkdirs/usr/ports/java/openjdk6/work/hotspot/src/share/vm/adlc/adlparse.cpp > c++: error: unknown argument: '-fcheck-new' > c++: error: unknown argument: '-fcheck-new' > gmake[7]: *** [../generated/adfiles/adlparse.o] Error 1 I patched hotspot/make/bsd/makefiles/gcc.make to remove this compiler flag. That got me further, but still no joy: gmake[8]: Entering directory `/usr/ports/java/openjdk6/work/build/bsd-i586/hotspot/outputdir/bsd_i486_compiler2/product' echo Generating precompiled header precompiled.hpp.gch Generating precompiled header precompiled.hpp.gch mkdir -p . c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DIA32 -DPRODUCT -I. -I/usr/ports/java/openjdk6/work/hotspot/src/share/vm/prims -I/usr/ports/java/openjdk6/work/hotspot/src/share/vm -I/usr/ports/java/openjdk6/work/hotspot/src/share/vm/precompiled -I/usr/ports/java/openjdk6/work/hotspot/src/cpu/x86/vm -I/usr/ports/java/openjdk6/work/hotspot/src/os_cpu/bsd_x86/vm -I/usr/ports/java/openjdk6/work/hotspot/src/os/bsd/vm -I/usr/ports/java/openjdk6/work/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"23.25-b01\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"dl\"" -DHOTSPOT_LIB_ARCH=\"i386\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -O2 -pipe -march=athlon64 -DLIBICONV_PLUG -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_32 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_32 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno-rtti -fno-exceptions -pthread -m32 -march=i586 -pipe -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGE! T_ARCH_MODEL_x86_32 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_32 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -m32 -march=i586 -pipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -DINCLUDE_TRACE -w -Wpointer-arith -Wconversion -Wsign-compare -c -MMD -MP -MF ../generated/dependencies/precompiled.hpp.gch.d -x c++-header /usr/ports/java/openjdk6/work/hotspot/src/share/vm/precompiled/precompiled.hpp -o precompiled.hpp.gch In file included from /usr/ports/java/openjdk6/work/hotspot/src/share/vm/precompiled/precompiled.hpp:29: In file included from /usr/ports/java/openjdk6/work/hotspot/src/share/vm/asm/assembler.hpp:29: /usr/ports/java/openjdk6/work/hotspot/src/share/vm/code/relocInfo.hpp:374:27: error: friend declaration specifying a default argument must be a definition inline friend relocInfo prefix_relocInfo(int datalen = 0); ^ /usr/ports/java/openjdk6/work/hotspot/src/share/vm/code/relocInfo.hpp:469:18: error: friend declaration specifying a default argument must be the only declaration inline relocInfo prefix_relocInfo(int datalen) { ^ /usr/ports/java/openjdk6/work/hotspot/src/share/vm/code/relocInfo.hpp:374:27: note: previous declaration is here inline friend relocInfo prefix_relocInfo(int datalen = 0); ^ /usr/ports/java/openjdk6/work/hotspot/src/share/vm/code/relocInfo.hpp:471:59: error: 'RAW_BITS' is a protected member of 'relocInfo' return relocInfo(relocInfo::data_prefix_tag, relocInfo::RAW_BITS, relo... ^ /usr/ports/java/openjdk6/work/hotspot/src/share/vm/code/relocInfo.hpp:279:23: note: declared protected here enum RawBitsToken { RAW_BITS }; ^ /usr/ports/java/openjdk6/work/hotspot/src/share/vm/code/relocInfo.hpp:471:10: error: calling a protected constructor of class 'relocInfo' return relocInfo(relocInfo::data_prefix_tag, relocInfo::RAW_BITS, relo... ^ /usr/ports/java/openjdk6/work/hotspot/src/share/vm/code/relocInfo.hpp:280:3: note: declared protected here relocInfo(relocType type, RawBitsToken ignore, int bits) ^ 4 errors generated. gmake[8]: *** [precompiled.hpp.gch] Error 1 Apparently this is some illegal C++ that neither gcc nor clang 3.3 complain about, but clang 3.4 flags. At that point I picked up the USES_GMAKE and MAKE_ARGS changes from openjdk7/Makefile and was able to build openjdk6. The same problems are still in openjdk7, but it builds because it doesn't try to use clang. Index: Makefile =================================================================== --- Makefile (revision 345674) +++ Makefile (working copy) @@ -64,6 +64,8 @@ WRKSRC= ${WRKDIR} USE_XORG= x11 xext xi xt xtst +MAKE_ARGS= CC=${CC} CXX=${CXX} HOST_CC=${CC} +USE_GCC= any # do not depend on devel/apache-ant to avoid circular dependency, but # use .tar.bz2 distfile to avoid duplicated downloads