From patchwork Thu Aug 19 16:00:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 62189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 0DCA5B70DE for ; Fri, 20 Aug 2010 02:00:49 +1000 (EST) Received: (qmail 18683 invoked by alias); 19 Aug 2010 16:00:44 -0000 Received: (qmail 18665 invoked by uid 22791); 19 Aug 2010 16:00:42 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_GC, TW_LG, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 19 Aug 2010 16:00:35 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id F037EB005D for ; Thu, 19 Aug 2010 12:00:32 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id o7JG0WCX006165 for gcc-patches@gcc.gnu.org; Thu, 19 Aug 2010 12:00:32 -0400 Date: Thu, 19 Aug 2010 12:00:32 -0400 From: Jack Howarth To: gcc-patches@gcc.gnu.org Subject: [PATCH] corrected ChangeLog - replace hardcoded -lm in libgcj.spec.in for darwin Message-ID: <20100819160032.GA6163@bromo.med.uc.edu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This is the previously approved patch with unnecessary entries for regenerated Makefile.in's removed from the ChangeLog. Jack ---------------------------------------------------------------------------- The attached patch replaces the hard-coded -lm in libjava/libgcj.spec.in with the contents of LIBMATHSPEC as conditionally defined in configure.ac. Bootstrapped and regression tested on x86_64-apple-darwin10. Okay for gcc trunk? Jack ps Before this patch "gcj --main=testme -O testme.java" produced... /sw/lib/gcc4.6/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /sw/lib/gcc4.6/lib/libgcj.12.dylib (compatibility version 13.0.0, current version 13.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1) /sw/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) whereas with the patch libSystem properly appears last... /sw/lib/gcc4.6/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /sw/lib/gcc4.6/lib/libgcj.12.dylib (compatibility version 13.0.0, current version 13.0.0) /sw/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1) The separation of /sw/lib/gcc4.6/lib/libgcc_s.1.dylib and /usr/lib/libSystem.B.dylib in the linkage order appears due to the duplicate -lgcc_ext.10.5 occurances in the linkage as a result of -shared-libgcc... COLLECT_GCC_OPTIONS= '-mmacosx-version-min=10.6.5' '-v' '-O' '-shared-libgcc' '-mtune=generic' /sw/lib/gcc4.6/libexec/gcc/x86_64-apple-darwin10.5.0/4.6.0/collect2 -dynamic -arch x86_64 -macosx_version_min 10.6.5 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.5.o -L/sw/lib/gcc4.6/lib/gcc/x86_64-apple-darwin10.5.0/4.6.0 -L/sw/lib/gcc4.6/lib/gcc/x86_64-apple-darwin10.5.0/4.6.0/../../.. /var/tmp//cclJxmz2.o /var/tmp//ccKe7aS5.o -lgcc_ext.10.5 -lgcj -L/sw/lib -liconv -lz -allow_stack_execute -lgcc_ext.10.5 -lSystem 2010-08-18 Jack Howarth * libjava/configure.ac: Set LIBMATHSPEC to -lm except on darwin. * libjava/libgcj.spec.in: Use LIBMATHSPEC. * libjava/configure: Regenerate. Index: libjava/configure.ac =================================================================== --- libjava/configure.ac (revision 163335) +++ libjava/configure.ac (working copy) @@ -928,6 +928,16 @@ ;; esac +LIBMATHSPEC= +# extra LD Flags which are required for targets +case "${host}" in +*-*-darwin*) + ;; +*) + LIBMATHSPEC=-lm + ;; +esac + # Check for --no-merge-exidx-entries, an ARM-specific linker option. AC_CACHE_CHECK([for --no-merge-exidx-entries], [libgcj_cv_exidx], [saved_ldflags="$LDFLAGS" @@ -953,6 +963,7 @@ AC_SUBST(extra_ldflags_libjava) AC_SUBST(extra_ldflags) AC_SUBST(LIBSTDCXXSPEC) +AC_SUBST(LIBMATHSPEC) AC_SUBST(LIBGCJTESTSPEC) Index: libjava/libgcj.spec.in =================================================================== --- libjava/libgcj.spec.in (revision 163335) +++ libjava/libgcj.spec.in (working copy) @@ -7,6 +7,6 @@ *startfile: @THREADSTARTFILESPEC@ %(startfileorig) %rename lib liborig -*lib: @LD_START_STATIC_SPEC@ @LIBGCJ_SPEC@ @LD_FINISH_STATIC_SPEC@ -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) @LIBSTDCXXSPEC@ %(liborig) +*lib: @LD_START_STATIC_SPEC@ @LIBGCJ_SPEC@ @LD_FINISH_STATIC_SPEC@ @LIBMATHSPEC@ @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) @LIBSTDCXXSPEC@ %(liborig) *jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ @BACKTRACESPEC@ @IEEESPEC@ @ATOMICSPEC@ @LIBGCJ_BC_SPEC@ -fkeep-inline-functions