public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Is this supposed to work, or am I loopy?
@ 2001-01-08 11:30 Nick Clifton
  2001-01-21 16:13 ` Marc Espie
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Clifton @ 2001-01-08 11:30 UTC (permalink / raw)
  To: jbuck; +Cc: dewar, gcc, pedwards

Hi Guys,

: From Joe:
:
: What I'm saying is that the difference is gratuitous and is caused
: by the gcc driver.

But it is not gratuitous.  The support (by gcc) for -R under some
OS'es is a convenience but a requirement.  GCC does not gratuitously
decide to not support -R, it actually provides the completely
standard, and workable, -Wl,-R option.  Supporting -R is non-standard,
and is only provided as a nicety to help users who are used to
Solaris compilers that do the translation of -R to -Wl,-R behind their
backs.


: On both Solaris and Linux, the linker understands the -R switch and 
: treats it identically.  On Solaris, the gcc driver accepts -R and
: passes it through to the linker.  On Linux, the gcc driver rejects
: -R.  That is, the two OSes would have identical behavior, except
: that for some reason gcc decides to treat them differently.  There
: is no reason for gcc to impose this difference.

Yes there is - there is no standard or requirement that gcc should
pass -R on to the linker.  If you want to pass options on to the
linker you should use -Wl,<option>.  There is no good reason why -R
should be given special consideration over other linker command line
options.  After all if gcc passes -R on to the linker then why doesn't 
it pass -O on to the linker as well ?  [Some linker's do support a -O
option!]


: From: Phil:
: 
: Maybe on those platforms where -R doesn't get passed through, we can
: print a more useful message than `unrecognized option'.  After all, it's
: "recognized" on other platforms.

That is not really a good argument.  Just because an option is
recognized on one platform does not mean that it will be recognized on
another platform, nor does it mean that gcc should be aware of all
potential platforms and issue error messages like

  "option 'foo' not recognized on this platform.  Perhaps you should
  be running this program on platform 'bar' instead ?"


:     3)  I feel that we should recognize and warn about the problem
:         rather than passing it through and exacerbating the
:         misunderstanding. 

Do you mean that gcc should never accept -R, even on a Solaris
targeted toolchain ?  I am not a Solaris user so it would not affect
me, but I can imagine that quite a few users would be upset.  Of
course in the long run it would probably help them, since they would
have to change their makefile to use the correct -Wl, mechanism, and
if they ever migrate to other targets these makefile will continue to
work.

: Linux should perhaps be an exception, since the documentation for ld 
: on Linux states that -Rdir is specifically supported for
: compatibility with sparcs.  Right now it really looks like one hand
: has no idea what the other is doing.  :-)

No no, that is the GNU/Linux linker being compatible with the Solaris
linker, not the GNU/Linus gcc being compatible with the Solaris cc.


Cheers
	Nick


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

* Re: Is this supposed to work, or am I loopy?
  2001-01-08 11:30 Is this supposed to work, or am I loopy? Nick Clifton
@ 2001-01-21 16:13 ` Marc Espie
  0 siblings, 0 replies; 18+ messages in thread
From: Marc Espie @ 2001-01-21 16:13 UTC (permalink / raw)
  To: nickc; +Cc: gcc

In article < 200101081930.LAA11488@elmo.cygnus.com > you write:
>Hi Guys,
>
>: From Joe:
>:
>: What I'm saying is that the difference is gratuitous and is caused
>: by the gcc driver.

>But it is not gratuitous.  The support (by gcc) for -R under some
>OS'es is a convenience but a requirement.  GCC does not gratuitously
>decide to not support -R, it actually provides the completely
>standard, and workable, -Wl,-R option.  Supporting -R is non-standard,
>and is only provided as a nicety to help users who are used to
>Solaris compilers that do the translation of -R to -Wl,-R behind their
>backs.


Err, wow. Now  -Wl,-R is standard.

That's complete news to me.

Especially as the linker may not be gnu ld.

Whereas the gcc driver is supposed to be there to suppress gratuitous
differences.

Is it just me, or is this reasoning backwards ? Namely, trying to 
uniformously support -R at gcc levels for all systems where the linker
can provide the correct semantics (eventually, with differences at what
it passes to the linker), would that not simplify what the user needs
to type and remember.

Taking a gratuitous analogy, you don't expect to have to add -Wa,-k when
you use pic code on some architectures, do you ?

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-08 12:59 Nick Clifton
@ 2001-01-08 15:00 ` Phil Edwards
  0 siblings, 0 replies; 18+ messages in thread
