I did not mean to propose to create extra levels for stack-auto. Just to separate the target from the rest. We could choose to name the default lib for mos6502, pdk15 and s08 fixed to distinguish from stack-auto. I could even imagine the mcs51 libs renamed to small-fixed instead of simply small, etc. For stm8 it seems logical to choose medium for the default.
Additional context — how this investigation started This investigation originated while examining SDCC issue [#3113], which concerns Z80 assembler handling of complex symbol expressions and relocation. During that work, I tested different SDCC revisions and examined the interaction between the assembler-generated .rel files and ASlink. This led me to inspect the linker sources more closely, including the AR library reader in sdas/linksrc/lkar.c. While reviewing that code, I noticed several potentially...
AFAIK lkar.c and lkar.h do not come from ASxxxx, but were created by Borut in [r5336]. He probably kept the copyright from Alan Baldwin because it contains code that originates in some other ASxxxx source file. The files belong to SDCC, but could be upstreamed if Alan is willing to accept them. The same goes for ranlib.
Thanks for the good work. But I do wonder if we should take another step and create a bit more hierarchy. The library currently mixes target and model in the directory names. I would suggest to use target/models instead for every target with at least two models. Many targets, like mos6502 and stm8, would need a new default model name, e.g. fixed, small, default, base, lib, ... ds390 ds400 ez80 f8 f8l hc08 mcs51/ huge large large-stack-auto medium small small-stack-auto mos6502/ <default> stack-auto...
* device/lib/mcs51-medium/config.inc: fix .optsdcc
* device/lib/free.c,
* device/lib/mcs51-medium/config.inc: fix .optsdcc
Looks good to me.