How to build bootgen utility in Yocto - Makefile system? - yocto

I am trying to write a recipe to build the bootgen utility natively for my linux pc. Basically, after compiling natively i.e for my X86 machine, I want to use this utility to generate a zynq image.
The bootgen has a dependency on the openssl package - libssl1.0-dev, which I have installed using
sudo apt install libssl1.0-dev
Now, here is my recipe and I am getting errors and I can see it is trying to cross-compile but I want this to build natively rather than cross compiled for ARM/Zynq. Here is my recipe.
DESCRIPTION = "Bootgen application - Xilinx to create boot.bin"
HOMEPAGE = "https://github.com/Xilinx/bootgen"
LICENSE = "LGPL-2.1"
LIC_FILES_CHKSUM = "file://LICENSE;md5=be5410bcde8eb6481a6e5d3b22e0740b"
SRC_URI = "git://github.com/Xilinx/bootgen.git"
SRCREV = "${AUTOREV}"
S = "${WORKDIR}/git"
What I need to provide here? How does it know how to compile? Do I need to add any task like compile here?
Errors seen -
ERROR: bootgen-git-r0 do_compile: oe_runmake failed
ERROR: bootgen-git-r0 do_compile: Function failed: do_compile (log file is located at /home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0/temp/log.do_compile.10667)
ERROR: Logfile of failure stored in: /home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0/temp/log.do_compile.10667
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4
| g++ -c -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0 -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0 -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0/recipe-sysroot= -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0/recipe-sysroot-native= -fvisibility-inlines-hidden -I. bootheader-zynq.cpp
| g++ -c -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0 -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0 -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0/recipe-sysroot= -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0/recipe-sysroot-native= -fvisibility-inlines-hidden -I. authentication-zynq.cpp
| g++ -c -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0 -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0 -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0/recipe-sysroot= -fdebug-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/
g++: error: unrecognized command line option ‘-fmacro-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0’
| g++: error: unrecognized command line option ‘-fmacro-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0’
| g++: error: unrecognized command line option ‘-fmacro-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0’
| g++: error: unrecognized command line option ‘-fmacro-prefix-map=/home/xxx/temp/custom_yocto/build-custom-zynq/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/bootgen/git-r0=/usr/src/debug/bootgen/git-r0’
| Makefile:70: recipe for target 'bootheader-zynq.o' failed
| make: *** [bootheader-zynq.o] Error 1
| make: *** Waiting for unfinished jobs....
| Makefile:70: recipe for target 'imageheadertable-versal.o' failed
| make: *** [imageheadertable-versal.o] Error 1
| Makefile:70: recipe for target 'authentication-zynq.o' failed
| make: *** [authentication-zynq.o] Error 1
| Makefile:70: recipe for target 'bif.yy.o' failed

Related

Error and Build Failed while setting up mediapipe on Raspberry Pi 4 (Raspbian OS 64 bit)

