public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
To: gcc-patches@gcc.gnu.org
Cc: ubizjak@gmail.com, ian@airs.com, fortran@gcc.gnu.org
Subject: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"
Date: Mon, 24 Aug 2015 16:00:00 -0000	[thread overview]
Message-ID: <201508241555.t7OFt1VI015330@ignucius.se.axis.com> (raw)
In-Reply-To: <DED6598E-A106-4BBE-9943-575D1489FECF@gmail.com> (message from FX	on Fri, 14 Aug 2015 16:18:54 +0200)

(Goofed on the CC line, sorry for the dup.)

There exists targets that support fortran but error on -fPIC,
for example cris-elf, which broke with the libbacktrace thingy.
(Emitting an error for -fPIC is a conscious choice; a
compilation error is better than e.g. to silently ignoring it.)
This fix causes build to pass the point of error for cris-elf.
Borderline obvious, but...

Ok to regtest passes on a native x86_64-linux?

libbacktrace:
	configure.ac: Only compile with -fPIC if the target
	supports it.

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 17:31:18.000000000 +0200
@@ -163,10 +163,11 @@ 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 a function with that option.
 PIC_FLAG=
 if test -n "${with_target_subdir}"; then
-  PIC_FLAG=-fPIC
+  AC_TRY_COMPILE([void foo(void){}], [PIC_FLAG=-fPIC])
 fi
 # Similarly, use -fPIC with --enable-host-shared:
 AC_ARG_ENABLE(host-shared,

brgds, H-P

  parent reply	other threads:[~2015-08-24 15:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14 13:19 [patch,libgfortran,toplevel] Use libbacktrace in libgfortran Uros Bizjak
2015-08-14 14:31 ` FX
2015-08-23 20:14   ` Janne Blomqvist
2015-08-23 20:59     ` FX
2015-08-23 21:27       ` Janne Blomqvist
2015-08-24  7:15         ` FX
2015-08-24 16:00   ` Hans-Peter Nilsson [this message]
2015-08-24 16:08     ` Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran" FX
2015-08-24 16:44       ` Hans-Peter Nilsson
2015-08-24 18:42         ` FX
2015-08-25  3:29         ` Ian Lance Taylor
2015-08-25 13:25           ` Ulrich Weigand
2015-08-25 17:09             ` Hans-Peter Nilsson
2015-08-25 17:57               ` Ulrich Weigand
2015-08-26  0:09                 ` Hans-Peter Nilsson
2015-08-26 12:17                   ` Ulrich Weigand
2015-08-26 12:34                     ` Hans-Peter Nilsson
2015-08-26 15:37                       ` [PATCH] Fix and simplify (Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran") Ulrich Weigand
2015-08-27  4:02                         ` Ian Lance Taylor
2015-08-27 13:38                           ` Ulrich Weigand
2015-08-27 14:02                             ` Ian Lance Taylor
2015-08-24 16:04   ` Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran" Hans-Peter Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201508241555.t7OFt1VI015330@ignucius.se.axis.com \
    --to=hans-peter.nilsson@axis.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ian@airs.com \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).