From owner-freebsd-java@FreeBSD.ORG Sun Sep 15 20:11:39 2013 Return-Path: Delivered-To: java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7796AE09; Sun, 15 Sep 2013 20:11:39 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (gerbercreations.com [71.39.140.16]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4363D2370; Sun, 15 Sep 2013 20:11:38 +0000 (UTC) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.14.7/8.14.7) with ESMTP id r8FJlUKP030536; Sun, 15 Sep 2013 12:47:30 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.14.7/8.14.7/Submit) id r8FJlT9E030535; Sun, 15 Sep 2013 12:47:29 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Sun, 15 Sep 2013 12:47:29 -0700 From: Greg Lewis To: Dimitry Andric Subject: Re: Building java/openjdk7 with clang Message-ID: <20130915194729.GA35020@misty.eyesbeyond.com> References: <108F3771-64B3-40E9-91FA-04C160442608@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <108F3771-64B3-40E9-91FA-04C160442608@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: java@freebsd.org, Baptiste Daroussin , Greg Lewis X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2013 20:11:39 -0000 G'day Dimitry, On Sun, Sep 15, 2013 at 01:45:19AM +0200, Dimitry Andric wrote: > I took some time to figure out how to build java/openjdk7 with clang. > There are a few items I changed: > > - Change a few instances of "ifneq ($(COMPILER_WARNINGS_FATAL),false)" > to "ifeq ($(COMPILER_WARNINGS_FATAL),true)", to make sure -Werror is > *not* used. There are zillions of warnings in openjdk, and I don't > think it is worth the trouble to fix them all (even if that is > possible :). > - Remove -fcheck-new from CFLAGS, since clang does not support it, and > it does not make sense anyway. This is the only one that is not > strictly needed; if -Werror is not enabled, clang will just print a > warning that the option is unused, but it won't be fatal. > - Change the $(CC) -dumpspecs hack in one of the Makefiles to something > more portable. The -dumpspecs is done to figure out if the compiler > uses --hash-style=gnu when linking, and if it does, it changes the > option to --hash-style=both. On FreeBSD, this is basically a no-op, > so it could also be commented out entirely. > - In jdk/src/solaris/native/java/net/net_util_md.c, change two > instances of CHECK_NULL() to CHECK_NULL_RETURN(), since the function > they are in is supposed to return a value. I chose to return 0, > since that is what the function seems to use as a default value. > > With these fixes, openjdk7 builds and runs fine for me. I tried to run > "gmake test" in the work directory, but that didn't do much, so I am > not sure if a full test suite will survive anything. It would be nice > if anybody knows a good way to test the produced binaries more > thoroughly. What version of FreeBSD did you do this on? Does it break compilation with gcc? For the change wrt COMPILER_WARNINGS_FATAL, why not set this to false for clang rather than turn this off unless explicitly on for all compilers? In terms of testing, that's a bit of a sore spot. You could notionally run it through the test suite, but you'd need to compare that to a version built with gcc since I suspect there will be numerous failures anyway. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org