How to compile openssl natively - custom version in yocto? - yocto

I am trying to add the recipe in the yocto to build openssl natively i.e for my host machine - X86.
Here is my recipe and my compilation is failing saying circular dependencies. I am unsure what to do next.
Here is the recipe -
openssl_git.bb
DESCRIPTION = "Potluck with different functions for different purposes that can be shared among C programs"
HOMEPAGE = "https://github.com/openssl/openssl"
LICENSE = "Apache License 2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c75985e733726beaba57bc5253e96d04"
#inherit cmake pkgconfig
SRC_URI = "git://github.com/openssl/openssl.git"
SRCREV = "${AUTOREV}"
S = "${WORKDIR}/git"
do_configure () {
cd ${S}
./config
}
do_compile () {
# Build openssl
oe_runmake -C ${S}
}
BBCLASSEXTEND += "native"
Here is the build error -
arm-poky-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
| arm-poky-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
| Makefile:3979: recipe for target 'apps/lib/libapps-lib-app_params.o' failed
| make[1]: *** [apps/lib/libapps-lib-app_params.o] Error 1
| make[1]: *** Waiting for unfinished jobs....
| Makefile:3987: recipe for target 'apps/lib/libapps-lib-app_provider.o' failed
| make[1]: *** [apps/lib/libapps-lib-app_provider.o] Error 1
| arm-poky-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
| Makefile:3995: recipe for target 'apps/lib/libapps-lib-app_rand.o' failed
| make[1]: *** [apps/lib/libapps-lib-app_rand.o] Error 1
| arm-poky-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
| Makefile:4003: recipe for target 'apps/lib/libapps-lib-app_x509.o' failed
| make[1]: *** [apps/lib/libapps-lib-app_x509.o] Error 1
| make[1]: Leaving directory '/home/user/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/openssl/git-r0/git'
| Makefile:3055: recipe for target 'build_sw' failed

Related

/bin/sh: 1: cc: not found while compiling u-boot on YOCTO