From: Phil Edwards @ 2001-01-08 15:00 UTC (permalink / raw)
  To: Nick Clifton; +Cc: jbuck, dewar, gcc

On Mon, Jan 08, 2001 at 12:59:04PM -0800, Nick Clifton wrote:
> 
> : The driver distributes options to the tools that they are intended
> : to work with, for the most part passing flags through unchanged to
> : the preprocessor (OK, that goes away now for the most part), main
> : compiler, linker, and assembler.  -Wl, is a mechanism that lets
> : anything be passed, including switches that have a conflicting
> : meaning.  For -R there is no conflicting meaning.
> 
> Ok, so the basic complaint is that since no other tool uses the -R
> option the gcc compiler driver ought to be smart enough to known that
> it can pass -R on to the linker, right ?

Yes, pretty much.  With or without an incompatability warning.  (I for one
would have appreciated knowing about -Wl back in my student days, before
I had broken the info(1) program to my will and could read the GCC manual.)


In another message,

> :     3)  I feel that we should recognize and warn about the problem
> :         rather than passing it through and exacerbating the
> :         misunderstanding.
> 
> Do you mean that gcc should never accept -R, even on a Solaris
> targeted toolchain ?

No, I meant that on systems where we /don't/ pass -R, we should warn.


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.

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

* Re: Is this supposed to work, or am I loopy?
@ 2001-01-08 12:59 Nick Clifton
  2001-01-08 15:00 ` Phil Edwards
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Clifton @ 2001-01-08 12:59 UTC (permalink / raw)
  To: jbuck; +Cc: dewar, gcc, pedwards

Hi Joe,

: > Supporting -R is non-standard, and is only provided as a nicety to
: > help users who are used to Solaris compilers that do the
: > translation of -R to -Wl,-R behind their backs.
: 
: "behind their backs"?

Oh alright, that was contentious wording.

: The driver distributes options to the tools that they are intended
: to work with, for the most part passing flags through unchanged to
: the preprocessor (OK, that goes away now for the most part), main
: compiler, linker, and assembler.  -Wl, is a mechanism that lets
: anything be passed, including switches that have a conflicting
: meaning.  For -R there is no conflicting meaning.

Ok, so the basic complaint is that since no other tool uses the -R
option the gcc compiler driver ought to be smart enough to known that
it can pass -R on to the linker, right ?


: If there is a good reason for ld to be compatible from Solaris to Linux,
: then there is the same good reason for gcc to be compatible.  Solaris
: isn't just one oddball platform, this -R behavior is SVR4.  SVR4 linking
: behavior was copied by GNU ld because it was felt to be a good design.
: Since the switch from a.out to ELF, almost every aspect of linking on
: GNU/Linux was copied from Solaris, except one: for some reason I cannot
: fathom, stubbornness on the part of some is blocking us from fixing this
: last incompatibility.
: 
: It is pointous to be half-way compatible.
        ^^^^^^^^

Err maybe you mean "pointless" ?


Anyway I think you have convinced me, so I withdraw any objections to
the patch.  Unfortunately I am not the guy you have to convince :-(

Cheers
	Nick

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 19:32 dewar
  2001-01-06 18:12 ` Joe Buck
@ 2001-01-08  8:22 ` Travis Moulton
  1 sibling, 0 replies; 18+ messages in thread
From: Travis Moulton @ 2001-01-08  8:22 UTC (permalink / raw)
  To: dewar; +Cc: gcc, nickc

> <<In most respects, Linux closely copied the Solaris (or SVR4)
> shared library implementation.  Almost all of the other features are
> exactly the same.  Those of us who've used Sun machines for years
> don't see the reason for gratuitous differences. >>

> Perhaps "those of us who've used Sun machines for years" could
> refrain from immediately labeling as a "bug" anything that does not
> work the same as on the machine you are use to :-)

> Seriously, I think you would get further if you make a well informed
> well reasoned argument for a change.

Us young'uns who started out on LINUX realize that we're right and Sun 
users are wrong ;-).  That aside, gcc is supposed to be platform 
independent.  I consider anything that contradicts that to be bad.  I 
know some people on this list don't like the word bug, but...  If it 
can be fixed without breaking other things left and right, I vote for 
fixing it. 



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

* Re: Is this supposed to work, or am I loopy?
  2001-01-07 16:52 ` Phil Edwards
