public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Andreas Tobler <andreast-list@fgznet.ch>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: [patch] Fix bootstrap powerpc*-*-freebsd* targets
Date: Mon, 17 Dec 2018 00:10:00 -0000	[thread overview]
Message-ID: <20181217001000.GA30978@bubble.grove.modra.org> (raw)
In-Reply-To: <7d04429f-e633-0b5b-0d69-eae3c86634ca@fgznet.ch>

On Sun, Dec 16, 2018 at 07:46:18PM +0100, Andreas Tobler wrote:
> On 12.12.18 21:32, Andreas Tobler wrote:
> 
> > this patch fixes bootstrap for my powerpc*-unknown-freebsd* targets.
> > The definition of GNU_USER_DYNAMIC_LINKER was recently moved to linux.h.

Sorry about the breakage.

> > But the GNU_USER_DYNAMIC_LINKER is still used in rs6000/sysv4.h.
> > So I add an empty definition with guard to cure the bootstrap issue.
> > 
> > Ok for trunk?
> 
> This is another attemtp to fix bootstrap on powerpc*-unknown-freebsd* only.
> 
> This one is only for FreeBSD and so I can approve and apply myself.
> 
> Objections?

It's not the best fix.  An empty string for something that is an
argument of -dynamic-linker will result in the linker eating the next
command line string for -dynamic-linker.  That will break -mcall-linux
on freebsd, if anyone should try to use that option.  (Chances are
that most of the -mcall options are broken anyway, but let's not break
them further.)

Since I broke powerpc*-freebsd and the other non-linux powerpc
targets, I guess I ought to fix them.  The following is a variation on
your first patch, that results in -mcall-linux for powerpc-freebsd*
providing the 32-bit powerpc-linux dynamic linker.

Tested with x86_64-linux to powerpc-linux, powerpc64le-linux and
powerpc-freebsd12.0 crosses, observing the effect of -muclibc, -mmusl
etc. on powerpc*-linux and -mcall-linux on powerpc-freebsd.  I'll also
do a full native powerpc64le-linux bootstrap and regression test.

	* config/rs6000/sysv4.h (GNU_USER_DYNAMIC_LINKER): Define.

diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 0d84f4f3f57..598da25269e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -761,6 +761,10 @@ GNU_USER_TARGET_CC1_SPEC
 #define MUSL_DYNAMIC_LINKER \
   "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
 
+#ifndef GNU_USER_DYNAMIC_LINKER
+#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
+#endif
+
 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
   %{rdynamic:-export-dynamic} \
   -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2018-12-17  0:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 20:33 [patch] Fix bootstrap for non linux powerpc targets Andreas Tobler
2018-12-16 18:46 ` [patch] Fix bootstrap powerpc*-*-freebsd* targets Andreas Tobler
2018-12-17  0:10   ` Alan Modra [this message]
2018-12-17 17:06     ` Segher Boessenkool
2018-12-18  0:09       ` Alan Modra
2018-12-18  9:20         ` Segher Boessenkool
2018-12-18 12:49           ` Alan Modra
2018-12-18 16:14             ` Segher Boessenkool
2018-12-19  8:36         ` Segher Boessenkool

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=20181217001000.GA30978@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=andreast-list@fgznet.ch \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /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).