[v2,2/2] ld: write full paths to dependency-file
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Testing passed
|
Commit Message
When relative paths are written to the dependency-file it forces the
users of it to run from the same directory.
To avoid this only write absolute paths.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
ld/ldmain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 16.09.2023 12:36, Thomas Weißschuh wrote:
> When relative paths are written to the dependency-file it forces the
> users of it to run from the same directory.
> To avoid this only write absolute paths.
Using relative paths, otoh, may allow to move build trees around. First and
foremost the two behaviors may relevant when (not) building in the source
tree itself. Furthermore the compiler, gcc at least, looks to also write
relative paths when relative paths were given.
Jan
On 2023-09-18 15:38:21+0200, Jan Beulich wrote:
> On 16.09.2023 12:36, Thomas Weißschuh wrote:
> > When relative paths are written to the dependency-file it forces the
> > users of it to run from the same directory.
> > To avoid this only write absolute paths.
>
> Using relative paths, otoh, may allow to move build trees around. First and
> foremost the two behaviors may relevant when (not) building in the source
> tree itself. Furthermore the compiler, gcc at least, looks to also write
> relative paths when relative paths were given.
Fair enough. Let's drop this patch then.
Thomas
@@ -174,7 +174,7 @@ track_dependency_files (const char *filename)
{
struct dependency_file *dep
= (struct dependency_file *) xmalloc (sizeof (*dep));
- dep->name = xstrdup (filename);
+ dep->name = lrealpath (filename);
dep->next = NULL;
if (dependency_files == NULL)
dependency_files = dep;