RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

makefiles/feature_precheck: check libc availability prior deciding usage

Open kfessel opened this issue 4 years ago • 9 comments

Contribution description

Add a feature pre-check for picolibc and newlibc into the make process

Testing procedure

make things with either having or not having picolibc or newlib installed

Issues/PRs references

Fixes #15325

@maribu , @nmeum , @benpicco : might what to have a look at it

kfessel avatar Feb 12 '21 12:02 kfessel

NACK, didn't look at the other changes yet, but I'm against moving the include order.

@kfessel can you explain the reasoning for this change better?

fjmolinas avatar Feb 12 '21 13:02 fjmolinas

will rebase to solve for conflicting change in master

kfessel avatar Feb 23 '21 16:02 kfessel

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

stale[bot] avatar Mar 02 '22 13:03 stale[bot]

So this can be used to opportunistically enable picolibc and fall back to newlib if it's not installed?

benpicco avatar Mar 02 '22 15:03 benpicco

So this can be used to opportunistically enable picolibc and fall back to newlib if it's not installed?

yes this was the intention

the stall:bot is digging deep :nice:

without picolibc-arm... on the system:

examples/gnrc_minimal$ BOARD=nucleo-f767zi make
Building application "gnrc_minimal" for "nucleo-f767zi" with MCU "stm32".

picolibc was selected to be build but no picolibc.spec could be found
you might want to install picolibc for arm-none-eabi
or add FEATURES_BLACKLIST += picolibc to Makefile)
check your installation or build configuration.
make: *** [../RIOT-master/makefiles/libc/picolibc.mk:21: _missing-picolibc] Error 1

since #16008 got merged is at least failing loud providing a kinda fix

with this PR it would just fallback to use newlibc

kfessel avatar Mar 02 '22 17:03 kfessel

Can you give it a rebase?

benpicco avatar Mar 02 '22 17:03 benpicco

My change requests still stand here.

fjmolinas avatar Mar 02 '22 20:03 fjmolinas

Thinking about this again I'm still against it, if we change to have picolibc enabled by default then picolibc would become a dependency of RIOT, we don't blacklist native because libcan is not there, either install it or don't use it.

If we move to picolibc as default then what we can do is check if it's installed and if not add a warning that it should be installed or FEATURES_REQUIRED += newlib added to their application Makefile or RIOT_MAKEFILES_GLOBAL_PRE. If you don't want to install everything there is always the docker path.

Features so far are all declarative, I do not see the need to change because of picolibc, neither do I think its a good idea.

fjmolinas avatar Mar 02 '22 20:03 fjmolinas

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 05:09 stale[bot]