Date: Mon, 4 Jun 2007 13:16:11 -0700 (PDT) From: Don Lewis <truckman@FreeBSD.org> To: vova@sw.ru Cc: glewis@FreeBSD.org, java@freesbd.org, current@FreeBSD.org Subject: Re: failed to build java/jdk15 on recent current - gcc4 issue ? Message-ID: <200706042016.l54KGBRo058608@gw.catspoiler.org> In-Reply-To: <1180976737.24934.4.camel@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706042016.l54KGBRo058608>