Yocto 1.6 no libboost_log in toolchain - boost

I've installed Yocto 1.6 and run the bitbake to set up the toolchain, following the tutorial written by Daiane Angolini. While I see most of the boost libraries under $SDKTARGETSYSROOT/usr/lib, there seems to be no libboost_log.a nor libboost_log_setup.a. I believe these were introduced with Boost 1.55, and that Yocto 1.6 has moved to Boost 1.55. Shouldn't they be there, or have I done something wrong?
My .../fsl-community-bsp/build/conf/local.conf:
BB_NUMBER_THREADS ?= "${#oe.utils.cpu_count()}"
PARALLEL_MAKE ?= "-j ${#oe.utils.cpu_count()}"
MACHINE ??= 'imx6qsabresd'
DISTRO ?= 'poky'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-sdk"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K"
PACKAGECONFIG_pn-qemu-native = "sdl"
PACKAGECONFIG_pn-nativesdk-qemu = "sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"
BB_NUMBER_THREADS = '1'
PARALLEL_MAKE = '-j 1'
DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = ""
CORE_IMAGE_EXTRA_INSTALL += "boost"

The right way is to extend the existing recipe. In fact, you normally never change a 3rd-party recipe directly. This means, you are creating your own "recipes-support/boost/" folder which includes a file called "boost_%.bbappend".
'%' means that the boost version is not of interest. 'bbappend' means that you extend the existing boost-recipe. This file contains only one line:
BOOST_LIBS += " log"

In order to add log library you should edit boost recipe file.
In this example you should edit boost.inc.
To add log, atomic and loace libraries, replace
BOOST_LIBS = "\
date_time \
filesystem \
graph \
iostreams \
program_options \
regex \
serialization \
signals \
system \
test \
thread \
"
with
BOOST_LIBS = "\
date_time \
filesystem \
graph \
iostreams \
program_options \
regex \
serialization \
signals \
system \
test \
thread \
log \
atomic \
locale
"

Related

Check If Vim Syntax Region Exists and Remove It

Background:
Syntax highlighting for perl files is extremely slow at times for large files (1k+ lines).
I profiled using:
:syntime on
"*** Do some slow actions ***
:syntime report
There were many slowly performaning regions, like: perlStatementProc
I significantly improved performance by removing some of the slowly performing syntax regions (there are more):
:syntax clear perlStatementProc
Now I want to use this vimrc with these improvements on a different machine which may not have a specific region defined.
I am seeing this ERROR when opening Vim:
E28: No such highlight group name: perlStatementProc
How can I check if the syntax region name perlStatementProc exists?
I found out about hlexists and implemented this solution in my vimrc:
" Remove some syntax highlighting from large perl files.
function! RemovePerlSyntax()
if line('$') > 1000
let perl_syntaxes = [
\ "perlStatementProc",
\ "perlMatch",
\ "perlStatementPword",
\ "perlQR",
\ "perlQW",
\ "perlQQ",
\ "perlQ",
\ "perlStatementIndirObjWrap",
\ "perlVarPlain",
\ "perlVarPlain",
\ "perlOperator",
\ "perlStatementFiledesc",
\ "perlStatementScalar",
\ "perlStatementInclude",
\ "perlStatementNumeric",
\ "perlStatementSocket",
\ "perlFloat",
\ "perlFormat",
\ "perlStatementMisc",
\ "perlStatementFiles",
\ "perlStatementList",
\ "perlStatementIPC",
\ "perlStatementNetwork",
\ "perlStatementTime",
\ "perlStatementIOfunc",
\ "perlStatementFlow",
\ "perlStatementControl",
\ "perlHereDoc",
\ "perlHereDocStart",
\ "perlVarPlain2",
\ "perlVarBlock",
\ "perlVarBlock2",
\ "perlDATA",
\ "perlControl",
\ "perlStatementHash",
\ "perlStatementVector",
\ "perlIndentedHereDoc",
\ "perlLabel",
\ "perlConditional",
\ "perlRepeat",
\ "perlNumber",
\ "perlStatementRegexp",
\ ]
for perl_syntax in perl_syntaxes
" NEW - Was missing this check before.
if hlexists( perl_syntax )
exec "syntax clear " . perl_syntax
endif
endfor
let b:remove_perl_syntax = 1
else
let b:remove_perl_syntax = 0
endif
endfunction
augroup remove_perl_syntax
autocmd!
autocmd BufNewFile,BufRead,BufReadPost,FileType perl call RemovePerlSyntax()
augroup END