@ 2001-01-07 17:42   ` Gerald Pfeifer
  0 siblings, 0 replies; 18+ messages in thread
From: Gerald Pfeifer @ 2001-01-07 17:42 UTC (permalink / raw)
  To: Phil Edwards; +Cc: gcc

On Sun, 7 Jan 2001, Phil Edwards wrote:
> Linux should perhaps be an exception, since the documentation for ld
> on Linux states that -Rdir is specifically supported for compatibility
> with sparcs.  Right now it really looks like one hand has no idea what
> the other is doing.  :-)

s#Linux#GNU/Linux#  especially as here we are really taking about the
                    toolchain and not the kernel.
s#sparcs#Solaris#   as this is related to the operating system (which
                    also runs on non-SPARC hardware), not the CPU.

(I've noticed these issues also before, this is not specific to your
message... ;) )

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 10:33 Nick Clifton
  2001-01-05 10:44 ` Phil Edwards
@ 2001-01-07 16:52 ` Phil Edwards
  2001-01-07 17:42   ` Gerald Pfeifer
  1 sibling, 1 reply; 18+ messages in thread
From: Phil Edwards @ 2001-01-07 16:52 UTC (permalink / raw)
  To: Nick Clifton; +Cc: gcc

On Fri, Jan 05, 2001 at 10:33:27AM -0800, Nick Clifton wrote:
> 
> Ah, I see.  I guess it is a trivial thing to fix.  I am not sure if it
> is really important though.  Support for the pass through of -R does
> not appear to be documented and there is an official way of passing
> switches to the linker that does work.  Not my call really.  The patch
> below might make the i386 Linux target consistent with the Sparc
> Solaris target, although there are still plenty of other targets that
> do not support this abbreviation.