I need help on creating a custom u-boot recipe for custom board.
I made a custom recipe for u-boot with our custom u-boot source and defconfig
While building iam getting the following error
ERROR: u-boot-cal-1.0-r1 do_compile: oe_runmake failed
ERROR: u-boot-cal-1.0-r1 do_compile: Execution of '/media/calixto-systems/cal_linux/Sethu/yocto/yocto-secure/iec61850_module/iec61850_module3.1/build/tmp/work/iec61850_module-poky-linux-gnueabi/u-boot-cal/1.0-r1/temp/run.do_compile.8827' failed with exit code 1
ERROR: Logfile of failure stored in: /media/calixto-systems/cal_linux/Sethu/yocto/yocto-secure/iec61850_module/iec61850_module3.1/build/tmp/work/iec61850_module-poky-linux-gnueabi/u-boot-cal/1.0-r1/temp/log.do_compile.8827
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4
| HOSTCC scripts/basic/fixdep
| /bin/sh: 1: cc: not found
| make[2]: *** [scripts/Makefile.host:95: scripts/basic/fixdep] Error 127
| make[1]: *** [Makefile:488: scripts_basic] Error 2
| make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
| make: *** Waiting for unfinished jobs....
| CFGCHK u-boot.cfg
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/media/calixto-systems/cal_linux/Sethu/yocto/yocto-secure/iec61850_module/iec61850_module3.1/build/tmp/work/iec61850_module-poky-linux-gnueabi/u-boot-cal/1.0-r1/temp/run.do_compile.8827' failed with exit code 1
ERROR: Task (/media/calixto-systems/cal_linux/Sethu/yocto/yocto-secure/iec61850_module/iec61850_module3.1/meta-iec61850_module/recipes-bsp/u-boot/u-boot-cal.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 580 tasks of which 579 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/media/calixto-systems/cal_linux/Sethu/yocto/yocto-secure/iec61850_module/iec61850_module3.1/meta-iec61850_module/recipes-bsp/u-boot/u-boot-cal.bb:do_compile
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
What all things i have to consider while writing a u-boot recipe.
The below lines are my recipe for u-boot
DESCRIPTION = "u-boot bootloader for Calixto devices"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
#SRC_URI[md5sum] = "454a496b2ec8fa2cf60f6b2cba299b10"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
BRANCH ?= "2019.01"
UBOOT_GIT_PROTOCOL = "https"
S = "${WORKDIR}/git"
SRC_URI = "git://sethucalixto#bitbucket.org/calixtolinuxplatform/calixto-am335x-uboot.git;protocol=${UBOOT_GIT_PROTOCOL};branch=${BRANCH}; \
file://am335x_iec61850_module_defconfig"
DEPENDS += "dtc-native bc-native lzop-native flex-native bison-native python3-setuptools-native"
COMPATIBLE_MACHINE = "iec61850-module"
SRCREV = "b96e9f6aed2c0a6cbf08c3f31b917694cc1f1b14"
Have a look at the u-boot recipe in OE-Core. In particular you probably need the EXTRA_OEMAKE lines from u-boot.inc to setup the compiler/linker correctly.

Yocto Build Dependency on Debian Package

I am working on migrating from Debian to Yocto. As a result, many of the proprietary packages I am writing recipes for have dependencies on Debian libraries which do not appear to be available directly in Yocto. This might be a rookie question, but I'm trying to figure out how to do this.
Below, I have one of my recipe for a Makefile C project that was generated with recipetool create:
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
#
# The following license files were not able to be identified and are
# represented as "Unknown" below, you will need to check them yourself:
# debian/copyright
LICENSE = "Unknown"
LIC_FILES_CHKSUM = "file://debian/copyright;md5=some-hash"
SRC_URI = "git://git#my-project.git;protocol=ssh"
# Modify these as desired
PV = "1.0+git${SRCPV}"
SRCREV = "<...>"
S = "${WORKDIR}/git"
DEPENDS = "systemd"
# NOTE: this is a Makefile-only piece of software, so we cannot generate much of the
# recipe automatically - you will need to examine the Makefile yourself and ensure
# that the appropriate arguments are passed in.
do_compile () {
oe_runmake my-project
}
As you can see, I have specified a dependency on systemd. However, the dependency I really think I need is the Debian package libsystemd.
Whenever I bitbake this recipe, I get the following:
NOTE: Executing Tasks
ERROR: <recipe-name> do_compile: oe_runmake failed
ERROR: <recipe-name> do_compile: Execution of '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/temp/run.do_compile.13271' failed with exit code 1:
make[1]: Entering directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
CC file-name.c
../file-name.c:6:10: fatal error: systemd/sd-daemon.h: No such file or directory
6 | #include <systemd/sd-daemon.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:93: build/file-name.o] Error 1
make[1]: Leaving directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
make: *** [Makefile:72: some-recipe] Error 2
WARNING: exit code 1 from a shell command.
ERROR: Logfile of failure stored in: /home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/temp/log.do_compile.13271
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 24 my-project
| make[1]: Entering directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
| CC my-file.c
| ../my-file.c:6:10: fatal error: systemd/sd-daemon.h: No such file or directory
| 6 | #include <systemd/sd-daemon.h>
| | ^~~~~~~~~~~~~~~~~~~~~
| compilation terminated.
| make[1]: *** [Makefile:93: build/my-file.o] Error 1
| make[1]: Leaving directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
| make: *** [Makefile:72: my-project] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/temp/run.do_compile.13271' failed with exit code 1:
| make[1]: Entering directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
| CC my-file.c
| ../my-file.c:6:10: fatal error: systemd/sd-daemon.h: No such file or directory
| 6 | #include <systemd/sd-daemon.h>
| | ^~~~~~~~~~~~~~~~~~~~~
| compilation terminated.
| make[1]: *** [Makefile:93: build/my-file.o] Error 1
| make[1]: Leaving directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
| make: *** [Makefile:72: my-recipe] Error 2
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/home/mitch/bin/yocto/project-name/layers/meta-project/recipes-main/my-recipe/my-recipe_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2166 tasks of which 2163 didn't need to be rerun and 1 failed.
To summarize, what this looks like is my project requires libraries provided by systemd. What am I missing here that would allow me to get this project to build? Is there a way to build it?
Okay, so I guess I was overthinking this. Yocto uses your system to compile the project. So, all I needed to do was provide the systemd header files on my host machine. Since I am running Ubuntu, installing libsystemd-dev on my host fixed the issue. I think that the DEPENDS on systemd will still be required for running on the Yocto system.

Get compile error on Lineage 16.0 when brunch bacon

I am building customer ROM for my OnePluse 1 phone based on lineage 16.0. After making some changes and brunch bacon, i got below error:
ju#suz-ubt-01l:~/android/lineage$ brunch bacon
...
...
...
build/target/product/core.mk was modified, regenerating...
[625/1039] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:88: warning: Be careful when using the SELINUX_IGNORE_NEVERALLOWS flag. It does not work in user builds and using it will not stop you from failing CTS.
[1039/1039] including vendor/qcom/opensource/dataservices/Android.mk ...
build/make/core/Makefile:28: warning: overriding commands for target `/home/ju/android/lineage/out/target/product/bacon/system/vendor/lib/hw/android.hardware.nfc#1.0-impl.so'
build/make/core/base_rules.mk:412: warning: ignoring old commands for target `/home/ju/android/lineage/out/target/product/bacon/system/vendor/lib/hw/android.hardware.nfc#1.0-impl.so'
[ 86% 94/109] Building Kernel Config
make: Entering directory '/home/ju/android/lineage/kernel/oppo/msm8974'
GEN /home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ/Makefile
#
# configuration written to .config
#
make: Leaving directory '/home/ju/android/lineage/kernel/oppo/msm8974'
make: Entering directory '/home/ju/android/lineage/kernel/oppo/msm8974'
GEN /home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ/Makefile
scripts/kconfig/conf --savedefconfig=defconfig Kconfig
make: Leaving directory '/home/ju/android/lineage/kernel/oppo/msm8974'
[ 87% 95/109] Building Kernel
FAILED: TARGET_KERNEL_BINARIES
/bin/bash -c "(make -j2 -j\$(nproc) CFLAGS_MODULE=\"-fno-pic\" -C kernel/oppo/msm8974 O=/home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\"/usr/bin/ccache arm-linux-androidkernel-\" zImage ) && (if grep -q '^CONFIG_OF=y' /home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ/.config; then echo \"Building DTBs\";make -j2 -j\$(nproc) CFLAGS_MODULE=\"-fno-pic\" -C kernel/oppo/msm8974 O=/home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\"/usr/bin/ccache arm-linux-androidkernel-\" dtbs; fi ) && (if grep -q '=m' /home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ/.config; then echo \"Building Kernel Modules\"; make -j2 -j\$(nproc) CFLAGS_MODULE=\"-fno-pic\" -C kernel/oppo/msm8974 O=/home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\"/usr/bin/ccache arm-linux-androidkernel-\" modules; fi )"
make: Entering directory '/home/ju/android/lineage/kernel/oppo/msm8974'
File "/home/ju/android/lineage/kernel/oppo/msm8974/scripts/gcc-wrapper.py", line 59
print "error, forbidden warning:", m.group(2)
^
SyntaxError: invalid syntax
GEN /home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ/Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
File "/home/ju/android/lineage/kernel/oppo/msm8974/scripts/gcc-wrapper.py", line 59
print "error, forbidden warning:", m.group(2)
^
SyntaxError: invalid syntax
GEN /home/ju/android/lineage/out/target/product/bacon/obj/KERNEL_OBJ/Makefile
CHK include/linux/version.h
CC scripts/mod/empty.o
File "/home/ju/android/lineage/kernel/oppo/msm8974/scripts/gcc-wrapper.py", line 59
print "error, forbidden warning:", m.group(2)
^
SyntaxError: invalid syntax
/home/ju/android/lineage/kernel/oppo/msm8974/scripts/Makefile.build:307: recipe for target 'scripts/mod/empty.o' failed
make[3]: *** [scripts/mod/empty.o] Error 1
/home/ju/android/lineage/kernel/oppo/msm8974/scripts/Makefile.build:443: recipe for target 'scripts/mod' failed
make[2]: *** [scripts/mod] Error 2
/home/ju/android/lineage/kernel/oppo/msm8974/Makefile:510: recipe for target 'scripts' failed
make[1]: *** [scripts] Error 2
make[1]: *** Waiting for unfinished jobs....
Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/home/ju/android/lineage/kernel/oppo/msm8974'
ninja: build stopped: subcommand failed.
10:45:43 ninja failed with: exit status 1
#### failed to build some targets (01:13 (mm:ss)) ####
My environment info as below:
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=9
LINEAGE_VERSION=16.0-20200110-UNOFFICIAL-bacon
TARGET_PRODUCT=lineage_bacon
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.0.0-37-generic-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=PQ3A.190801.002
OUT_DIR=/home/ju/android/lineage/out
PRODUCT_SOONG_NAMESPACES= hardware/qcom/audio-caf/msm8974 hardware/qcom/display-caf/msm8974
hardware/qcom/media-caf/msm8974
My python version is "Python 3.6.8 :: Anaconda, Inc."
Andy help should be appreciated, Thank you very much.
Create Conda environment with python version 2.7

stk11xx driver on raspberry-pi installation error

I have an error in my instalation in my raspberry-pi 3, it's a driver for a web-cam
I took the driver on this page:
https://github.com/hbars/stk11xx-driver
and the manual for this instalation is here:
https://github.com/hbars/stk11xx-driver/blob/master/INSTALL
it's on this line:
make -f Makefile.standalone driver
error:
make -f Makefile.standalone driver
make -C /lib/modules/4.19.66-v7+/build SUBDIRS=/home/pi/stk11xx-2.1.0 modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.66-v7+'
CC [M] /home/pi/stk11xx-2.1.0/stk11xx-usb.o
/home/pi/stk11xx-2.1.0/stk11xx-usb.c: In function 'usb_stk11xx_probe':
/home/pi/stk11xx-2.1.0/stk11xx-usb.c:793:2: error: implicit declaration of function 'init_MUTEX' [-Werror=implicit-function-declaration]
init_MUTEX(&dev->mutex);
^~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:303: recipe for target '/home/pi/stk11xx-2.1.0/stk11xx-usb.o' failed
make[2]: *** [/home/pi/stk11xx-2.1.0/stk11xx-usb.o] Error 1
Makefile:1519: recipe for target '_module_/home/pi/stk11xx-2.1.0' failed
make[1]: *** [_module_/home/pi/stk11xx-2.1.0] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.19.66-v7+'
Makefile.standalone:13: recipe for target 'driver' failed
make: *** [driver] Error 2
sorry this is not the good error it's the one:
make -C /lib/modules/4.19.66-v7+/build SUBDIRS=/home/pi/stk11xx-driver modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.66-v7+'
mkdir: cannot create directory '/home/pi/stk11xx-driver/.tmp_versions': Permission denied
/bin/sh: 1: cannot create /home/pi/stk11xx-driver/modules.order: Permission denied
scripts/Makefile.build:462: recipe for target '/home/pi/stk11xx-driver/modules.order' failed
make[2]: *** [/home/pi/stk11xx-driver/modules.order] Error 2
Makefile:1519: recipe for target '_module_/home/pi/stk11xx-driver' failed
make[1]: *** [_module_/home/pi/stk11xx-driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.19.66-v7+'
Makefile.standalone:13: recipe for target 'driver' failed
make: *** [driver] Error 2
I have resolved my problem I had to put sudo in front of make -f Makefile.standalone driver
but I have an other error:
make -C /lib/modules/4.19.66-v7+/build SUBDIRS= modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.66-v7+'
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --syncconfig Kconfig
make[2]: *** No rule to make target 'arch/arm/tools/syscall.tbl', needed by 'arch/arm/include/generated/uapi/asm/unistd-common.h'. Stop.
arch/arm/Makefile:319: recipe for target 'archheaders' failed
make[1]: *** [archheaders] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.19.66-v7+'
Makefile.standalone:13: recipe for target 'driver' failed
make: *** [driver] Error 2
So I have resolved my problem, replacing all PWD whith shell pwd in Makefile.standalonee

configure//make error on Ubuntu Pjsip PJproject

I am trying to extract opus rtp packets and convert them into wav format from the pcap file. In order to do so, I installed pjproject2.6 using the following commands:
cd pjproject2.6/
./configure
make dep && make
After the last command, I ran into the following error:
In file included from /usr/include/c++/7/cmath:47:0,
from /usr/include/c++/7/math.h:36,
from ../../yuv/source/compare.cc:14:
/usr/include/c++/7/bits/std_abs.h: In function ‘constexpr long double std::abs(long double)’:
/usr/include/c++/7/bits/std_abs.h:78:22: error: x87 register return with x87 disabled
abs(long double __x)
^
/home/administrator/pjproject-2.6/build/rules.mak:178: recipe for target 'output/libyuv-x86_64-unknown-linux-gnu/compare.o' failed
make[3]: *** [output/libyuv-x86_64-unknown-linux-gnu/compare.o] Error 1
make[3]: Leaving directory '/home/administrator/pjproject-2.6/third_party/build/yuv'
Makefile:100: recipe for target 'libyuv-x86_64-unknown-linux-gnu.a' failed
make[2]: *** [libyuv-x86_64-unknown-linux-gnu.a] Error 2
make[2]: Leaving directory '/home/administrator/pjproject-2.6/third_party/build/yuv'
Makefile:7: recipe for target 'all' failed
make[1]: *** [all] Error 1
make[1]: Leaving directory '/home/administrator/pjproject-2.6/third_party/build'
Makefile:14: recipe for target 'all' failed
make: *** [all] Error 1
Any suggestions? Thanks in advance!