From patchwork Mon Aug 8 22:51:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 109108 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 8074CB6F81 for ; Tue, 9 Aug 2011 08:51:32 +1000 (EST) Received: (qmail 25605 invoked by alias); 8 Aug 2011 22:51:30 -0000 Received: (qmail 25594 invoked by uid 22791); 8 Aug 2011 22:51:30 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from g1t0028.austin.hp.com (HELO g1t0028.austin.hp.com) (15.216.28.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Aug 2011 22:51:07 +0000 Received: from g1t0039.austin.hp.com (g1t0039.austin.hp.com [16.236.32.45]) by g1t0028.austin.hp.com (Postfix) with ESMTP id 2C4011C3EF for ; Mon, 8 Aug 2011 22:51:07 +0000 (UTC) Received: from catbert.cup.hp.com (catbert.cup.hp.com [15.244.97.27]) by g1t0039.austin.hp.com (Postfix) with ESMTP id C966A34190 for ; Mon, 8 Aug 2011 22:51:06 +0000 (UTC) Received: (from sje@localhost) by catbert.cup.hp.com (8.11.1 (PHNE_35951)/8.11.1) id p78Mp5Z11769; Mon, 8 Aug 2011 15:51:05 -0700 (PDT) Date: Mon, 8 Aug 2011 15:51:05 -0700 (PDT) Message-Id: <201108082251.p78Mp5Z11769@catbert.cup.hp.com> From: Steve Ellcey To: gcc-patches@gcc.gnu.org Subject: Patch ping for build change to fix -static-libgcc build on HP-UX In-Reply-To: <1311963095.2665.36.camel@hpsje.cup.hp.com> References: <1311963095.2665.36.camel@hpsje.cup.hp.com> <201107291747.p6THlib10035@catbert.cup.hp.com> 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 a ping for my patch to fix the C++ build of GCC on HP-UX and to fix -static-libstdc. The original patch is at: http://gcc.gnu.org/ml/gcc-patches/2011-07/msg02704.html I have updated the patch to deal with the changes that Rainer's top-level libgcc patch made and included the new version in this email. Unfortunately, I had to re-introduce the use of the GCC_CHECK_UNWIND_GETIPINFO to gcc/configure.ac so that gcc.c could check the value of USE_SYSTEM_LIBUNWIND in it's code. Dave Anglin said the HP-UX specific parts looked OK but I would like a build maintainer to OK the changes to and use of GCC_CHECK_UNWIND_GETIPINFO and the USE_SYSTEM_LIBUNWIND macro. Steve Ellcey sje@cup.hp.com Updated patch: config/ChangeLog 2011-08-08 Steve Ellcey * unwind_ipinfo.m4 (USE_SYSTEM_LIBUNWIND): Define. gcc/ChangeLog 2011-08-08 Steve Ellcey PR target/49967 * configure.ac (GCC_CHECK_UNWIND_GETIPINFO): Call. (gcc_cv_ld_static_dynamic): Define for *-*-hpux*. (gcc_cv_ld_static_option): Ditto. (gcc_cv_ld_dynamic_option): Ditto. * configure: Regenerate. * config.in: Regenerate. * aclocal.m4: Regenerate. * gcc.c (init_spec): Use USE_SYSTEM_LIBUNWIND. Index: config/unwind_ipinfo.m4 =================================================================== --- config/unwind_ipinfo.m4 (revision 177554) +++ config/unwind_ipinfo.m4 (working copy) @@ -34,4 +34,8 @@ AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [ if test x$have_unwind_getipinfo = xyes; then AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) fi + + if test x$with_system_libunwind = xyes; then + AC_DEFINE(USE_SYSTEM_LIBUNWIND, 1, [Define if using system unwind library.]) + fi ]) Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 177554) +++ gcc/configure.ac (working copy) @@ -1184,6 +1184,11 @@ if test $force_sjlj_exceptions = yes; th [Define 0/1 to force the choice for exception handling model.]) fi +# For platforms with the unwind ABI which includes an unwind library, +# libunwind, we can choose to use the system libunwind. +# This macro sets USE_SYSTEM_LIBUNWIND that is used in gcc.c. +GCC_CHECK_UNWIND_GETIPINFO + # -------------------------------------------------------- # Build, host, and target specific configuration fragments # -------------------------------------------------------- @@ -3231,6 +3236,14 @@ elif test x$gcc_cv_ld != x; then gcc_cv_ld_static_option="-noso" gcc_cv_ld_dynamic_option="-so_archive" ;; + # HP-UX ld uses -a flags to select between shared and archive. + *-*-hpux*) + if test x"$gnu_ld" = xno; then + gcc_cv_ld_static_dynamic=yes + gcc_cv_ld_static_option="-aarchive" + gcc_cv_ld_dynamic_option="-adefault" + fi + ;; # IRIX 6 ld supports -Bstatic/-Bdynamic. mips-sgi-irix6*) gcc_cv_ld_static_dynamic=yes Index: gcc/gcc.c =================================================================== --- gcc/gcc.c (revision 177554) +++ gcc/gcc.c (working copy) @@ -1391,7 +1391,7 @@ init_spec (void) "-lgcc", "-lgcc_eh" #ifdef USE_LIBUNWIND_EXCEPTIONS -# ifdef HAVE_LD_STATIC_DYNAMIC +# if defined(HAVE_LD_STATIC_DYNAMIC) && !defined(USE_SYSTEM_LIBUNWIND) " %{!static:" LD_STATIC_OPTION "} -lunwind" " %{!static:" LD_DYNAMIC_OPTION "}" # else