Maybe on those platforms where -R doesn't get passed through, we can
print a more useful message than `unrecognized option'.  After all, it's
"recognized" on other platforms.

% gcc -R/some/path ...
gcc: warning: -R doesn't do what you think it does, maybe you wanna take
     a look at -Wl there buddy?
%

I don't feel strongly about it.  After reading this thread and listening
to my users,

    1)  I agree with Joe that the difference is gratuitous,
    2)  I agree with Alexandre that -R isn't as portable as some think,
    3)  I feel that we should recognize and warn about the problem rather
        than passing it through and exacerbating the misunderstanding.

Linux should perhaps be an exception, since the documentation for ld
on Linux states that -Rdir is specifically supported for compatibility
with sparcs.  Right now it really looks like one hand has no idea what
the other is doing.  :-)


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 19:32 dewar
@ 2001-01-06 18:12 ` Joe Buck
  2001-01-08  8:22 ` Travis Moulton
  1 sibling, 0 replies; 18+ messages in thread
From: Joe Buck @ 2001-01-06 18:12 UTC (permalink / raw)
  To: dewar; +Cc: aoliva, gcc, nickc, pedwards

> 
> <<In most respects, Linux closely copied the Solaris (or SVR4) shared library
> implementation.  Almost all of the other features are exactly the same.
> Those of us who've used Sun machines for years don't see the reason for
> gratuitous differences.
> >>
> 
> Seriously, I think you would get further if you make a well informed
> well reasoned argument for a change.

What I'm saying is that the difference is gratuitous and is caused by
the gcc driver.

On both Solaris and Linux, the linker understands the -R switch and
treats it identically.  On Solaris, the gcc driver accepts -R and
passes it through to the linker.  On Linux, the gcc driver rejects -R.
That is, the two OSes would have identical behavior, except that for
some reason gcc decides to treat them differently.  There is no reason
for gcc to impose this difference.

On both Solaris and Linux, the command

gcc -Wl,-Rblah ...

works identically.  However, on Solaris, the -Wl, can be omitted, but not
on Linux.  Why the difference?  It is gratuitous!  It only exists because
of gcc.

Now do you understand what I am saying?


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

* Re: Is this supposed to work, or am I loopy?
@ 2001-01-05 19:32 dewar
  2001-01-06 18:12 ` Joe Buck
  2001-01-08  8:22 ` Travis Moulton
  0 siblings, 2 replies; 18+ messages in thread
From: dewar @ 2001-01-05 19:32 UTC (permalink / raw)
  To: aoliva, jbuck; +Cc: gcc, nickc, pedwards

<<In most respects, Linux closely copied the Solaris (or SVR4) shared library
implementation.  Almost all of the other features are exactly the same.
Those of us who've used Sun machines for years don't see the reason for
gratuitous differences.
>>

Perhaps "those of us who've used Sun machines for years" could refrain
from immediately labeling as a "bug" anything that does not work the
same as on the machine you are use to :-)

Seriously, I think you would get further if you make a well informed
well reasoned argument for a change.

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 11:39   ` Alexandre Oliva
@ 2001-01-05 14:43     ` Joe Buck
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Buck @ 2001-01-05 14:43 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Phil Edwards, Nick Clifton, gcc

> -R is not portable at all.  If one thinks it works under ``everything
> else'', that must be a very narrow definition of ``everything else''.

In most respects, Linux closely copied the Solaris (or SVR4) shared library
implementation.  Almost all of the other features are exactly the same.
Those of us who've used Sun machines for years don't see the reason for
gratuitous differences.

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 10:18 ` Phil Edwards
  2001-01-05 10:37   ` Joe Buck
@ 2001-01-05 11:39   ` Alexandre Oliva
  2001-01-05 14:43     ` Joe Buck
  1 sibling, 1 reply; 18+ messages in thread
From: Alexandre Oliva @ 2001-01-05 11:39 UTC (permalink / raw)
  To: Phil Edwards; +Cc: Nick Clifton, gcc

On Jan  5, 2001, Phil Edwards <pedwards@disaster.jaj.com> wrote:

> A user brought (2) to my attention ("gcc takes -R under everything else,
> gcc doesn't take -R under linux, ergo linux is broken") and I wanted to
> test it with the current sources.

-R is not portable at all.  If one thinks it works under ``everything
else'', that must be a very narrow definition of ``everything else''.
I really appreciate GCC not making it that simple for someone to use
-R, given that (i) it might encourage one to think it's portable and
(ii) hard-coding library search paths in binaries isn't always a good
thing.

If you want something really portable, use libtool's -rpath, which is
as portable as it gets.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 10:37   ` Joe Buck
@ 2001-01-05 11:00     ` Phil Edwards
  0 siblings, 0 replies; 18+ messages in thread
From: Phil Edwards @ 2001-01-05 11:00 UTC (permalink / raw)
  To: Joe Buck; +Cc: Nick Clifton, gcc

On Fri, Jan 05, 2001 at 10:33:44AM -0800, Joe Buck wrote:
> 
> At the risk of annoying Robert Dewar again :-), I think the user is
> correct and this is a bug.  I've long struggled to get -R to work on
> Linux, didn't know I needed to say -Wl, and wound up more that once having
> to become root and messing with ldconfig when this shouldn't have been
> necessary.
> 
> -R should work the same way on all platforms.

I've usually used LD_RUN_PATH and left it up to the linker to figure
out what to do, rather than trusting whatever compiler I'm working with.
That, or use libtool if I'm only working in C.

But the users here aren't keen on either of those solutions.  Can't really
blame them for avoiding the environment variable method, but they just
won't listen to me when I tell them that in my (correct) opinion, the
Autotools are far better than what they're using.  :-)


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 10:33 Nick Clifton
@ 2001-01-05 10:44 ` Phil Edwards
  2001-01-07 16:52 ` Phil Edwards
  1 sibling, 0 replies; 18+ messages in thread
From: Phil Edwards @ 2001-01-05 10:44 UTC (permalink / raw)
  To: Nick Clifton; +Cc: gcc

On Fri, Jan 05, 2001 at 10:33:27AM -0800, Nick Clifton wrote:
> 
> Ah, I see.  I guess it is a trivial thing to fix.  I am not sure if it
> is really important though.  Support for the pass through of -R does
> not appear to be documented and there is an official way of passing
> switches to the linker that does work.  Not my call really.  The patch
> below might make the i386 Linux target consistent with the Sparc
> Solaris target, although there are still plenty of other targets that
> do not support this abbreviation.

That, plus -R<something_that_isn't_a_directory> has an entirely different
meaning under Linux... which I suppose should still be passed through.  :-)

Messing about in the config/<arch> directories always gave me the shivers,
so even if this patch doesn't go in, I'll keep it around for reference
and maybe for local users.  Thanks.


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 10:18 ` Phil Edwards
@ 2001-01-05 10:37   ` Joe Buck
  2001-01-05 11:00     ` Phil Edwards
  2001-01-05 11:39   ` Alexandre Oliva
  1 sibling, 1 reply; 18+ messages in thread
From: Joe Buck @ 2001-01-05 10:37 UTC (permalink / raw)
  To: Phil Edwards; +Cc: Nick Clifton, gcc

> > What's wrong with using -Wl, ?  It is only four more characters to
> > type, and it will then work on all build environments.
> > 
> >    g++ -Wl,-R/home/pme/build/install-2001-01-04/lib huh.cc 

Phil Edwards writes:
> Nothing's *wrong* with it.  Just
> 
>   1)  wanted to make certain I wasn't missing anything obvious, and
>   2)  it seems a bit on the gratuitiously incompatible side.
> 
> A user brought (2) to my attention ("gcc takes -R under everything else,
> gcc doesn't take -R under linux, ergo linux is broken") and I wanted to
> test it with the current sources.

At the risk of annoying Robert Dewar again :-), I think the user is
correct and this is a bug.  I've long struggled to get -R to work on
Linux, didn't know I needed to say -Wl, and wound up more that once having
to become root and messing with ldconfig when this shouldn't have been
necessary.

-R should work the same way on all platforms.

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

* Re: Is this supposed to work, or am I loopy?
@ 2001-01-05 10:33 Nick Clifton
  2001-01-05 10:44 ` Phil Edwards
  2001-01-07 16:52 ` Phil Edwards
  0 siblings, 2 replies; 18+ messages in thread
From: Nick Clifton @ 2001-01-05 10:33 UTC (permalink / raw)
  To: pedwards; +Cc: gcc

Hi Phil,

: > What's wrong with using -Wl, ?  It is only four more characters to
: > type, and it will then work on all build environments.
: > 
: >    g++ -Wl,-R/home/pme/build/install-2001-01-04/lib huh.cc 
: 
: Nothing's *wrong* with it.  Just
: 
:   1)  wanted to make certain I wasn't missing anything obvious, and
:   2)  it seems a bit on the gratuitiously incompatible side.
: 
: A user brought (2) to my attention ("gcc takes -R under everything else,
: gcc doesn't take -R under linux, ergo linux is broken") and I wanted to
: test it with the current sources.

Ah, I see.  I guess it is a trivial thing to fix.  I am not sure if it
is really important though.  Support for the pass through of -R does
not appear to be documented and there is an official way of passing
switches to the linker that does work.  Not my call really.  The patch
below might make the i386 Linux target consistent with the Sparc
Solaris target, although there are still plenty of other targets that
do not support this abbreviation.

Cheers
	Nick


2001-01-05  Nick Clifton  <nickc@redhat.com>

	* config/i386/linux.h (LINK_SPEC): Pass -R on to linker.

Index: config/i386/linux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/linux.h,v
retrieving revision 1.21
diff -p -r1.21 linux.h
*** linux.h	2000/11/02 23:29:10	1.21
--- linux.h	2001/01/05 18:30:05
*************** Boston, MA 02111-1307, USA.  */
*** 125,130 ****
--- 125,131 ----
  #ifdef USE_GNULIBC_1
  #ifndef LINUX_DEFAULT_ELF
  #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+   %{R*} \
    %{!shared: \
      %{!ibcs: \
        %{!static: \
*************** Boston, MA 02111-1307, USA.  */
*** 133,138 ****
--- 134,140 ----
  	%{!rpath:-rpath /lib/elf/}} %{static:-static}}}"
  #else
  #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+   %{R*} \
    %{!shared: \
      %{!ibcs: \
        %{!static: \
*************** Boston, MA 02111-1307, USA.  */
*** 142,147 ****
--- 144,150 ----
  #endif
  #else
  #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+   %{R*} \
    %{!shared: \
      %{!ibcs: \
        %{!static: \

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

* Re: Is this supposed to work, or am I loopy?
  2001-01-05 10:14 Nick Clifton
@ 2001-01-05 10:18 ` Phil Edwards
  2001-01-05 10:37   ` Joe Buck
  2001-01-05 11:39   ` Alexandre Oliva
  0 siblings, 2 replies; 18+ messages in thread