I am new to both Raspberry Pi and Mediapipe. I was following these steps: https://spyjetson.blogspot.com/2021/06/installing-mediapipecpu-mode-on.html
But on this step: root#raspberrypi:/usr/local/src/mediapipe# python3 setup.py bdist_wheel
I am getting error and build failed
Error is this:
ERROR: /usr/local/src/mediapipe/mediapipe/framework/stream_handler/BUILD:95:11: C++ compilation of rule '//mediapipe/framework/stream_handler:default_input_stream_handler' failed (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 55 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 55 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
In file included from <command-line>:
/usr/include/stdc-predef.h: In substitution of 'template<class _Functor, class, class> std::function<std::unique_ptr<mediapipe::InputStreamHandler>(std::shared_ptr<mediapipe::tool::TagMap>, mediapipe::CalculatorContextManager*, const mediapipe::MediaPipeOptions&, bool)>::function(_Functor) [with _Functor = <missing>; <template-parameter-1-2> = <missing>; <template-parameter-1-3> = <missing>]':
mediapipe/framework/stream_handler/default_input_stream_handler.cc:24:1: required from here
/usr/include/stdc-predef.h:32:94: internal compiler error: Segmentation fault
32 | whether the overall intent is to support these features; otherwise,
| ^
0x7fa3cab217 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
Target //mediapipe/modules/face_detection:face_detection_short_range_cpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 853.907s, Critical Path: 792.14s
INFO: 990 processes: 130 internal, 860 linux-sandbox.
FAILED: Build did NOT complete successfully
In my case it was a GCC issue. I downgraded from 10 to 9 and it compiled.
sudo apt install gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9

Error while compiling uuid-ossp packages on postgresql11

whenever i am trying to compile the uuid-ossp packege i am getting error.
I have tried to install packages in REDHAt os rpm -qa | grep lib64ossp
lib64ossp-uuid16-1.6.2-10.x86_64
$:/optware/postgres/postgresql-11.2/contrib/uuid-ossp>make
make -C ../../src/backend generated-headers
make[1]: Entering directory `/optware/postgres/postgresql-11.2/src/backend'
make -C catalog distprep generated-header-symlinks
make[2]: Entering directory `/optware/postgres/postgresql-11.2/src/backend/catalog'
make[2]: Nothing to be done for `distprep'.
make[2]: Nothing to be done for `generated-header-symlinks'.
make[2]: Leaving directory `/optware/postgres/postgresql-11.2/src/backend/catalog'
make -C utils distprep generated-header-symlinks
make[2]: Entering directory `/optware/postgres/postgresql-11.2/src/backend/utils'
make[2]: Nothing to be done for `distprep'.
make[2]: Nothing to be done for `generated-header-symlinks'.
make[2]: Leaving directory `/optware/postgres/postgresql-11.2/src/backend/utils'
make[1]: Leaving directory `/optware/postgres/postgresql-11.2/src/backend'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -I../../contrib/pgcrypto -I. -I. -I../../src/include -D_GNU_SOURCE -c -o uuid-ossp.o uuid-ossp.c
uuid-ossp.c:37:2: error: #error "please use configure's --with-uuid switch to select a UUID library"
#error "please use configure's --with-uuid switch to select a UUID library"
^
uuid-ossp.c: In function âuuid_generate_internalâ:
uuid-ossp.c:282:5: error: unknown type name âuuid_tâ
uuid_t uu;
^
uuid-ossp.c:283:23: error: âuuid_s_okâ undeclared (first use in this function)
uint32_t status = uuid_s_ok;
^
If you are not building a contrib module with the source tree it is part of, you have to set USE_PGXS:
PATH=/path/to/postgres/binaries:$PATH make USE_PGXS=1
The path must contain the pg_config executable.
To be sure it works, use the contrib source from the same major version as the installed PostgreSQL.

I am getting error fatal error: 'cstddef' file not found while running brew install --HEAD usbmuxd

I am trying to run command
brew install --HEAD usbmuxd
but each time it throw this error
/usr/local/include/plist/Node.h:26:10: fatal error: 'cstddef' file not found
#include <cstddef>
^~~~~~~~~
1 error generated.
make[1]: *** [collection.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden -pthread -g -O2 -c thread.c -o thread.o >/dev/null 2>&1
1 error generated.
make[1]: *** [socket.lo] Error 1
make: *** [install-recursive] Error 1
Please, help me to resolve this issue.
Thanks in advance
This is an issue way back when a wrong header file was placed on /usr/local/include. Running brew doctor and removing /usr/local/include/string.h should solve the issue.

unable to build binutils for my cross compiler

i am trying to build binutils 2.19.1 with mingw/msys using following commands:
export PREFIX=/usr/local/cross
export TARGET=i586-elf
cd /usr/src
mkdir build-binutils
cd /usr/src/build-binutils
../binutils-x.xx/configure --target=$TARGET --prefix=$PREFIX --disable-nls
make all
make install
and im getting following errors:
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../binuti
ls-2.19.1/bfd -I. -D__USE_MINGW_FSEEK -I. -I../../binutils-2.19.1/bfd -I../..
/binutils-2.19.1/bfd/../include -W -Wall -Wstrict-prototypes -Wmissing-proto
types -Wno-format -Werror -g -O2 -D__USE_MINGW_ACCESS -c -o archive.lo ../../bin
utils-2.19.1/bfd/archive.c
./libtool: line 2258: cygpath: command not found
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19.1/bfd -I. -D__U
SE_MINGW_FSEEK -I. -I../../binutils-2.19.1/bfd -I../../binutils-2.19.1/bfd/../in
clude -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-format -Werror -g -
O2 -D__USE_MINGW_ACCESS -c "" -o archive.o
gcc.exe: error: : No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
make[3]: *** [archive.lo] Error 1
make[3]: Leaving directory `/usr/src/build-binutils/bfd'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/usr/src/build-binutils/bfd'
make[1]: *** [install-bfd] Error 2
make[1]: Leaving directory `/usr/src/build-binutils'
make: *** [install] Error 2
/x.sh: line 8: ../gcc-4.5.0/configure: No such file or directory
make: *** No rule to make target `all-gcc'. Stop.
make: *** No rule to make target `install-gcc'. Stop.
i am getting the same error even for the diff binutils version,i have tried binutils-2.19.1, 2.22.0, 2.23.1
so what can be the problem ??
also my mingw's gcc compiler version is 4.6.2
i've also tried the command
make CFLAGS="-Os -w"
bt still the same problem persists
I'm getting a similar error ("cygpath: command not found"), but with newer versions. FWICT there is a line within binutils that assumes that Cygwin is present, although I didn't see any notes in the build instructions saying that Cygwin was required (I might have missed it, though).
I suppose the correct approach would be to install Cygwin, but I'm not sure if that will interfere with Mingw in other ways. It looks like binutils is just trying to use cygpath to convert between O/S path naming conventions, so I got around this problem by creating a little dummy cygpath shell script:
#options described at http://cygwin-lite.sourceforge.net/html/cygpath.html
#echo "MISSING CYGPATH"
if [ "x$1" == "x-w" ]
then
echo $2 #just echo path name back as-is
else
read -p "MISSING CYGPATH. PARAMS WERE: 1=$1 2=$2 3=$3 4=$4 5=$5"
fi
I placed this on the PATH so binutils could find it, instead of getting an error during the build. This script just echoes the path name back as-is (for the path renaming scenario), since Windows seems to be able to understand Unix-style paths anyways these days (and I was running on Windows). For anything else, this script will pause and display the first few command line parameters, to provide some hints as to what further functionality is needed.
HTH someone get a little farther

How do I fix "gcc: winrespp.rc: No such file or directory" during compiling PAR::Packer on Cygwin?

I have tried to install PAR::Packer in Cygwin for Windows on a 32 bit machine, so I executed cpan pp.
I am facing the following problem.
gcc-4 -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/lib/perl5/5.14/i686-cygwin-threads-64int/CORE -DPARL_EXE=\parl.exe\ -O3 main.c windres -F pei-i386 -i winres\pp.rc -o winres\pp.res
gcc: winrespp.rc: No such file or directory
gcc: warning: '-x c' after last input file has no effect
gcc: no input files
windres: preprocessing failed.
Makefile:735: recipe for target ppresource.coff failed
make[1]: *** [ppresource.coff] Error 1
make[1]: Leaving directory /home/prabhakaran.srinivas/.cpan/build/PAR-Packer-1.013-eTAwxL/myldr
Makefile:594: recipe for target subdirs failed
make: *** [subdirs] Error 2
RSCHUPP/PAR-Packer-1.013.tar.gz
make -- NOT OK
CPAN: YAML loaded ok (v0.81)
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
The problem is in myldr/Makefile.PL:
$pre_res = qq(winres\\pp.res);
$rt_cmd = qq(windres -F pei-i386 -i winres\\pp.rc -o $pre_res);
$res_cmd = qq(windres -o ppresource.coff $pre_res);
$res_section = $res;
and, later,
$res_section:
$rt_cmd
$res_cmd
Under Cygwin's bash, winres\pp.rc would be interpreted as winrespp.rc instead of winres/pp.rc. The correct way would be
$pre_res = catfile(winres => 'pp.res');
$rt_cmd = join ' ' => qw(windres -F pei-i386 -i), catfile(winres => 'pp.rc'), '-o', $pre_res;
etc.