schnitzeltony / meta-microcontroller

OE layer for tools to work with microcontrollers and electronics
MIT License
5 stars 10 forks source link

Feature request for `nativesdk-packagegroup-avr-toolchain-host` #3

Open lgrosz opened 1 year ago

lgrosz commented 1 year ago

Hi. This is somewhat related to #2, which allows for building of avr binaries during bitbake execution. It would be nice to also have the tools be populated during the populate_sdk task so the same toolchain can be used to build when sourcing the Yocto sdk. Is this something that can be done? Looking into poky, it seems like all that would be needed is the packagegroup and have BBCLASSEXTENDS contain nativesdk.

I attempted this myself by adding

However, I encountered an error when compiling nativesdk-avr-gcc:

g++: error: unrecognized command line option ‘-fmacro-prefix-map=...'

I am not well versed in target vs native vs nativesdk, so I am unsure where to go from here.

lgrosz commented 1 year ago

I was able to get the avr-binutils in the sdk by

avr-gcc does not seem to be that simple though as I am unable to compile with the aforementioned error.

lgrosz commented 1 year ago

In case anyone comes across this.. here's a way to minimally reproduce the issue:

$ git clone -b zeus git://git.yoctoproject.org/poky
$ cd poky
$ git clone -b zeus https://github.com/openembedded/meta-openembedded.git
$ git clone -b zeus https://github.com/schnitzeltony/meta-microcontroller.git
$ sed -i 's/BBCLASSEXTEND = "native"/BBCLASSEXTEND = "native nativesdk"/' meta-microcontroller/recipes-avr/avr-binutils/avr-binutils_2.34.bb
$ sed -i 's/BBCLASSEXTEND = "native"/BBCLASSEXTEND = "native nativesdk"/' meta-microcontroller/recipes-avr/avr-gcc/avr-gcc_8.4.0.bb
$ source oe-init-build-env
$ echo 'BBMASK += "meta-microcontroller/recipes-eda/opencascade/opencascade.bb"' >> conf/local.conf
$ echo 'BBMASK += "meta-microcontroller/recipes-graphics/vtk/vtk.bb"' >> conf/local.conf
$ bitbake-layers add-layer ../meta-openembedded/meta-*
$ bitbake-layers add-layer ../meta-microcontroller
$ bitbake nativesdk-avr-gcc