Yocto, Meta-selinux does not work on raspberry pi 3

I realize a yocto image for a raspberry pi 3. I want to install selinux on the image with the Meta-selinux. The compilation works, but selinux remains disabled even if it is in enforcing or permissive mode in the / etc / selinux / config file. I also tried adding "selinux = 1 security = selinux" in the cmdline.txt file of the bootloader, but selinux is still disabled.
Here is what I added in my local.conf:
RPI_USE_U_BOOT = "1"
ENABLE_UART = "1"
INHERIT += "rm_work"
DISTRO_FEATURES_append = " acl xattr pam selinux"
PREFERRED_PROVIDER_virtual/refpolicy = "refpolicy-mls"
IMAGE_INSTALL_append = " packagegroup-core-selinux"
Here is what I added in my bblayers.conf:
BBLAYERS ?= " \
/home/.../poky/meta \
/home/.../meta-poky \
/home/.../meta-yocto-bsp \
/home/.../meta-openembedded/meta-oe \
/home/.../meta-openembedded/meta-networking \
/home/.../meta-openembedded/meta-multimedia \
/home/.../meta-openembedded/meta-python \
/home/.../meta-selinux \
/home/.../meta-raspberrypi \
"
Thank you for your help.

Yocto minimal eSDK - world-pkgdata

I've been trying to generate minimal extensible sdk using Yocto 2.5 Sumo. I've cloned only the poky and meta-openembedded repositories. In local.conf I've set the SDK type to minimal and set SDK_INCLUDE_PKGDATA. During the last task (do_populate_sdk_ext) bitbake throws that locked-sigs-pkgdata.inc is not found in this directory
tmp/work/genericx86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/world-pkgdata/
Find shows that this file is avaible here
./tmp/work/genericx86_64-poky-linux/meta-world-pkgdata/1.0-r0/image/world-pkgdata/locked-sigs-pkgdata.inc
./tmp/work/genericx86_64-poky-linux/meta-world-pkgdata/1.0-r0/recipe-sysroot/world-pkgdata/locked-sigs-pkgdata.inc
When I copy this file from on of above directories eSDK is correctly generated. I believe that this should be done automatically by one of recipe for poky/meta-openembedded. Probably I miss some config, but I'am unable to correctly identify the source of this problem.
Here is my bblayers.conf:
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/work/build/yocto/poky/meta \
/work/build/yocto/poky/meta-poky \
/work/build/yocto/poky/meta-yocto-bsp \
/work/build/yocto/meta-openembedded/meta-oe \
/work/build/yocto/meta-openembedded/meta-python \
/work/build/yocto/meta-openembedded/meta-multimedia \
/work/build/yocto/meta-openembedded/meta-perl \
/work/build/yocto/meta-openembedded/meta-gnome \
/work/build/yocto/meta-openembedded/meta-filesystems \
/work/build/yocto/meta-openembedded/meta-initramfs \
/work/build/yocto/meta-openembedded/meta-networking \
/work/build/yocto/openembedded-core/meta \
"
And my local.conf:
MACHINE = "genericx86-64"
BUILD_ARCH ?= "x86_64"
SDKMACHINE ?= "x86_64"
SDK_UPDATE_URL ?= "http://my-url/sdk-updater"
SDK_EXT_TYPE = "minimal"
SDK_INCLUDE_TOOLCHAIN = "0"
SDK_INCLUDE_PKGDATA = "1"
SSTATE_MIRRORS_append = " file://.* http://my-url/sstate/PATH \n"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_ipk"
LICENSE_FLAGS_WHITELIST = "commercial"
CONF_VERSION = "1"
I've tested
core-image-full-cmdline
and
core-image-minimal-dev
on both I've the same problem.
Thanks for any help and clues how to resolve this issue.

AC_CONFIG_FILES not generating Makefiles