From: Phil Edwards @ 2001-01-05 10:18 UTC (permalink / raw)
  To: Nick Clifton; +Cc: gcc

On Fri, Jan 05, 2001 at 10:14:13AM -0800, Nick Clifton wrote:
> : 
> : Is there nothing supported under Linux other than using a pair of -Wl
> : options?  According to its manual, GNU ld would recognize -Rfoo as a runtime
> : library search path setting when foo is a directory, if the driver weren't
> : killing it first.
> 
> What's wrong with using -Wl, ?  It is only four more characters to
> type, and it will then work on all build environments.
> 
>    g++ -Wl,-R/home/pme/build/install-2001-01-04/lib huh.cc 

Nothing's *wrong* with it.  Just

  1)  wanted to make certain I wasn't missing anything obvious, and
  2)  it seems a bit on the gratuitiously incompatible side.

A user brought (2) to my attention ("gcc takes -R under everything else,
gcc doesn't take -R under linux, ergo linux is broken") and I wanted to
test it with the current sources.


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.

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

* Re: Is this supposed to work, or am I loopy?
@ 2001-01-05 10:14 Nick Clifton
  2001-01-05 10:18 ` Phil Edwards
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Clifton @ 2001-01-05 10:14 UTC (permalink / raw)
  To: pedwards; +Cc: gcc

Hi Phil,

: Under sparc-sun-solaris2.8, we can set the shared library search
: path thusly: 
: 
:     % /stuff/pme/Ebuild/bin/g++ -R/stuff/pme/Ebuild/lib huh.cc
: 
: Under i686-pc-linux-gnu, however (sorry about the long lines):
: 
:     24% /home/pme/build/install-2001-01-04/bin/g++
:           -R/home/pme/build/install-2001-01-04/lib huh.cc 
:     g++: unrecognized option `-R/home/pme/build/install-2001-01-04/lib'
: 
: Is there nothing supported under Linux other than using a pair of -Wl
: options?  According to its manual, GNU ld would recognize -Rfoo as a runtime
: library search path setting when foo is a directory, if the driver weren't
: killing it first.

What's wrong with using -Wl, ?  It is only four more characters to
type, and it will then work on all build environments.

   g++ -Wl,-R/home/pme/build/install-2001-01-04/lib huh.cc 


Cheers
	Nick

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

* Is this supposed to work, or am I loopy?
@ 2001-01-05  9:57 Phil Edwards
  0 siblings, 0 replies; 18+ messages in thread
From: Phil Edwards @ 2001-01-05  9:57 UTC (permalink / raw)
  To: gcc

Under sparc-sun-solaris2.8, we can set the shared library search path thusly:

    % /stuff/pme/Ebuild/bin/g++ -R/stuff/pme/Ebuild/lib huh.cc
    % /stuff/pme/Ebuild/bin/g++ -R /stuff/pme/Ebuild/lib huh.cc
    %

Handy, that.

Under i686-pc-linux-gnu, however (sorry about the long lines):

    24% /home/pme/build/install-2001-01-04/bin/g++ -R/home/pme/build/install-2001-01-04/lib huh.cc
    g++: unrecognized option `-R/home/pme/build/install-2001-01-04/lib'
    25% /home/pme/build/install-2001-01-04/bin/g++ -rpath /home/pme/build/install-2001-01-04/lib huh.cc
    g++: unrecognized option `-rpath'
    /home/pme/build/install-2001-01-04/lib: file not recognized: Is a directory
    collect2: ld returned 1 exit status
    26%

Is there nothing supported under Linux other than using a pair of -Wl
options?  According to its manual, GNU ld would recognize -Rfoo as a runtime
library search path setting when foo is a directory, if the driver weren't
killing it first.



Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.

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

end of thread, other threads:[~2001-01-21 16:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-08 11:30 Is this supposed to work, or am I loopy? Nick Clifton
2001-01-21 16:13 ` Marc Espie
  -- strict thread matches above, loose matches on Subject: below --
2001-01-08 12:59 Nick Clifton
2001-01-08 15:00 ` Phil Edwards
2001-01-05 19:32 dewar
2001-01-06 18:12 ` Joe Buck
2001-01-08  8:22 ` Travis Moulton
2001-01-05 10:33 Nick Clifton
2001-01-05 10:44 ` Phil Edwards
2001-01-07 16:52 ` Phil Edwards
2001-01-07 17:42   ` Gerald Pfeifer
2001-01-05 10:14 Nick Clifton
2001-01-05 10:18 ` Phil Edwards
2001-01-05 10:37   ` Joe Buck
2001-01-05 11:00     ` Phil Edwards
2001-01-05 11:39   ` Alexandre Oliva
2001-01-05 14:43     ` Joe Buck
2001-01-05  9:57 Phil Edwards

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