[ELF] implement -Y flag#652
Conversation
|
I think we should just handle it as an unknown flag to let people to stop using this old command line flag, if any. |
|
As you wish, thanks for the quick reply. I'm fine maintaining this patch in my tree as I need it, feel free to close the PR. |
|
What program do you need the |
|
Not a specific program, I use it when cross compiling root filesystems for embedded targets. The standard way of doing this is:
But to avoid copying the toolchain you can do (with ld.bfd):
Using |
bf2c440 to
df9e997
Compare
cc86039 to
25d02bb
Compare
|
|
||
| ctx.arg.library_paths.insert(ctx.arg.library_paths.end(), | ||
| default_library_paths.begin(), | ||
| default_library_paths.end()); |
There was a problem hiding this comment.
I'm not fully getting what is difference between -Y and -L options -- at the end, we are just concatenating them.
There was a problem hiding this comment.
Same difference as -isystem and -I, one prepends while the other appends. It's important because build systems usually append your global CFLAGS to the package CFLAGS, so as a distribution or embedded system maintainer, you need a reliable way to know how the system includes will be used. Using a sysroot is sometimes to much of a constraint (because you need to merge the toolchain and the staging rootfs build).
There was a problem hiding this comment.
Oh, I see now. It does make sense, thanks.
Please consider supporting the -Y flag, which is supported by the bfd linker (but not gold):
While this is a compatibility option in bfd, it is still very useful when you want to share a cross-toolchain to build binaries and libraries for different targets, without having to copy the full toolchain to their staging dir and using the --sysroot option.