[Bug ld/21251] Support $SYSROOT in ld -L and INPUT command

2017-03-20 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21251

Nick Clifton  changed:

   What|Removed |Added

 CC||nickc at redhat dot com

--- Comment #1 from Nick Clifton  ---
Created attachment 9924
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9924&action=edit
Proposed patch

Hi Rainer,

  Does this work for you ?

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/21251] Support $SYSROOT in ld -L and INPUT command

2017-05-18 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://sourceware.org/bugzilla/show_bug.cgi?id=21251

--- Comment #2 from Rainer Orth  ---
Hi Nick,

sorry for the very long delay in replying ;-(

Yes, works like a charm, thanks.

Btw., do you have any idea how widespread the use of '=' for the sysroot
prefix is?  It's kinda hard to search for -L = ...  I've only noticed it
very recently.  There's work going on to implement --sysroot in Solaris
ld, and the question poses itself if there's much point in supporting
the '=' form or just going for $SYSROOT here.

Besides, while were at --sysroot, did you have a chance to have a look
at PR ld/21250.

Thanks a lot.

Rainer

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/21251] Support $SYSROOT in ld -L and INPUT command

2017-05-18 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21251

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3aa2d05a728216bbb99dbb5718be9bb36429cf41

commit 3aa2d05a728216bbb99dbb5718be9bb36429cf41
Author: Nick Clifton 
Date:   Thu May 18 15:07:59 2017 +0100

Treat a prefix of "$SYSROOT" in the same way as "=" when parsing linker
search paths.

PR ld/21251
* ldfile.c (ldfile_add_library_path): If the path starts with
$SYSROOT then use the sysroot as the real prefix.
* ldlang.c (lang_add_input_file): Treat $SYSROOT in the same
way as =.
* ldlex.l: Add $SYSROOT as allow prefix for a filename.
* ld.texinfo (-L): Document that $SYSROOT acts like = when
prefixing a library search path.
(INPUT): Likewise.
* testsuite/ld-scripts/sysroot-prefix.exp: Add $SYSROOT prefix
tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/21251] Support $SYSROOT in ld -L and INPUT command

2017-05-18 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21251

Nick Clifton  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Nick Clifton  ---
(In reply to Rainer Orth from comment #2)

Hi Rainer,

> Yes, works like a charm, thanks.

Great - I have checked the patch in.

> Btw., do you have any idea how widespread the use of '=' for the sysroot
> prefix is?

Hmm, I was going to say not a lot, but then I remembered that GCC uses it:

  https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html

So maybe it is more widespread than we realise.

> Besides, while were at --sysroot, did you have a chance to have a look
> at PR ld/21250.

I looked at it, shuddered, and looked away. :-}  I suspect that that PR
will turn out to be a can of worms, so I was going to treat it as low 
priority unless other people notice and complain too.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/21251] Support $SYSROOT in ld -L and INPUT command

2017-05-23 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://sourceware.org/bugzilla/show_bug.cgi?id=21251

--- Comment #5 from Rainer Orth  ---
Hi Nick,

> Great - I have checked the patch in.

excellent, thanks.

>> Btw., do you have any idea how widespread the use of '=' for the sysroot
>> prefix is?
>
> Hmm, I was going to say not a lot, but then I remembered that GCC uses it:
>
>   https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html

Maybe I'm blind, but where did you see that?  I've also looked at GCC
mainline invoke.text and found nothing, neither with -L nor anywhere
sysroot is described.

I'd have been surprised to find pure linker option descriptions repeated
in the GCC manual, so I didn't even think to look.

> So maybe it is more widespread than we realise.

Which would be a pity ;-)

>> Besides, while were at --sysroot, did you have a chance to have a look
>> at PR ld/21250.
>
> I looked at it, shuddered, and looked away. :-}  I suspect that that PR
> will turn out to be a can of worms, so I was going to treat it as low 
> priority unless other people notice and complain too.

