How to disable Warning error flag in yocto recipe - yocto

How to disable the warnings which considered as error in yocto BITBAKE recipe.
error: '' is used uninitialized in this function [-Werror=uninitialized]

You can add more compilation flags as below on your recipes.
TARGET_CFLAGS += -Wuninitialized
TARGET_CFLAGS += -Wmaybe-uninitialized

My preferred way is to clean the package and then rebuild it. For example, if it's u-boot that has the tainted flag:
$ bitbake -c cleanall u-boot
$ bitbake u-boot

Related

Building an external kernel module with Yocto Honister and devtool: ERROR: Kernel configuration is invalid

When building an external kernel module with devtool build in Yocto, the build sometimes fails.
| ERROR: Kernel configuration is invalid.
| include/generated/autoconf.h or include/config/auto.conf are missing.
| Run 'make oldconfig && make prepare' on kernel src to fix it.
How can I fix that?
This is a bug but there is a workaround. Just execute
bitbake -c cleansstate make-mod-scripts

How to fix yocto package compilation issue Binutils 2.34

I am building yocto for begalbone black in linux mint.
I have tried bitbake -c cleansstate binutils then bitbake binutils but didn't fix the issue.
[Text] (https://drive.google.com/file/d/1Ok6_AE_AY1j5wfasSBPA1nFj9ZZftSRx/view?usp=sharing)
I have include following flag in local.conf to protect from stack overflow and updated to latest dunfell branch.
TARGET_CPPFLAGS += "-fstack-protector -D_FORTIFY_SOURCE=1"

How to build Flow

I'm trying to build flow so that I can make modifications to their code and build my own version to use and test. But when I'm trying to build it, it dies. The following steps were used:
Install OCaml (followed steps from https://ocaml.org/docs/install.html)
Install Opam
Run:
opam update
opam pin add flowtype . -n
opam install --deps-only flowtype
Then, I tried to make it:
make
At the very first seconds, it dies with:
ocamlbuild \
-use-ocamlfind -pkgs compiler-libs.common,unix \
-I scripts \
scripts/ppx_gen_flowlibs.native
+ ocamlfind ocamldep -package wtf8 -package dtoa -package unix -package compiler-libs.common -modules scripts/ppx_gen_flowlibs.ml > scripts/ppx_gen_flowlibs.ml.depends
ocamlfind: Package `wtf8' not found
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:01.
Makefile:300: recipe for target '_build/scripts/ppx_gen_flowlibs.native' failed
make: *** [_build/scripts/ppx_gen_flowlibs.native] Error 10
It is possible that only I missed something, but I'm not really into OCaml and Opam at the moment.
The pertinent error info appears to be ocamlfind: Package 'wtf8' not found.
Have you inited opam? If not you need to run opam init --comp 4.03.0 and restart your shell before running the other opam commands. (For more detail, see https://opam.ocaml.org/doc/Usage.html).
If you have, run opam list and see if wtf8 is in the list of installed packages. If it is not in the list, try running opam install wtf8. If it is in the list, try following the solutions to this same issue here ocamlfind cannot see installed package.

How to get to menuconfig for u-boot in Yocto environment

I'm using Yocto for the first time for an ARM embedded system with a Xilinx Zynq.
I want to make some configuration changes that requires going in the menuconfig utility. Yocto documentation shows how to do it for the Linux Kernel
bitbake yocto-xlnx -c menuconfig
Which, for Xilinx, I turned into
bitbake linux-xlnx -c menuconfig
It works very well.
Now, I want to do the same with u-boot and change the .config file using the menuconfig utility. I can't find any way to do it in Yocto or Xilinx documentation. I tried the obvious like
bitbake u-boot-xlnx -c menuconfig
just to get an error message:
ERROR: Task do_menuconfig does not exist for target u-boot-xlnx
Any Idea how to get to u-boot menuconfig with Yocto?
Edit:
here are the layers I use
BBLAYERS ?= " \
/home/sylvain/poky/meta \
/home/sylvain/poky/meta-poky \
/home/sylvain/poky/meta-yocto-bsp \
/home/sylvain/poky/openembedded-core/meta \
/home/sylvain/poky/meta-xilinx \
"
It's currently, as of 2.3 Pyro, not possible to run bitbake u-boot -c menuconfig as no-one has implemented that functionality for the U-Boot recipe. Please, file a bug if you'd have uses for this.
Normally, I'd recommend either of the following approaches:
bitbake u-boot -c devshell
Use of devtool.
Use the SDK.
All of these would not only allow you to run make menuconfig, but also to cross-compile U-Boot to verify your configuration.
I found the solution. It works for xilinx distribution. I did not test it for others but it's likely to be similar and it's likely to work for any other menuconfig of any package. It turns out that the full source package is located in my case at:
~/poky/build/tmp/work/zedboard_zynq7-poky-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx-v2016.3+gitAUTOINC+95e11f6eb4-r0/build
I'll let you decode the "board, machine, version etc" coding in the folder string since it depends on each case, but just want to give the idea.
Using the terminal, just go to that folder then run just like in the old days:
make menuconfig
and voilĂ !
I guess when I get to configure busybox and things like that, it will just be the same.
I ran into the same problem.
I build u-boot-at91 for at91sam9x35, but it should be the same for other architectures as well.
Yocto still doesn't support
bitbake u-boot -c menuconfig
I managed to do it with the following steps:
In build directory run:
devtool modify u-boot-at91
This will automatically create the u-boot source files' external directory under: build/workspace/u-boot-at91.
cd build/workspace/u-boot-at91
run menuconfig using:
make menuconfig
If menuconfig doesn't show up you might have to run the do_configure task for u-boot and then retry:
bitbake u-boot-at91 -c configure
Perform required menuconfig changes in the UI and save the configuration in New.config file.
Copy the New.config file to override your target's defconfig file
(in my case at91sam9x5ek_spiflash_config) using:
cp New.config configs/at91sam9x5ek_spiflash_defconfig
Notice the defconfig suffix instead of config!
Push the change to your local git repository:
pushd build/workspace/sources/u-boot-at91
git add at91sam9x5ek_spiflash_defconfig
git commit -m "summary of changes made here"
git status
popd
Create the patch to override the default defconfig file:
devtool update-recipe u-boot-at91
This actually appends the following lines to your u-boot-at91.bb files:
SRC_URI = "git://github.com/linux4sam/u-boot-at91.git;protocol=https;branch=${UBRANCH} \
file://0001-summary-of-changes-made-here.patch \
and creates the patch file with relevant modifications to the recipe's directory.
8. Run BitBake:
bitbake u-boot-at91
or
bitbake core-image-minimal
The new u-boot binary will be built with the new configuration.

Specify the gcc version for bitbake meta-toolchain

I'm just starting to learn Yocto 1.8.
The bitbake meta-toolchain ran fine as described in the documentation and generated the appropriate installation script. However, bitbake picked a version of GCC that I don't want.
What is the recommended way to tell bitbake which version of GCC to pick for the bitbake meta-toolchain build?
Just to keep the record complete.
The exact GCC version is specified in the machine/.conf file as:
# This version is Yocto-branch dependent
PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "5.2%"