From patchwork Tue Sep 28 00:07:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 65929 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 9B70CB70DE for ; Tue, 28 Sep 2010 10:07:35 +1000 (EST) Received: (qmail 4639 invoked by alias); 28 Sep 2010 00:07:31 -0000 Received: (qmail 4616 invoked by uid 22791); 28 Sep 2010 00:07:30 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Sep 2010 00:07:23 +0000 Received: from wpaz29.hot.corp.google.com (wpaz29.hot.corp.google.com [172.24.198.93]) by smtp-out.google.com with ESMTP id o8S07L9u025649 for ; Mon, 27 Sep 2010 17:07:21 -0700 Received: from pva4 (pva4.prod.google.com [10.241.209.4]) by wpaz29.hot.corp.google.com with ESMTP id o8S07Km0012677 for ; Mon, 27 Sep 2010 17:07:20 -0700 Received: by pva4 with SMTP id 4so3343895pva.25 for ; Mon, 27 Sep 2010 17:07:20 -0700 (PDT) Received: by 10.114.39.7 with SMTP id m7mr9425778wam.201.1285632439946; Mon, 27 Sep 2010 17:07:19 -0700 (PDT) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id d38sm11409187wam.20.2010.09.27.17.07.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Sep 2010 17:07:18 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org Subject: PATCH COMMITTED: Fix -fsplit-stack build with old binutils Date: Mon, 27 Sep 2010 17:07:16 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes 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 http://gcc.gnu.org/ml/gcc-regression/2010-09/msg00356.html shows a build failure with the -fsplit-stack patches: /home/regress/tbox/svn-gcc/libgcc/config/i386/morestack.S /home/regress/tbox/svn-gcc/libgcc/config/i386/morestack.S: Assembler messages: /home/regress/tbox/svn-gcc/libgcc/config/i386/morestack.S:138: Error: unknown pseudo-op: `.cfi_personality' /home/regress/tbox/svn-gcc/libgcc/config/i386/morestack.S:139: Error: unknown pseudo-op: `.cfi_lsda' make[3]: *** [morestack_s.o] Error 1 gas picked up support for .cfi_personality 2006-11-03, which was in the binutils 2.18 release. This patch changes gcc to only support -fsplit-stack if the .cfi pseudo-ops are available in the assembler. Another approach would be to spell out the information in morestack.S, but that does not seem to me like a useful way to spend time considering how long the GNU binutils have supported the pseudo-ops. Bootstrapped and tested on x86_64-unknown-linux-gnu. Committed to mainline. Ian gcc/ChangeLog: 2010-09-27 Ian Lance Taylor * config/i386/i386.c (ix86_supports_split_stack): -fsplit-stack requires assembler support for CFI directives. libgcc/ChangeLog: 2010-09-27 Ian Lance Taylor * configure.ac: Test whether assembler supports CFI directives. * config.host: Only add t-stack and i386/t-stack-i386 to tmake_file if libgcc_cv_cfi is "yes". * configure: Rebuild. Index: libgcc/config.host =================================================================== --- libgcc/config.host (revision 164669) +++ libgcc/config.host (working copy) @@ -602,7 +602,10 @@ case ${host} in i[34567]86-*-linux* | x86_64-*-linux* | \ i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | \ i[34567]86-*-gnu*) - tmake_file="${tmake_file} t-tls t-stack i386/t-stack-i386" + tmake_file="${tmake_file} t-tls" + if test "$libgcc_cv_cfi" = "yes"; then + tmake_file="{$tmake_file} t-stack i386/t-stack-i386" + fi ;; esac Index: libgcc/configure.ac =================================================================== --- libgcc/configure.ac (revision 164669) +++ libgcc/configure.ac (working copy) @@ -135,6 +135,12 @@ AC_CACHE_CHECK([whether fixed-point is s fixed_point=$libgcc_cv_fixed_point AC_SUBST(fixed_point) +# Check for assembler CFI support. +AC_CACHE_CHECK([whether assembler supports CFI directives], [libgcc_cv_cfi], + [AC_COMPILE_IFELSE([int i = __GCC_HAVE_DWARF2_CFI_ASM;], + [libgcc_cv_cfi=yes], + [libgcc_cv_cfi=no])]) + # Check 32bit or 64bit for x86. case ${host} in i?86*-*-* | x86_64*-*-*) Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 164669) +++ gcc/config/i386/i386.c (working copy) @@ -8415,6 +8415,14 @@ ix86_supports_split_stack (bool report A if (report) error ("%<-fsplit-stack%> currently only supported on GNU/Linux"); ret = false; +#else + if (!dwarf2out_do_cfi_asm ()) + { + if (report) + error ("%<-fsplit-stack%> requires " + "assembler support for CFI directives"); + ret = false; + } #endif return ret;