Summary
Please consider adding a way to configure archive (ar) flags for projects using output-format: lib.
At the moment, the ARM GCC model appears to route output-format: lib to the linker-lib tool, whose command template is fixed as:
"linker-lib": {
"$path": "bin/${toolPrefix}ar",
"$output": "-rcv ${out} ${in}",
"$outputSuffix": ".a"
}
Because this command is model-defined, the existing Linker UI fields such as "Other Linker Options" / "Lib Flags" do not seem to provide a way to pass archive-specific flags such as GNU ar's D modifier.
Use case: reproducible library builds
For GNU ar, deterministic archives can be produced with D, for example:
arm-none-eabi-ar rcvD libfoo.a foo.o bar.o
# or rcsD if the symbol index should be created in the same step
Without D, repeated clean rebuilds of the same library project can produce .a files with different SHA-256 values, even when the object files themselves are unchanged. arm-none-eabi-ar tv shows archive member timestamps being set to the current build time.
This makes it difficult to use artifact SHA-256 values as provenance/reproducibility checks in CI.
Reproduction outline
- Create or open an ARM GCC project.
- Set Linker -> Output Format to
LIB.
- Rebuild the project twice from unchanged source.
- Compare the SHA-256 of the generated
.a file.
- Inspect the archive metadata:
arm-none-eabi-ar tv build/<target>/*.a
Observed behavior: archive member timestamps change between rebuilds, so the .a SHA changes. Individual .o files remain stable.
Suggested behavior
A project-level option for archive flags would make this configurable without changing behavior for existing users. For example:
- Add an "Archive Flags" / "AR Flags" option for
output-format: lib.
- Keep the current default compatible with existing behavior, e.g.
-rcv.
- Allow users to set
-rcvD or -rcsD for deterministic archives.
Another possible approach is to make the linker-lib.$output template overridable per project/toolchain configuration.
Environment where this was observed
- EIDE: 3.27.0
- Toolchain: xPack GNU Arm Embedded GCC 15.2.1
- GNU ar / binutils: 2.45.1
- Platform: Windows
Thanks.
Summary
Please consider adding a way to configure archive (
ar) flags for projects usingoutput-format: lib.At the moment, the ARM GCC model appears to route
output-format: libto thelinker-libtool, whose command template is fixed as:Because this command is model-defined, the existing Linker UI fields such as "Other Linker Options" / "Lib Flags" do not seem to provide a way to pass archive-specific flags such as GNU
ar'sDmodifier.Use case: reproducible library builds
For GNU
ar, deterministic archives can be produced withD, for example:arm-none-eabi-ar rcvD libfoo.a foo.o bar.o # or rcsD if the symbol index should be created in the same stepWithout
D, repeated clean rebuilds of the same library project can produce.afiles with different SHA-256 values, even when the object files themselves are unchanged.arm-none-eabi-ar tvshows archive member timestamps being set to the current build time.This makes it difficult to use artifact SHA-256 values as provenance/reproducibility checks in CI.
Reproduction outline
LIB..afile.Observed behavior: archive member timestamps change between rebuilds, so the
.aSHA changes. Individual.ofiles remain stable.Suggested behavior
A project-level option for archive flags would make this configurable without changing behavior for existing users. For example:
output-format: lib.-rcv.-rcvDor-rcsDfor deterministic archives.Another possible approach is to make the
linker-lib.$outputtemplate overridable per project/toolchain configuration.Environment where this was observed
Thanks.