[PATCH v1 0/3 CHIP: Support vendor script libraries
Ulf Samuelsson
binutils@emagii.com
Wed Mar 15 20:03:18 GMT 2023
On 2023-03-15 17:27, Michael Matz wrote:
> Hello,
>
> On Tue, 14 Mar 2023, Ulf Samuelsson via Binutils wrote:
>
>> Introduce the CHIP command for non-MRI script files.
>>
>> The motivation is that you want to simplify supporting microcontrollers.
>> You want include files that define the addresses for all peripherals
>> and the memory/bank organisation.
> Makes sense, but why is it not enough to use "INCLUDE(<chip>.inc)" in the
> linker script and passing -L$LD_VENDOR_DIR/<chip> on the linker command
> line?
Because it is a poor user interface.
You have to pass
-L$PROJ_DIR/<chip>
-L$LD_USER_DIR/<chip>
-L$LD_VENDOR_DIR/<chip>
to the linker every time you link, and since most user would link with GCC
you would have to make it more complex since you
have to pass these things the linker through gcc.
so your suggestion is a lot more verbose.
I want to do
arm-none-gcc myapp.c
and be done with it (assuming gcc will find the right linker script).
Why program in C, when you can program in assembler?
> The hardcoding of environment variables seems very specific, especially
> for the unsuffixed PROJ_DIR (which definitely looks more like something
> for the build system to add). So, if you really want to avoid cmdline
> additions, maybe introducing a way to specify envvar names for the
> SEARCH_DIR directive would be better?
Right now, the LD_USER_DIR and LD_VENDOR_DIR are the important ones
I think in the end, it might be better to specify the PROJ_DIR during
./configure
but that can come later.
The other two should be fixed *as is* to avoid a mess.
People that want to use the feature should adopt their build. It is not
difficult.
You do not want TI to have LD_TI_DIR and NXP using LD_NXP_DIR for the
same thing.
>
> Like
>
> SEARCH_DIR($LD_VENDOR_DIR/at91sam7s64)
> INCLUDE(at91sam7s64.inc)
It is:
SEARCH_DIR($PROJ_DIR/at91sam7s64)
SEARCH_DIR($LD_USER_DIR/at91sam7s64)
SEARCH_DIR($LD_VENDOR_DIR/at91sam7s64)
INCLUDE(at91sam7s64.inc)
CHIP "at91sam7s64" is much better.
I plan to change it to add the vendor
CHIP atmel, at91sam7s64
This means that different companies can settle on LD_VENDOR_DIR
and install in LD_VENDOR_DIR/<vendor>/<chip>/<chip>.<ext>
Plan to change <ext> from ".inc" to ".chp"
The CHIP command also allow things to change, if needed.
>
> Support for envvars in SEARCH_DIR (and possibly INCLUDE as well) would
> seem somewhat useful in its own right I think. (Yes, it would conflict
> with potential current use of '$' as a starter for a filename
> component, in which case quoting can be used to disambiguate).
>
>
> Ciao,
> Michael.
Best Regards
Ulf Samuelsson
More information about the Binutils
mailing list