public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* specs question
@ 2022-05-27 10:25 Iain Sandoe
  0 siblings, 0 replies; 10+ messages in thread
From: Iain Sandoe @ 2022-05-27 10:25 UTC (permalink / raw)
  To: GCC Development; +Cc: Joseph Myers

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


^ permalink raw reply	[flat|nested] 10+ messages in thread
* specs question.
@ 2010-04-11 17:49 IainS
  2010-04-12 22:30 ` Ian Lance Taylor
  0 siblings, 1 reply; 10+ messages in thread
From: IainS @ 2010-04-11 17:49 UTC (permalink / raw)
  To: GCC Development

what is the expected behavior of ?

%{.c|.cc|.for|.F90: foo }

.. as I read gcc/gcc.c I would expect to get "foo" for command lines  
with files with these suffixes:
.c
.cc
.for
.F90

but not otherwise (since it says . binds more strongly than |) ;

Iain


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-27 10:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 10:25 specs question Iain Sandoe
  -- 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

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).