public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <iain@sandoe.co.uk>
To: GCC Development <gcc@gcc.gnu.org>
Cc: Joseph Myers <joseph@codesourcery.com>
Subject: specs question
Date: Fri, 27 May 2022 11:25:42 +0100	[thread overview]
Message-ID: <42CC96C0-CA60-470F-BD79-A1D944DB9179@sandoe.co.uk> (raw)

Hi.

My ‘downstream’ have a situation in which they make use of a directory outside of the configured GCC installation - and symlink from there to libraries in the actual install tree.

e.g.

/foo/bar/lib:
  libgfortran.dylib -> /gcc/install/path/lib/libgfortran.dylib

Now I want to find a way for them to add an embedded runpath that references /foo/bar/lib.

I could add a configure option, that does exactly this job - but then I’d have to back port that to every GCC version they are still supporting (not, perhaps, the end of the world but much better avoided).

So I was looking at using —with-specs= to add a link-time spec for this:

--with-specs='%{!nodefaultrpaths:%{!r:%:version-compare(>= 10.5 mmacosx_version_min= -Wl,-rpath,/foo/bar/lib)}}}’

Which works, fine except for PCH jobs which it breaks because the presence of an option claimed by the linker causes a link job to be created, even though one is not required (similar issue have been seen before).

There is this:
 %{,S:X}  substitutes X, if processing a file which will use spec S.

so I could then do:

--with-specs=‘%{,???:%{!nodefaultrpaths:%{!r:%:version-compare(>= 10.5 mmacosx_version_min= -Wl,-rpath,/foo/bar/lib)}}}}’

but, unfortunately, I cannot seem to figure out what ??? should be  [I tried ‘l’ (link_spec) ‘link_command’ (*link_command)]

…JFTR also tried
  %{!.h:
   %{!,c-header:

——
any insight would be welcome, usually I muddle through with specs, but this one has me stumped.

thanks
Iain


             reply	other threads:[~2022-05-27 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 10:25 Iain Sandoe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-04-11 17:49 IainS
2010-04-12 22:30 ` Ian Lance Taylor
2010-04-12 22:41   ` IainS
2010-04-12 23:26     ` Ian Lance Taylor
2010-04-12 23:44       ` IainS
2010-04-13  0:01         ` Ian Lance Taylor
2010-04-13  8:55       ` IainS
2010-04-13 18:14         ` Peter O'Gorman
2010-04-13 19:21           ` IainS

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=42CC96C0-CA60-470F-BD79-A1D944DB9179@sandoe.co.uk \
    --to=iain@sandoe.co.uk \
    --cc=gcc@gcc.gnu.org \
    --cc=joseph@codesourcery.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).