From patchwork Mon Aug 24 16:40:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 510172 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F262D1401F6 for ; Tue, 25 Aug 2015 02:41:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=qyHKNn8C; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:cc:in-reply-to:subject:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=ylp 6k3qLsFzsXjBS5OHwYK4MB5oaQICCGDo5C3k0zM3ANT217hAZPAiVixVq/DWd/CD GM5OB6Qa6eXbBK3WBMBMRXgjYSC/A7WsO3VHDPbJnKa22f//yw3xUHL1FhBEzPNG +QDaaf6H3wIu2pG9lbLOHKjnD2Qifk1+SR3uuIY8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:cc:in-reply-to:subject:mime-version :content-type:content-transfer-encoding; s=default; bh=6kQFOny5q wIna32Gaaks7knVtU4=; b=qyHKNn8CiwAtRGqUKclC7wiOD4vq7voMOAYEisvWL ITEPt3qD21d+SY9t0J+mRLapshHI85XRSspMz3DlAwHisZGF4vWfzAK2tja3Cz+z 0xbuyVTuqmgZ/l3meOHYP1xBWH+ulYYZrL29QZOnENQv0YwWOSAdPztWvjNGd6lr Cg= Received: (qmail 63445 invoked by alias); 24 Aug 2015 16:41:01 -0000 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 Received: (qmail 63399 invoked by uid 89); 24 Aug 2015 16:41:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: bastet.se.axis.com Received: from bastet.se.axis.com (HELO bastet.se.axis.com) (195.60.68.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Aug 2015 16:40:58 +0000 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id AE4D218132; Mon, 24 Aug 2015 18:40:55 +0200 (CEST) Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id DKSp7IcXC3NA; Mon, 24 Aug 2015 18:40:54 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bastet.se.axis.com (Postfix) with ESMTP id 8B0331809D; Mon, 24 Aug 2015 18:40:54 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 6F6031472; Mon, 24 Aug 2015 18:40:54 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by boulder.se.axis.com (Postfix) with ESMTP id 6354C143F; Mon, 24 Aug 2015 18:40:54 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by seth.se.axis.com (Postfix) with ESMTP id 5DF6D3E049; Mon, 24 Aug 2015 18:40:54 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id t7OGesBc016464; Mon, 24 Aug 2015 18:40:54 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id t7OGercr016460; Mon, 24 Aug 2015 18:40:53 +0200 Date: Mon, 24 Aug 2015 18:40:53 +0200 Message-Id: <201508241640.t7OGercr016460@ignucius.se.axis.com> From: Hans-Peter Nilsson To: fxcoudert@gmail.com CC: gcc-patches@gcc.gnu.org, ubizjak@gmail.com, ian@airs.com, fortran@gcc.gnu.org In-reply-to: <9A1DC502-2DBF-427E-B402-0FA3864C3199@gmail.com> (message from FX on Mon, 24 Aug 2015 18:07:52 +0200) Subject: Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran" MIME-Version: 1.0 > From: FX > Date: Mon, 24 Aug 2015 18:07:52 +0200 > > PIC_FLAG= > > if test -n "${with_target_subdir}"; then > > - PIC_FLAG=-fPIC > > + AC_TRY_COMPILE([void foo(void){}], [PIC_FLAG=-fPIC]) > > fi > > There's something I don't understand about this > test. Shouldn't AC_TRY_COMPILE take a first (empty) argument, > "includes"? And shouldn't you first set the -fPIC flag before > try to compile with that? You're absolutely right on both accounts. Also, the function body is supposed to be a function body (...) or else we get a nested function (i.e. foo inside main). Might as well provide both empty. Also fixing the ChangeLog entry. Sorry for goofing. (At least I had a look at config.log this time...) * configure.ac: Only compile with -fPIC if the target supports it. * configure: Regenerate. brgds, H-P diff -upr /expvol/pp_slask/hp/checkout/gcchead/gcc/libbacktrace/configure.ac libbacktrace/configure.ac --- /expvol/pp_slask/hp/checkout/gcchead/gcc/libbacktrace/configure.ac 2015-05-29 17:23:20.000000000 +0200 +++ libbacktrace/configure.ac 2015-08-24 18:31:01.000000000 +0200 @@ -163,10 +163,14 @@ fi # When building as a target library, shared libraries may want to link # this in. We don't want to provide another shared library to -# complicate dependencies. Instead, we just compile with -fPIC. +# complicate dependencies. Instead, we just compile with -fPIC, if +# the target supports compiling with that option. PIC_FLAG= if test -n "${with_target_subdir}"; then - PIC_FLAG=-fPIC + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fPIC" + AC_TRY_COMPILE([], [], [PIC_FLAG=-fPIC]) + CFLAGS="$ac_save_CFLAGS" fi # Similarly, use -fPIC with --enable-host-shared: AC_ARG_ENABLE(host-shared,