Understood.  It took me completely off guard since gcc's --sysroot
support works just the way I expected (no headers found outside of the
sysroot prefix), while gld may behave otherwise.  This is particularly
ugly if you're cross-linking for say a different OS version where the
native libraries do work, but may contain more (or less) functions than
desired for the target OS version.  In a real cross environment, where
host and target differ, you will get an error instead of links
succeeding silently when they shouldn't...

Rainer

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/21251] Support $SYSROOT in ld -L and INPUT command

2017-05-24 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21251

--- Comment #6 from Nick Clifton  ---
Hi Rainer,

>> Hmm, I was going to say not a lot, but then I remembered that GCC uses it:
>>
>>https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
> 
> Maybe I'm blind, but where did you see that?

Umm, do you mean "where in that web page do I see an '=' prefix being used
to indicate that a sysroot should be used ?"  Then, right at the start:

  -idirafter dir

  Add the directory dir to the list of directories to be searched 
  for header files during preprocessing. If dir begins with  ‘=’, 
  then the ‘=’ is replaced by the sysroot prefix; see --sysroot and -isysroot. 

If you mean, "where does this information come from ?"  The have a look in
gcc/doc/cppdiropts.texi.


> I'd have been surprised to find pure linker option descriptions repeated
> in the GCC manual, so I didn't even think to look.

Well to be honest it is talking about the c-preprocessor include path options
rather than the linker search path, but I think that it establishes a principle
which users will expect to be followed.  IE if include paths can use a '='
prefix
then library search paths should be able to as well.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/21251] Support $SYSROOT in ld -L and INPUT command

2017-05-31 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://sourceware.org/bugzilla/show_bug.cgi?id=21251

--- Comment #7 from Rainer Orth  ---
> --- Comment #6 from Nick Clifton  ---
Hi Nick,

>>> Hmm, I was going to say not a lot, but then I remembered that GCC uses it:
>>>
>>>https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
>> 
>> Maybe I'm blind, but where did you see that?
>
> Umm, do you mean "where in that web page do I see an '=' prefix being used
> to indicate that a sysroot should be used ?"  Then, right at the start:
>
>   -idirafter dir
>
>   Add the directory dir to the list of directories to be searched 
>   for header files during preprocessing. If dir begins with  ‘=’, 
>   then the ‘=’ is replaced by the sysroot prefix; see --sysroot and 
> -isysroot. 

ah, silly me, I just thought to look at -L and friends.

>> I'd have been surprised to find pure linker option descriptions repeated
>> in the GCC manual, so I didn't even think to look.
>
> Well to be honest it is talking about the c-preprocessor include path options
> rather than the linker search path, but I think that it establishes a 
> principle
> which users will expect to be followed.  IE if include paths can use a '='
> prefix
> then library search paths should be able to as well.

Indeed, everything else would be just confusing.  This pretty much rules
out deprecating '=' in either gld or gcc, obviously.

I'll look into supporting $SYSROOT in gcc for symmetry, but that's about it.

Thanks for your patience ;-)

Rainer

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: [Bug ld/21251] Support $SYSROOT in ld -L and INPUT command

2017-05-24 Thread Nick Clifton
Hi Rainer,

>> Hmm, I was going to say not a lot, but then I remembered that GCC uses it:
>>
>>https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
> 
> Maybe I'm blind, but where did you see that?

Umm, do you mean "where in that web page do I see an '=' prefix being used
to indicate that a sysroot should be used ?"  Then, right at the start:

  -idirafter dir

  Add the directory dir to the list of directories to be searched 
  for header files during preprocessing. If dir begins with  ‘=’, 
  then the ‘=’ is replaced by the sysroot prefix; see --sysroot and -isysroot. 

If you mean, "where does this information come from ?"  The have a look in
gcc/doc/cppdiropts.texi.


> I'd have been surprised to find pure linker option descriptions repeated
> in the GCC manual, so I didn't even think to look.

Well to be honest it is talking about the c-preprocessor include path options
rather than the linker search path, but I think that it establishes a principle
which users will expect to be followed.  IE if include paths can use a '=' 
prefix
then library search paths should be able to as well.

Cheers
  Nick

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils