Skip to content

cpu/cortexm: cleanup dependencies#13738

Merged
fjmolinas merged 2 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/cpu/cortexm/cleanup_dependencies
Apr 1, 2020
Merged

cpu/cortexm: cleanup dependencies#13738
fjmolinas merged 2 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/cpu/cortexm/cleanup_dependencies

Conversation

@leandrolanzieri
Copy link
Contributor

Contribution description

This PR does some cleanup of dependencies that were added/resolved in cortexm.inc.mk. I added a architecture-specific Makefile.dep which is included by CPUs.

It also changes the way CFLAGS_FPU is handled, so we can now define cortexm_fpu as a default module on architectures that support it.

Testing procedure

  • Check that dependency resolution still yields the same list of modules and CFLAGS

  • Check that FPU is handled correctly: Test with cortex-m7 (e.g. nucleo-f746zg), cortex-m4f (e.g. nucleo-l452re) and some architecture that provides no FPU (e.g. samr21-xpro):

    • If FPU is supported, the feature cortexm_fpu should be there
    • If FPU is supported -mfloat-abi=hard and the correspondent -mfpu (depending on the architecture) should be present.
    • If FPU is supported it should be possible to disable it by adding DISABLE_MODULE=cortexm_fpu.
    • If FPU is not supported (or disabled) mfloat-abi=soft should be present.

Issues/PRs references

Part of #9913

@leandrolanzieri leandrolanzieri added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: build system Area: Build system Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation labels Mar 27, 2020
@aabadie
Copy link
Contributor

aabadie commented Mar 27, 2020

Are you aware of #13236 ? (might not be better than this one though but could have been reviewed first...)

@leandrolanzieri
Copy link
Contributor Author

Are you aware of #13236 ?

Yes! I read your comment where you state that the approach of turning cortexm_fpu (only) a feature had the side-effect of having to enable it explicitly. Did I understand this correctly?

Here I'm using both a feature and a module, and the conditional expansion approach to set the CFLAGS.

@aabadie
Copy link
Contributor

aabadie commented Mar 27, 2020

Yes! I read your comment where you state that the approach of turning cortexm_fpu (only) a feature had the side-effect of having to enable it explicitly. Did I understand this correctly?

So why not mentioning it in this PR comment ? Why not reviewing it in the first place ?

I'm using both a feature and a module, and the conditional expansion approach to set the CFLAGS.

Exactly what I had in mind in #13236. Just didn't have time to do it...

@leandrolanzieri
Copy link
Contributor Author

Exactly what I had in mind in #13236. Just didn't have time to do it...

Ok, then let's go with #13236

@aabadie
Copy link
Contributor

aabadie commented Mar 27, 2020

let's go with #13236

No, let's keep this one. It does what I wanted to do. Why doing again there what is already done here ?

@aabadie
Copy link
Contributor

aabadie commented Mar 27, 2020

For the next times, just ask before rushing ;)

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes make sense and look good, some testing:

toolchain=llvm BOARD=nucleo-f767zi make -C examples/hello-world/ info-debug-variable-CFLAGS_FPU --no-print-directory
-mfloat-abi=hard -mfpu=fpv5-sp-d16

TOOLCHAIN=llvm BOARD=nucleo-f767zi make -C examples/hello-world/ info-debug-variable-CFLAGS_FPU --no-print-directory
#empty

DISABLE_MODULE=cortexm_fpu BOARD=nucleo-f767zi make -C examples/hello-world/ info-debug-variable-CFLAGS_FPU --no-print-directory
-mfloat-abi=soft

@fjmolinas
Copy link
Contributor

Lets give murdock a run.

@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 31, 2020
@fjmolinas
Copy link
Contributor

I I think this one will need giving save_all_dependencies a run as well.

@fjmolinas fjmolinas self-assigned this Mar 31, 2020
@leandrolanzieri
Copy link
Contributor Author

I I think this one will need giving save_all_dependencies a run as well.

On it...

@fjmolinas
Copy link
Contributor

No failed builds, so lets just wait for the script output!

@leandrolanzieri
Copy link
Contributor Author

@fjmolinas I could not create a gist with the diff. I uploaded it here. For what I can see, the differences are the new feature that now appears on the list, and the module showing up in the DEFAULT_MODULE list.

@fjmolinas
Copy link
Contributor

@fjmolinas I could not create a gist with the diff. I uploaded it here. For what I can see, the differences are the new feature that now appears on the list, and the module showing up in the DEFAULT_MODULE list.

Yes I agree! Seem that its all good!

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, good changes, dependencies haven't changed and murdock is happy. Please squash @leandrolanzieri!

