* sysroot and softlinks
@ 2015-11-04 14:56 Paul_Koning
2015-11-04 15:15 ` Andreas Schwab
0 siblings, 1 reply; 5+ messages in thread
From: Paul_Koning @ 2015-11-04 14:56 UTC (permalink / raw)
To: gdb
I have a cross-build setup where the target file system image is built into some directory tree, which means that the base of that tree is the value to be used in "set sysroot".
For the most part that works. But I have a reference to a file (shared library or the like) which is actually a softlink, and the link target is an absolute path. That absolute path is valid in the target system, but not in the sysroot subtree.
Changing that softlink to a relative link would cure the problem, of course, but I don't really want to mess with the system build; for one thing, that wouldn't help with previously built images.
The other solution would be for solid_find to test for this case: check if the name is a softlink and if so, whether its target is absolute. If yes, prefix sysroot onto the target and repeat.
Does that change make sense?
paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sysroot and softlinks
2015-11-04 14:56 sysroot and softlinks Paul_Koning
@ 2015-11-04 15:15 ` Andreas Schwab
2015-11-04 15:58 ` Paul_Koning
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2015-11-04 15:15 UTC (permalink / raw)
To: Paul_Koning; +Cc: gdb
<Paul_Koning@Dell.com> writes:
> The other solution would be for solid_find to test for this case: check if
> the name is a softlink and if so, whether its target is absolute. If yes,
> prefix sysroot onto the target and repeat.
How would you mark symlinks that are supposed to be relative to the host
root?
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sysroot and softlinks
2015-11-04 15:15 ` Andreas Schwab
@ 2015-11-04 15:58 ` Paul_Koning
2015-11-04 16:48 ` Jan Kratochvil
0 siblings, 1 reply; 5+ messages in thread
From: Paul_Koning @ 2015-11-04 15:58 UTC (permalink / raw)
To: schwab; +Cc: gdb
> On Nov 4, 2015, at 10:15 AM, Andreas Schwab <schwab@suse.de> wrote:
>
> <Paul_Koning@Dell.com> writes:
>
>> The other solution would be for solid_find to test for this case: check if
>> the name is a softlink and if so, whether its target is absolute. If yes,
>> prefix sysroot onto the target and repeat.
>
> How would you mark symlinks that are supposed to be relative to the host
> root?
One possible answer is not to handle that case. Another possibility is to try that if the sysroot-prefixed version doesn't work.
The reason for trying sysroot first is that the name on the host may in fact work, but may be the wrong file (different OS or different machine architecture).
paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sysroot and softlinks
2015-11-04 15:58 ` Paul_Koning
@ 2015-11-04 16:48 ` Jan Kratochvil
2015-11-04 16:57 ` Paul_Koning
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kratochvil @ 2015-11-04 16:48 UTC (permalink / raw)
To: Paul_Koning; +Cc: schwab, gdb
On Wed, 04 Nov 2015 16:58:07 +0100, Paul_Koning@Dell.com wrote:
> One possible answer is not to handle that case. Another possibility is to
> try that if the sysroot-prefixed version doesn't work.
With build-ids (pending patchset "Validate binary before use") it should be
safe to try both.
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sysroot and softlinks
2015-11-04 16:48 ` Jan Kratochvil
@ 2015-11-04 16:57 ` Paul_Koning
0 siblings, 0 replies; 5+ messages in thread
From: Paul_Koning @ 2015-11-04 16:57 UTC (permalink / raw)
To: jan.kratochvil; +Cc: schwab, gdb
> On Nov 4, 2015, at 11:48 AM, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
>
> On Wed, 04 Nov 2015 16:58:07 +0100, Paul_Koning@Dell.com wrote:
>> One possible answer is not to handle that case. Another possibility is to
>> try that if the sysroot-prefixed version doesn't work.
>
> With build-ids (pending patchset "Validate binary before use") it should be
> safe to try both.
Thanks Jan.
It sounds like this is a useful change. I'll take a look to see if I can construct it, if yes I'll propose the patch.
paul
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-11-04 16:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-04 14:56 sysroot and softlinks Paul_Koning
2015-11-04 15:15 ` Andreas Schwab
2015-11-04 15:58 ` Paul_Koning
2015-11-04 16:48 ` Jan Kratochvil
2015-11-04 16:57 ` Paul_Koning
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox