avrgcc: bake path to avr-ar into avr-gcc-ar #33762
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(tl;dr: this fixes a bug in
avrgcc
that's present in master and in the current release)gcc
provides wrappers forbinutils
'ar
,nm
andranlib
executables, which must be used instead when using link-time
optimisation. See also:
http://manpages.ubuntu.com/manpages/zesty/man1/aarch64-linux-gnu-gcc-ar-5.1.html
The upstream version of
avr-gcc-ar
searches in paths passed tothe
configure
script for theavr-ar
binary that it wraps, fallingback to searching
PATH
instead. Thus currentlyavr-gcc-ar
works onNix, but only if
avrbinutils
is already in the environment.This change bakes the path to
avr-ar
intoavr-gcc-ar
, since its pathis known at compile time. It also no longer searches
PATH
, meaning theuser's local environment won't override this path.
Note that
avr-gcc-nm
andavr-gcc-ranlib
are compiled from the samesource file as
avr-gcc-ar
, just with different compiler flags.Testing on master (without
avrbinutils
in the environment):Testing on branch with this fix:
Motivation for this change
avr-gcc-ar
shouldn't require any particular package to be present in the user's environment when it is run.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)cc package maintainer @mguentner