This moves the following modules to a architecture-specific Makefile.dep
file:
- cortexm_common
- cortexm_common_periph
- newlib
- newlib_nano
- periph
This adds cortexm_fpu to the DEFAULT_MODULE list when the feature
cortexm_fpu is provided by the architecture. It also moves the
dependency resolution of this module to the architecture-specific
Makefile.dep file.
@leandrolanzieri leandrolanzieri force-pushed the pr/cpu/cortexm/cleanup_dependencies branch from 7b2ced0 to ea2f963 Compare April 1, 2020 07:56
@leandrolanzieri leandrolanzieri added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 1, 2020
@fjmolinas
Copy link
Contributor

All green go!

@fjmolinas fjmolinas merged commit 736837d into RIOT-OS:master Apr 1, 2020
@leandrolanzieri leandrolanzieri deleted the pr/cpu/cortexm/cleanup_dependencies branch April 1, 2020 11:11
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Apr 3, 2020
@fjmolinas
Copy link
Contributor

Seem something here affected the output of info-boards-supported:

  • PR
make -C examples/hello-world info-boards-supported --no-print-directory | grep sodaq
# empty
  • Before PR
make -C examples/hello-world info-boards-supported --no-print-directory | grep sodaq
acd52832 airfy-beacon arduino-due arduino-duemilanove arduino-leonardo arduino-mega2560 arduino-mkrfox1200 arduino-mkrwan1300 arduino-mkrzero arduino-uno arduino-zero atmega1284p atmega256rfr2-xpro atmega328p avr-rss2 avsextrem b-l072z-lrwan1 b-l475e-iot01a blackpill blackpill-128kib bluepill bluepill-128kib calliope-mini cc1312-launchpad cc1352-launchpad cc2538dk cc2650-launchpad cc2650stk chronos derfmega128 derfmega256 ek-lm4f120xl esp32-heltec-lora32-v2 esp32-mh-et-live-minikit esp32-olimex-evb esp32-ttgo-t-beam esp32-wemos-lolin-d32-pro esp32-wroom-32 esp32-wrover-kit esp8266-esp-12x esp8266-olimex-mod esp8266-sparkfun-thing f4vi1 feather-nrf52840 fox frdm-k22f frdm-k64f frdm-kw41z hamilton hifive1 hifive1b i-nucleo-lrwan1 ikea-tradfri im880b iotlab-a8-m3 iotlab-m3 limifrog-v1 lobaro-lorabox lsn50 maple-mini mbed_lpc1768 mcb2388 mega-xplained microbit microduino-corerf msb-430 msb-430h msba2 msbiot mulle native nrf51dk nrf51dongle nrf52832-mdk nrf52840-mdk nrf52840dk nrf52dk nrf6310 nucleo-f030r8 nucleo-f031k6 nucleo-f042k6 nucleo-f070rb nucleo-f072rb nucleo-f091rc nucleo-f103rb nucleo-f207zg nucleo-f302r8 nucleo-f303k8 nucleo-f303re nucleo-f303ze nucleo-f334r8 nucleo-f401re nucleo-f410rb nucleo-f411re nucleo-f412zg nucleo-f413zh nucleo-f429zi nucleo-f446re nucleo-f446ze nucleo-f722ze nucleo-f746zg nucleo-f767zi nucleo-l031k6 nucleo-l053r8 nucleo-l073rz nucleo-l152re nucleo-l412kb nucleo-l432kc nucleo-l433rc nucleo-l452re nucleo-l476rg nucleo-l496zg nucleo-l4r5zi nz32-sc151 olimexino-stm32 opencm904 openlabs-kw41z-mini openlabs-kw41z-mini-256kib openmote-b openmote-cc2538 p-l496g-cell02 p-nucleo-wb55 particle-argon particle-boron particle-xenon pba-d-01-kw2x phynode-kw41z pic32-clicker pic32-wifire pinetime pyboard reel remote-pa remote-reva remote-revb ruuvitag samd21-xpro same54-xpro saml10-xpro saml11-xpro saml21-xpro samr21-xpro samr30-xpro samr34-xpro seeeduino_arch-pro sensebox_samd21 slstk3401a slstk3402a sltb001a slwstk6000b-slwrb4150a slwstk6000b-slwrb4162a slwstk6220a sodaq-explorer sodaq-one sodaq-sara-aff stk3600 stk3700 stm32f030f4-demo stm32f0discovery stm32f3discovery stm32f429i-disc1 stm32f4discovery stm32f723e-disco stm32f769i-disco stm32l0538-disco stm32l476g-disco teensy31 telosb thingy52 ublox-c030-u201 udoo usb-kw41z waspmote-pro wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1

This all dependencies where compared, so its jsut with info-boards-supported.

@leandrolanzieri
Copy link
Contributor Author

I'll take a look

@fjmolinas
Copy link
Contributor

Seems like the cache is not working properly since the blacklisting depend on board info that is not available before doing the first resolution:

https://github.com/fjmolinas/RIOT/blob/4e12f41476598743be6a14f396ed6a343701dcfc/makefiles/info-global.inc.mk#L8-L16

I would remove this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants