From owner-freebsd-current@FreeBSD.ORG Mon Jun 4 20:16:26 2007 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6A9316A469 for ; Mon, 4 Jun 2007 20:16:26 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (adsl-75-1-14-242.dsl.scrm01.sbcglobal.net [75.1.14.242]) by mx1.freebsd.org (Postfix) with ESMTP id 96A0013C480 for ; Mon, 4 Jun 2007 20:16:26 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id l54KGBRo058608; Mon, 4 Jun 2007 13:16:15 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200706042016.l54KGBRo058608@gw.catspoiler.org> Date: Mon, 4 Jun 2007 13:16:11 -0700 (PDT) From: Don Lewis To: vova@sw.ru In-Reply-To: <1180976737.24934.4.camel@localhost> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: glewis@FreeBSD.org, java@freesbd.org, current@FreeBSD.org Subject: Re: failed to build java/jdk15 on recent current - gcc4 issue ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2007 20:16:26 -0000 On 4 Jun, Vladimir Grebenschikov wrote: > java/jdk14 also fails to build. I managed to rebuild jdk14 even after "make delete-old-libs" using the gcc34 port and bootstrapping using the Linux JDK. I haven't yet had a chance to see if the plugin communicates with Firefox built with the system compiler or if there will be an ABI mismatch. In the process I discovered two interesting quirks. The first is that there are a number of places that set $(CXX), assuming that this is c++ compiler, and $(CPP), assuming that this is the preprocessor. This isn't entirely true, because the hotspot build uses $(CPP) as the c++ compiler (see hotspot/build/*/makefiles/adlc.make). The linker bails out when it encounters a .o file that is actually just source code that has been run through the preprocessor. The second quirk is that overriding $(CC) in MAKE_ARGS isn't sufficient to get the j2se portion of the build to work, because j2se/make/common/Defs-bsd.gmk doesn't allow $(CC) to be overridden. I added this to MAKE_ARGS in pkgtools.conf: 'java/jdk14' => [ 'WITH_LINUX_BOOTSTRAP=yes', 'USE_GCC=3.4', 'MAKE_FLAGS="CC=/usr/local/bin/gcc34 CXX=/usr/local/bin/c++34 CPP=/ usr/local/bin/c++34"', ], and I had to apply this patch (to a patch): Index: java/jdk14/files/patch-common::Defs-bsd.gmk =================================================================== RCS file: /home/ncvs/ports/java/jdk14/files/patch-common::Defs-bsd.gmk,v retrieving revision 1.9 diff -u -r1.9 patch-common::Defs-bsd.gmk --- java/jdk14/files/patch-common::Defs-bsd.gmk 8 Dec 2006 22:36:15 -0000 1.9 +++ java/jdk14/files/patch-common::Defs-bsd.gmk 3 Jun 2007 18:08:47 -0000 @@ -1,7 +1,26 @@ $FreeBSD: ports/java/jdk14/files/patch-common::Defs-bsd.gmk,v 1.9 2006/12/08 22:36:15 glewis Exp $ - ---- ../../j2se/make/common/Defs-bsd.gmk.orig Fri Dec 8 11:50:23 2006 -+++ ../../j2se/make/common/Defs-bsd.gmk Fri Dec 8 11:58:29 2006 +--- ../../j2se/make/common/Defs-bsd.gmk.orig Sun Jun 3 10:46:29 2007 ++++ ../../j2se/make/common/Defs-bsd.gmk Sun Jun 3 11:04:08 2007 +@@ -40,15 +40,15 @@ + BASENAME = $(USRBIN_PATH)basename + CAT = $(UNIXCOMMAND_PATH)cat + ifneq ($(TRUE_PLATFORM), OpenBSD) +-CC = $(COMPILER_PATH)gcc +-CPP = $(COMPILER_PATH)gcc -E ++CC ?= $(COMPILER_PATH)gcc ++CPP ?= $(COMPILER_PATH)gcc -E + ifeq ($(STATIC_CXX),true) + # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++" + # We need to use gcc to statically link the C++ runtime. gcc and g++ use + # the same subprocess to compile C++ files, so it is OK to build using gcc. +-CXX = $(COMPILER_PATH)gcc ++CXX ?= $(COMPILER_PATH)gcc + else +-CXX = $(COMPILER_PATH)g++ ++CXX ?= $(COMPILER_PATH)g++ + endif + else + # Allow ports/pkgsrc infrastructure to override CC, CPP and CXX. @@ -192,7 +192,7 @@ ifeq ($(TRUE_PLATFORM), NetBSD) DEVTOOLS_PATH = /usr/pkg/bin/