efivar: cannot find -lpopt - linux

I'm attempting to compile efivars on LFS for UEFI when I get the following output, even after I've compiled libpopt (attempted with and without sed -i -e "s/#MARK64#//" Makefile.am as noted in http://wiki.linuxfromscratch.org/blfs/wiki/popt):
root:/sources/efivar-28# make libdir="/usr/lib/" bindir="/usr/bin/" mandir="/usr/share/man/" includedir="/usr/include/" V=1 -j1
make[1]: Entering directory '/sources/efivar-28/src'
make -f /sources/efivar-28/src/Make.deps deps SOURCES="crc32.c creator.c disk.c gpt.c linux.c loadopt.c dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c efivarfs.c error.c export.c guid.c guids.S guid-symbols.c lib.c vars.c makeguids.c guid.c include/efivar/efivar-guids.h include/efivar/efivar.h include/efivar/efiboot.h include/efivar/efiboot-loadopt.h include/efivar/efivar-dp.h include/efivar/efiboot-creator.h include/efivar/efivar-guids.h guid-symbols.c efivar.c"
make[2]: Entering directory '/sources/efivar-28/src'
make[2]: Nothing to be done for 'deps'.
make[2]: Leaving directory '/sources/efivar-28/src'
gcc -O2 -g3 -I/sources/efivar-28/src/include/efivar/ -specs=/sources/efivar-28/gcc.specs -L. -static -o efivar-static efivar.c dp.static.o dp-acpi.static.o dp-hw.static.o dp-media.static.o dp-message.static.o efivarfs.static.o error.static.o export.static.o guid.static.o guids.static.o guid-symbols.static.o lib.static.o vars.static.o -ldl -lpopt
/usr/bin/ld: cannot find -lpopt
collect2: error: ld returned 1 exit status
make[1]: *** [/sources/efivar-28/Make.rules:17: efivar-static] Error 1
make[1]: Leaving directory '/sources/efivar-28/src'
make: *** [Makefile:11: all] Error 2
Here is the output of ld -lpopt:
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
<ld linker script here>
==================================================
attempt to open /usr/x86_64-pc-linux-gnu/lib64/libpopt.so failed
attempt to open /usr/x86_64-pc-linux-gnu/lib64/libpopt.a failed
attempt to open /usr/local/lib64/libpopt.so failed
attempt to open /usr/local/lib64/libpopt.a failed
attempt to open /lib64/libpopt.so failed
attempt to open /lib64/libpopt.a failed
attempt to open /usr/lib64/libpopt.so succeeded
-lpopt (/usr/lib64/libpopt.so)
libc.so.6 needed by /usr/lib64/libpopt.so
found libc.so.6 at /lib64/libc.so.6
ld-linux-x86-64.so.2 needed by /lib64/libc.so.6
found ld-linux-x86-64.so.2 at /lib64/ld-linux-x86-64.so.2
ld: warning: cannot find entry symbol _start; not setting start address

The issue is that LFS disabled static library's in their popt recipe. Enabling this solved the issue.

Related

undefined reference to `crypt' : apache2 manually install error on imx8mqevk

I am using an iMX8MQ EVK board with Linux. I want to install the apache2 server and MySQL database from the source. Started installing apache2 using this
Here is the Linux version:
root#imx8mqevk:~# cat /etc/os-release
ID=fsl-imx-wayland
NAME="NXP i.MX Release Distro"
VERSION="5.10-hardknott (hardknott)"
VERSION_ID=5.10-hardknott
PRETTY_NAME="NXP i.MX Release Distro 5.10-hardknott (hardknott)"
Here is the output of configure
Facing issue with make as crypto is not found. I am not able to resolve the issue.
I have tried installing glibc but the issue is not resolved.
make error
Making all in support
make[1]: Entering directory '/home/root/httpd-2.4.53/support'
make[2]: Entering directory '/home/root/httpd-2.4.53/support'
/usr/local/apr/build-1/libtool --silent --mode=link gcc -g -O2 -pthread -o htpasswd htpasswd.lo passwd_common.lo /usr/local/apr/lib/libaprutil-1.la -lexpat /usr/local/apr/lib/libapr-1.la -lrt -lpthread -ldl
/usr/lib/gcc/aarch64-poky-linux/10.2.0/../../../../aarch64-poky-linux/bin/ld: passwd_common.o: in function `mkhash':
/home/root/httpd-2.4.53/support/passwd_common.c:228: undefined reference to `crypt'
/usr/lib/gcc/aarch64-poky-linux/10.2.0/../../../../aarch64-poky-linux/bin/ld: /home/root/httpd-2.4.53/support/passwd_common.c:240: undefined reference to `crypt'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:48: htpasswd] Error 1
make[2]: Leaving directory '/home/root/httpd-2.4.53/support'
make[1]: *** [/home/root/httpd-2.4.53/build/rules.mk:75: all-recursive] Error 1
make[1]: Leaving directory '/home/root/httpd-2.4.53/support'
make: *** [/home/root/httpd-2.4.53/build/rules.mk:75: all-recursive] Error 1

Building Debian with Buildroot: libDeviceIo.so: file format not recognized

Im trying to compile for a project debian for this device: https://www.engicam.com/vis-prod/PX30-Core/PX30-Core-EDIMM-SOM-based-on-RockChip--PX30 which has an aarch64 architecture. I'm using a VM provided by them which should already have all the tools and configurations ready, but I'm running into some issues. If I've understood correctly I have to build buildroot to build Debian, after adding a couple packages with make menuconfig and running make I get this error:
PATH="/home/user/px30/buildroot/output/host/bin:/home/user/px30/buildroot/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" /usr/bin/make -j9 CXXFLAGS+="-DRKDEVICEIO -I/home/user/px30/buildroot/../external/deviceio_release/DeviceIO/include" LFLAGS+=" -lDeviceIo -lasound" -C /home/user/px30/buildroot/output/build/qsetting-1.0
make[1]: Entering directory '/home/user/px30/buildroot/output/build/qsetting-1.0'
/home/user/px30/buildroot/output/host/bin/aarch64-buildroot-linux-gnu-g++ -lDeviceIo -lasound -o qsetting main.o mainwindow.o qtaudio.o qtbt.o qtfactory.o qtinputdialog.o qtkeyboard.o qtupdate.o qtwifi.o qrc_res.o moc_mainwindow.o moc_qtaudio.o moc_qtbt.o moc_qtfactory.o moc_qtinputdialog.o moc_qtkeyboard.o moc_qtupdate.o moc_qtwifi.o -lQt5Widgets -lQt5Multimedia -lQt5Gui -lQt5Network -lQt5Core -latomic -lrt -ldl /home/user/px30/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libGLESv2.so -lpthread -lrt -lpthread -ldl
/home/user/px30/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/6.5.0/../../../../aarch64-buildroot-linux-gnu/bin/ld:/home/user/px30/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/../lib64/libDeviceIo.so: file format not recognized; treating as linker script
/home/user/px30/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/6.5.0/../../../../aarch64-buildroot-linux-gnu/bin/ld:/home/user/px30/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/../lib64/libDeviceIo.so:0: syntax error
collect2: error: ld returned 1 exit status
Makefile:214: recipe for target 'qsetting' failed
make[1]: *** [qsetting] Error 1
make[1]: Leaving directory '/home/user/px30/buildroot/output/build/qsetting-1.0'
package/pkg-generic.mk:254: recipe for target '/home/user/px30/buildroot/output/build/qsetting-1.0/.stamp_built' failed
make: *** [/home/user/px30/buildroot/output/build/qsetting-1.0/.stamp_built] Error 2
I tried to open /px30/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libDeviceIo.so and it's an ASCII file
user#ubuntu:~/px30/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib$ cat libDeviceIo.so
fake
user#ubuntu:~/px30/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib$ file libDeviceIo.so
libDeviceIo.so: ASCII text
EDIT: I did not find a solution, I solved it by removing the package qsetting from the target packages

Tag command not found when running make on crosstool-ng

For some reason on my ubuntu system, running make on crosstool-ng throws this error. I tried seeing if I could find a package that has the tag command but I dont think that this exists.
/usr/bin/make all-recursive
make[1]: Entering directory '/home/rahul/crosstool-ng'
Making all in kconfig
make[2]: Entering directory '/home/rahul/crosstool-ng/kconfig'
/usr/bin/make all-am
make[3]: Entering directory '/home/rahul/crosstool-ng/kconfig'
tag CC --mode=link gcc -g -O2 -o conf conf.o zconf.o
/bin/bash: tag: command not found
Makefile:497: recipe for target 'conf' failed
make[3]: [conf] Error 127 (ignored)
tag CC --mode=link gcc -D_GNU_SOURCE -I/usr/include/ncursesw -g -O2 -o nconf nconf-nconf.o nconf-nconf.gui.o nconf-zconf.o -lmenuw -lpanelw -lncursesw -ltinfo
/bin/bash: tag: command not found
Makefile:523: recipe for target 'nconf' failed
make[3]: [nconf] Error 127 (ignored)
tag CC --mode=link gcc -g -O2 -o mconf mconf.o zconf.o lxdialog/checklist.o lxdialog/inputbox.o lxdialog/menubox.o lxdialog/textbox.o lxdialog/util.o lxdialog/yesno.o -lncursesw -ltinfo
/bin/bash: tag: command not found
Makefile:519: recipe for target 'mconf' failed
make[3]: [mconf] Error 127 (ignored)
make[3]: Leaving directory '/home/rahul/crosstool-ng/kconfig'
make[2]: Leaving directory '/home/rahul/crosstool-ng/kconfig'
make[2]: Entering directory '/home/rahul/crosstool-ng'
make[2]: Leaving directory '/home/rahul/crosstool-ng'
make[1]: Leaving directory '/home/rahul/crosstool-ng'
If you are still looking for the answer you can find it here: https://github.com/crosstool-ng/crosstool-ng/issues/944#issuecomment-381447332
You just need to run apt install libtool-bin.

Installing OSVR on Linux - Setting binary directory

I am currently trying to install OSVR-Core on my Debian 9.1 system. I installed all the prerequisites and followed this tutorial. Now I am stuck at making the project. I created a build-directory and tried running
cmake -DCMAKE_PREFIX_PATH="/usr/local/stow/libfunctionality" ~/src/OSVR-Core
but I get the error, that my binary directory should be different from my source directory. My source directory (with the make-files) should be ~/src/OSVR-Core and since I am in ~/src/OSVR-Core/build, I thought this was enough.
How (and where) do I change the location of the binary directory? I tried the command line option -D CMAKE_BINARY_DIR= "path/to/OSVR-Core/build but that did not work. I read online, that you should not set the Binary directory manually, but that it is created/calculated.
This is the CMakeError.log file:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/lenala/src/OSVR-Core/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_42e59/fast"
/usr/bin/make -f CMakeFiles/cmTC_42e59.dir/build.make CMakeFiles/cmTC_42e59.dir/build
make[1]: Entering directory '/home/lenala/src/OSVR-Core/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_42e59.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_42e59.dir/CheckSymbolExists.c.o -c /home/lenala/src/OSVR-Core/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_42e59
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_42e59.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_42e59.dir/CheckSymbolExists.c.o -o cmTC_42e59 -rdynamic
CMakeFiles/cmTC_42e59.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_42e59.dir/build.make:97: recipe for target 'cmTC_42e59' failed
make[1]: *** [cmTC_42e59] Error 1
make[1]: Leaving directory '/home/lenala/src/OSVR-Core/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_42e59/fast' failed
make: *** [cmTC_42e59/fast] Error 2
File /home/lenala/src/OSVR-Core/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /home/lenala/src/OSVR-Core/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_f2984/fast"
/usr/bin/make -f CMakeFiles/cmTC_f2984.dir/build.make CMakeFiles/cmTC_f2984.dir/build
make[1]: Entering directory '/home/lenala/src/OSVR-Core/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f2984.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_f2984.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.7/Modules/CheckFunctionExists.c
Linking C executable cmTC_f2984
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f2984.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_f2984.dir/CheckFunctionExists.c.o -o cmTC_f2984 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_f2984.dir/build.make:97: recipe for target 'cmTC_f2984' failed
make[1]: *** [cmTC_f2984] Error 1
make[1]: Leaving directory '/home/lenala/src/OSVR-Core/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_f2984/fast' failed
make: *** [cmTC_f2984/fast] Error 2
Have you used the
cmake .. -DJSONCPP_WITH_CMAKE_PACKAGE=ON -DJSONCPP_LIB_BUILD_SHARED=OFF -DCMAKE_CXX_FLAGS=-fPIC
since that's what the tutorial says to use to build the project and that the CMakaList.txt will handle all the paths.
I managed to get it to work. I reinstalled libfunctionality in my ~/src directory. Then I removed the github repository of OSVR-core and cloned it again. After that it worked, using:
$ cmake .. -DJSONCPP_WITH_CMAKE_PACKAGE=ON -DJSONCPP_LIB_BUILD_SHARED=OFF -DCMAKE_CXX_FLAGS=-fPIC
$ make

Libspotify on Raspbian - compiling the examples

I'm trying to compile the examples provided with Libspotify on my Raspberry Pi B. Had a load of errors about alsa to start with, but managed to fix them by installing libasound2-dev.
Now I'm getting the following error when I try to compile - does anyone have any suggestions, please?
The problem seems to be stemming from
/usr/bin/ld: alsa-audio.o: undefined reference to symbol
'pthread_create##GLIBC_2.4' //lib/arm-linux-gnueabihf/libpthread.so.0:
error adding symbols: DSO missing from command line
Terminal output:
for a in jukebox spshell localfiles; do make -C $a all; done
make[1]: Entering directory '/home/username/Downloads/libspotify-12.1.103-Linux-armv6-bcm2708hardfp-release/share/doc/libspotify/examples/jukebox'
cc -I/usr/include/alsa -I/usr/local/include -Wall -L/usr/local/lib jukebox.o appkey.o alsa-audio.o audio.o -o jukebox -lasound -lspotify
/usr/bin/ld: alsa-audio.o: undefined reference to symbol 'pthread_create##GLIBC_2.4'
//lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:21: recipe for target 'jukebox' failed
make[1]: *** [jukebox] Error 1
make[1]: Leaving directory '/home/username/Downloads/libspotify-12.1.103-Linux-armv6-bcm2708hardfp-release/share/doc/libspotify/examples/jukebox'
make[1]: Entering directory '/home/username/Downloads/libspotify-12.1.103-Linux-armv6-bcm2708hardfp-release/share/doc/libspotify/examples/spshell'
cc -I/usr/local/include -Wall -L/usr/local/lib spshell.o spshell_posix.o appkey.o cmd.o browse.o search.o toplist.o inbox.o star.o playlist.o test.o -lreadline -lspotify -o spshell
/usr/bin/ld: spshell_posix.o: undefined reference to symbol 'pthread_create##GLIBC_2.4'
//lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'spshell' failed
make[1]: *** [spshell] Error 1
make[1]: Leaving directory '/home/username/Downloads/libspotify-12.1.103-Linux-armv6-bcm2708hardfp-release/share/doc/libspotify/examples/spshell'
make[1]: Entering directory '/home/username/Downloads/libspotify-12.1.103-Linux-armv6-bcm2708hardfp-release/share/doc/libspotify/examples/localfiles'
make[1]: Leaving directory '/home/username/Downloads/libspotify-12.1.103-Linux-armv6-bcm2708hardfp-release/share/doc/libspotify/examples/localfiles'

Resources