I'm writing an app in Vala with support to plugins. The app has the following directory structure:
data/
[data files]
m4/
my_project.m4
plugins/
example/
example.plugin.in
example-plugin.vala
Makefile.am
po/
src/
[source files]
The file "my_project.m4" dinamically adds plugin dirs with a simple defined function called MYPROJ_ADD_PLUGIN, and it works fine as I tested it with some other projects. Basically, it calls:
AC_CONFIG_FILES([plugins/example/Makefile])
[...]
AC_CONFIG_FILES([plugins/example/example.plugin])
The problem is, when I try to configure it, it gives back:
"error: cannot find input file: `plugins/example/Makefile.in'"
The example makefile (plugins/example/Makefile.am) is the following:
include $(top_srcdir)/common.am
plugin_LTLIBRARIES = example-plugin.la
plugin_DATA = example.plugin
example_plugin_la_SOURCES = \
example-plugin.vala
example_plugin_la_VALAFLAGS = \
$(MYPROJ_COMMON_VALAFLAGS) \
--target-glib=2.38
example_plugin_la_CFLAGS = \
$(MYPROJ_COMMON_CFLAGS) \
-I$(srcdir) \
-DG_LOG_DOMAIN='"Example"'
example_plugin_la_LIBADD = \
$(MYPROJ_COMMON_LIBS)
example_plugin_la_LDFLAGS = \
$(MYPROJ_PLUGIN_LINKER_FLAGS) \
-lm
EXTRA_DIST = example.plugin.in
Every var is correctly generated (in common.am and configure.ac).
I appreciate any advice on this issue.
Thanks in advance
Looks like I found the answer to my own question. Apparently, everything I had to do was add a "lib" prefix to my plugin output file. The plugins/example/Makefile.am now looks like:
include $(top_srcdir)/common.am
plugin_LTLIBRARIES = **lib**example.la
plugin_DATA = example.plugin
**lib**example_la_SOURCES = \
example-plugin.vala
**lib**example_la_VALAFLAGS = \
$(MYPROJ_COMMON_VALAFLAGS) \
--target-glib=2.38
**lib**example_la_CFLAGS = \
$(MYPROJ_COMMON_CFLAGS) \
-I$(srcdir) \
-DG_LOG_DOMAIN='"Example"'
**lib**example_la_LIBADD = \
$(MYPROJ_COMMON_LIBS)
**lib**example_la_LDFLAGS = \
$(MYPROJ_PLUGIN_LINKER_FLAGS) \
-lm
EXTRA_DIST = example.plugin.in
This was the only modification I did, and it works as expected now. Seems like autoconf/autotools is very rigid about the syntax of plugins and shared libs, as they MUST start with lib prefix.

Disable all but few warnings in gcc

In gcc -w is used to disable all warnings. However in this case I can't enable specific ones (e.g. -Wreturn-type).
Is it possible to disable all warnings, but enable few specific ones?
As a workaround, is there a way to generate list of all -Wno-xxx at once? And will it help? I wouldn't want to do this manually just to find out that it is not equal to -w.
You can use the following command to get an WARN_OPTS variable suitable for injecting directly into your Makefile:
gcc --help=warnings | awk '
BEGIN { print "WARN_OPTS = \\" }
/-W[^ ]/ { print $1" \\"}
' | sed 's/^-W/ -Wno-/' >makefile.inject
This gives you output (in makefile.inject) like:
WARN_OPTS = \
-Wno- \
-Wno-abi \
-Wno-address \
-Wno-aggregate-return \
-Wno-aliasing \
-Wno-align-commons \
-Wno-all \
-Wno-ampersand \
-Wno-array-bounds \
-Wno-array-temporaries \
: : :
-Wno-variadic-macros \
-Wno-vector-operation-performance \
-Wno-vla \
-Wno-volatile-register-var \
-Wno-write-strings \
-Wno-zero-as-null-pointer-constant \
Once that's put in your actual Makefile, simply use $(WARN_OPTS) as part of your gcc command.
It may need a small amount of touch up to:
get rid of invalid options such as -Wno-;
fix certain -Wno-<key>=<value> types; and
remove the final \ character.
but that's minimal effort compared to the generation of the long list, something you can now do rather simply.
When you establish that you want one of those warnings, simply switch from the -Wno-<something> back to -W<something>.

Resources