PATCH: --sysroot-suffix

Mark Mitchell mark@codesourcery.com
Mon Jan 17 04:04:00 GMT 2005


Daniel Jacobowitz wrote:

> Would a --sysroot option work for you instead?  I can't think of any
> realistic configurations where GCC and LD would have different
> sysroots, so passing it down from gcc makes some sense.

I thought about this, but it seemed more complicated.

To do what you suggest, I would have to make more invasive changes to 
the GCC driver.  Because the driver can't assume that binutils supports 
the new option, I was just modifying the linker spec for the target in 
question.  (That target also defines SYSROOT_SUFFIX_SPEC.)  I don't know 
of a way for a spec to request that the driver substitute in the current 
sysroot.

In summary, to do what you're suggesting, the way this would work would be:

1) Modify the linker to support --sysroot.  This would be along the 
lines of my current patch, except that it would smply override the 
calculated sysroot.

2) Modify the GCC driver to support a new spec substitution character, 
like "%r".

3) Modify the GCC target in question to use "%r" appropriately in the 
link spec, so as to append the right suffix.

I'm willing to do that if the binutils people will pre-approve that 
approach in concept and prefer it to my current patch.  However, I'm not 
sure I see a major advantage.  My current patch will work for the Darwin 
folks too, so far as I can tell; they would just provide a relative path 
from the configured binutils sysroot to the actual location of the 
sysroot they want the linker to use.

Thanks,

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Binutils mailing list