Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
2 answers
3392 views
Cross-compile libgpiod library and use it in my program
I am trying to cross-compile a program with the "gpiod" library. My host pc has Ubuntu 18.04 and the target platform I am cross-compiling for is a Board with IMX8X SOM. I found source code at https://variwiki.com/index.php?title=MX8_GPIO&release=RELEASE_DUNFELL_V1.3_VAR-SOM-MX8X and I wanted to comp...
I am trying to cross-compile a program with the "gpiod" library. My host pc has Ubuntu 18.04 and the target platform I am cross-compiling for is a Board with IMX8X SOM. I found source code at https://variwiki.com/index.php?title=MX8_GPIO&release=RELEASE_DUNFELL_V1.3_VAR-SOM-MX8X and I wanted to compile it, following the paragraph "2.2 libgpiod C Application". The OS used in my board is the "dunfell" distro compiled with Yocto. The cross-compiler I am using is also created as sdk withing the Yocto environments (aarch64-fslc-linux-gcc). When I compiled, I firstly obtained "fatal error: gpiod.h: No such file or directory" So, this library is not included by default in the provided toolchain. So I tried to install the (cross)library in my pc, following the instructions at https://www.beyondlogic.org/an-introduction-to-chardev-gpio-and-libgpiod-on-the-raspberry-pi/ , but it did not work. The second error I get is /opt/fslc-wayland/3.1/sysroots/x86_64-fslcsdk-linux/usr/libexec/aarch64-fslc-linux/gcc/aarch64-fslc-linux/9.3.0/real-ld: cannot find -lgpiod collect2: error: ld returned 1 exit status These are my compilation flags: CFLAGS = -Wall -I$(INCLUDE) --sysroot=${SDKTARGETSYSROOT} -Og -lgpiod I am new to this kind of issues and I hope I am making trivial mistakes. Thanks in advance if someone is able to help!
powermignolo (11 rep)
Dec 29, 2021, 11:56 AM • Last activity: Jul 15, 2025, 08:07 AM
5 votes
2 answers
2058 views
How to convince APT that a cross-arch package is installed manually?
I have a qemu-armhf chroot environment on an amd64 machine (it's mainly for compiling Raspberry Pi code). As such it can run both armhf and amd64 binaries but it's faster doing the latter. There are certain packages (such as make) where I've installed the amd64 version inside the chroot in order to...
I have a qemu-armhf chroot environment on an amd64 machine (it's mainly for compiling Raspberry Pi code). As such it can run both armhf and amd64 binaries but it's faster doing the latter. There are certain packages (such as make) where I've installed the amd64 version inside the chroot in order to get better speed. That works well up until I need to apt-get some other armhf package and it happens to have make listed as a dependency, whereupon I get this: The following packages have unmet dependencies: build-essential : Depends: make but it is not going to be installed dpkg-dev : Depends: make but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). If I try the suggested command, then it says it wants to install make:armhf and uninstall make:amd64. I don't want it to do that. How do I tell APT that make:armhf is already installed (because I want it to use make:amd64 to satisfy dependencies) without actually installing it? I've tried using apt-mark manual make but it says that it is not installed. ---- I know this probably isn't the right way to do it, but I've been looking at the /var/lib/dpkg/status file to try to work out how it thinks the package definitions work and to try to trick it into agreeing that make:amd64 satisfies make:armhf as well. In particular I noticed that "libbz2-1.0" is a package that's listed as installed twice; once as: Architecture: armhf Multi-Arch: same Pre-Depends: multiarch-support and once as: Architecture: amd64 Multi-Arch: foreign Pre-Depends: multiarch-support So I tried duplicating the entries for "make" similarly, setting all of those values above. But now APT's just saying that "make" and "make:amd64" are conflicted. Why is it a conflict when make does it but not when libbz2-1.0 does it? (I hope it's not special-casing libraries; that seems like it should be a bug.) ---- Per [this answer](https://unix.stackexchange.com/a/149799/78162) , I tried building a dummy package with equivs and installing that (after removing my manual fiddling above), but installing it produces these errors: # dpkg -i /var/cache/apt/archives/make_3.81-8.2_amd64.deb (real amd64 make) # dpkg -i make_3.81-8.2_armhf.deb (fake armhf depends on the above) Preparing to replace make 3.81-8.2 (using make_3.81-8.2_armhf.deb) ... Unpacking replacement make ... dpkg: dependency problems prevent configuration of make: make depends on make:amd64 (= 3.81-8.2). So again the problem looks like it thinks make:armhf is a *replacement* for make:amd64, and I don't know how to tell it that I want these two packages to coexist. (It doesn't seem to have a problem with the idea of two libbz2 packages coexisting, for example.)
Miral (369 rep)
Aug 11, 2014, 07:57 AM • Last activity: Jul 4, 2025, 02:07 PM
0 votes
1 answers
2805 views
ARM cross-compiler not recognized in MX Linux during STM32 development
I am using MX Linux OS and trying to work with the STM32F103C8T6 MCU. Following the user manual *Beginning STM32* by Warren Gay, I successfully installed the Git clone of `stm32f103c8t6`, `libopencm3`, and `FreeRTOS` as per the manual. When I downloaded and unzipped the ARM cross-compiler, the files...
I am using MX Linux OS and trying to work with the STM32F103C8T6 MCU. Following the user manual *Beginning STM32* by Warren Gay, I successfully installed the Git clone of stm32f103c8t6, libopencm3, and FreeRTOS as per the manual. When I downloaded and unzipped the ARM cross-compiler, the files were saved under the /opt/gcc-arm folder. Upon typing arm-none-eabi-gcc --version, I encountered a "command not found" error. Upon further investigation, I typed:
$ ls -l /opt/gcc-arm/bin
It listed arm-none-eabi-gcc in the following format (in green):
-rwxr-xr-x 2 1001 1001  1296976 Nov 24  2020 arm-none-eabi-gcc
Similarly, the type gcc command gives the output:
gcc is /usr/bin/gcc
Instead of:
arm-none-eabi-gcc is hashed (/opt/gcc-arm/bin/gcc)
as mentioned in the user manual. The type arm-none-eabi-gcc command outputs:
not found
As I understand, the green color of the file means it is executable, but I am unable to determine why the computer is not recognizing the command. Finally, when running the make command, I received the following response:
user@mx:~/stm32f103c8t6
$ make
make -C libopencm3 TARGETS=stm32/f1
make: Entering directory '/home/user/stm32f103c8t6/libopencm3'
  BUILD   lib/stm32/f1
  CC      adc.c
make: arm-none-eabi-gcc: Command not found
make: *** [../../Makefile.include:41: adc.o] Error 127
Failure building: lib/stm32/f1: code: 2
make: *** [Makefile:79: lib] Error 1
make: Leaving directory '/home/user/stm32f103c8t6/libopencm3'
make: *** [Makefile:38: libopencm3/lib/libopencm3_stm32f1.a] Error 2
Deepak Kumar (1 rep)
Jul 23, 2021, 10:52 AM • Last activity: Jun 13, 2025, 12:01 PM
0 votes
1 answers
1966 views
How do I install Chromium for ARM Cortex-A8 on bare Linux 3.0.8 armv7l?
### TARGET [FriendlyARM mini210s](http://www.friendlyarm.net/products/mini210s) I have successfully cross-compiled Chromium for ARM [SEE WORKFLOW HERE](https://unix.stackexchange.com/questions/176794/how-do-i-cross-compile-chromium-for-arm). ## How do I install the Chromium on my bare linux 3.0.8 ar...
### TARGET [FriendlyARM mini210s](http://www.friendlyarm.net/products/mini210s) I have successfully cross-compiled Chromium for ARM [SEE WORKFLOW HERE](https://unix.stackexchange.com/questions/176794/how-do-i-cross-compile-chromium-for-arm) . ## How do I install the Chromium on my bare linux 3.0.8 armv7l? ### What I have done so far I copied over ./chrome/installer/linux/debian_wheezy_arm-sysroot files onto my target (not sure that was the right thing, but it seems reasonable enough) When I try to run Chrome I am getting this error: [root@target chrome-release]# ./chrome ./chrome: error while loading shared libraries: libattr.so.1: cannot open shared object file: No such file or directory ##### UPDATE I resolved this particular issue [here](https://unix.stackexchange.com/questions/180099/chromium-compiled-for-arm-libattr-so-1-not-found) #### QUESTION 1 : Where do I find libattr source or binary and install it on my target? I have found a file, but I'd rather try to x-compile from source. #### QUESTION 2 : How do I have resolved consistantly without breaking my target? [This helped](https://stackoverflow.com/questions/5216399/usr-lib-libstdc-so-6-version-glibcxx-3-4-15-not-found) ... but I feel that I am messing my Linux 3.0.8 armv7l instance. [root@target chrome-release]# ./chrome ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./chrome) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./chrome) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libkeyed_service_content.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libkeyed_service_content.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libkeyboard.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libbase_prefs.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libstorage.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libstorage.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libnet.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libnet.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgfx.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libgfx.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libmessage_center.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libviews.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libviews.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libevents_devices.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libcontent.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libcontent.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libv8.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libv8.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libdbus.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libskia.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libppapi_proxy.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libppapi_proxy.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libprinting.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libdomain_reliability.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libapp_list.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libmojo_common_lib.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libblink_web.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libblink_web.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgcm.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libmedia.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libmedia.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libbase_i18n.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libui_base.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libui_base.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libstorage_common.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libppapi_host.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libsessions_content.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libcc.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libcc.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libbase.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libbase.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libevents_base.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/liburl_matcher.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgin.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libcompositor.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libash.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libash.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libmojo_system_impl.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgtk2ui.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libgtk2ui.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libpolicy_component.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libpolicy_component.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libsql.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libblink_platform.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libdevice_bluetooth.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libdevice_bluetooth.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/liburl_lib.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libcrcrypto.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libcrcrypto.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libaura.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libipc.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libipc.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libsync_core.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgpu.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libgpu.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgesture_detection.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libevents.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libppapi_shared.so) ./chrome: /lib/libc.so.6: version `GLIBC_2.9' not found (required by /usr/lib/libgio-2.0.so.0) ./chrome: /lib/libc.so.6: version `GLIBC_2.9' not found (required by /lib/libglib-2.0.so.0) ./chrome: /lib/libc.so.6: version `GLIBC_2.11' not found (required by /usr/lib/libcairo.so.2) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libcc_surfaces.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libcc_surfaces.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libdevice_battery.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libdevice_battery.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libwebkit_gpu.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgl_wrapper.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libmedia_blink.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgpu_blink.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libipc_mojo.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgles2_utils.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgles2_implementation.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /sdcard/chrome-release/lib/libgles2_implementation.so) ./chrome: /lib/libc.so.6: version `GLIBC_2.10' not found (required by /lib/libdbus-1.so.3) ./chrome: /lib/libc.so.6: version `GLIBC_2.11' not found (required by /usr/lib/libfreetype.so.6) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libwtf_unittest_helpers.so) ./chrome: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /sdcard/chrome-release/lib/libgl_in_process_context.so) ./chrome: /lib/libresolv.so.2: version `GLIBC_2.9' not found (required by /usr/lib/libkrb5.so.3) ## UPDATE - Install on mini210s w/ linux 3.0.8 armv7l target When I try this: # LD_PRELOAD=/lib/libc-2.13.so;/lib/libresolv-2.13.so ./chrome -v Segmentation fault #### How do get more information about the reason of this segmentation fault? $ file ./chrome ./chrome: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, not stripped How do I know whether this compiled file should run on my SBC w/ linuc 3.0.8 armv7l? Also asked on [chromium-dev group](https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/_8VUllVuMyc) ## UPDATE Tried to install on BeagleBone Black root@beaglebone:~/chromium# uname -a Linux beaglebone 3.8.13-bone67 #1 SMP Wed Sep 24 21:30:03 UTC 2014 armv7l GNU/Linux I am getting the same segmentation fault root@beaglebone:~/chromium# ./chrome Segmentation fault Determine file type root@beaglebone:~/chromium# file chrome chrome: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x99f2a5210e0831419cf2bb4c9c64839cf03673f4, not stripped
zabumba (954 rep)
Jan 13, 2015, 10:53 AM • Last activity: Jun 11, 2025, 06:01 PM
0 votes
1 answers
2038 views
(Buildroot) "silentoldconfig" error on compile
I just moved an old buildroot folder from an old VM to a newer one to consolidate. I thought that simply moving the folder, along with any dependent folders, and making the appropriate path/name changes would be all that is required to get it up and running in the new VM. Unfortunately, this appears...
I just moved an old buildroot folder from an old VM to a newer one to consolidate. I thought that simply moving the folder, along with any dependent folders, and making the appropriate path/name changes would be all that is required to get it up and running in the new VM. Unfortunately, this appears to not be the case as I am greeted with the following error upon attempting to build in this new VM: # # configuration written to /home/mirion/mirion/buildroot-2013.05/.config # /usr/bin/make -j5 HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig make: Entering directory '/home/mirion/mirion/buildroot-2013.05' BR2_DEFCONFIG='' KCONFIG_AUTOCONFIG=/home/mirion/mirion/buildroot-2013.05/output/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/mirion/mirion/buildroot-2013.05/output/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/mirion/mirion/buildroot-2013.05/output/build/buildroot-config/tristate.config BUILDROOT_CONFIG=/home/mirion/mirion/buildroot-2013.05/.config /home/mirion/mirion/buildroot-2013.05/output/build/buildroot-config/conf --silentoldconfig Config.in *** Error during update of the configuration. Makefile:692: recipe for target 'silentoldconfig' failed make: *** [silentoldconfig] Error 1 make: Leaving directory '/home/mirion/mirion/buildroot-2013.05' Makefile:396: recipe for target '/home/mirion/mirion/buildroot-2013.05/output/build/buildroot-config/auto.conf' failed make: *** [/home/mirion/mirion/buildroot-2013.05/output/build/buildroot-config/auto.conf] Error 2 mv: cannot stat 'output/images/rootfs.ubi': No such file or directory Are there any ideas as to what I can do to resolve this? I did some poking around on google but could not find anything conclusive. EDIT: Original VM was running Lubuntu 12.04, the new VM is running Ubuntu 17.10. Thanks.
lukemk1 (39 rep)
Apr 9, 2018, 05:57 PM • Last activity: Jun 1, 2025, 08:04 AM
4 votes
1 answers
2443 views
Cross-compiling and CMake
I am trying to cross-compile [CGAL](http://www.cgal.org) on an amd64 Linux machine to the ARM architecture. CGAL uses [CMake](http://www.cmake.org/) for building. CGAL has several dependencies, including [GMP](http://gmplib.org/) and [MPFR](http://www.mpfr.org/) libraries. When CMake runs, it needs...
I am trying to cross-compile [CGAL](http://www.cgal.org) on an amd64 Linux machine to the ARM architecture. CGAL uses [CMake](http://www.cmake.org/) for building. CGAL has several dependencies, including [GMP](http://gmplib.org/) and [MPFR](http://www.mpfr.org/) libraries. When CMake runs, it needs to determine the versions of these dependencies. To find the versions, CMake compiles and runs several small test programs that simply link with these libraries and output their versions. This works fine during a regular, non-cross-compiled build. But when I cross-compile, naturally these test programs will not run on the host machine. Here's an example: /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1 /opt/Company/ArmTools_GCC435_GLIBC_Q3_2011/bin/arm-rc-linux-gnueabi-g++ -fPIC CMakeFiles/cmTryCompileExec.dir/print_GMP_version.cpp.o -o cmTryCompileExec -rdynamic /home/pmw/Software-Engineering/build/Lib/mpir-2.6.0/arm/lib/libgmp.a gmake: Leaving directory `/home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp' /home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp/cmTryCompileExec: /home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp/cmTryCompileExec: cannot execute binary file -- USING GMP_VERSION = 'unknown' I found [a suggestion](http://www.cmake.org/Wiki/BuildingPythonWithCMake#Cross_compiling_Python_for_another_platform) (if I understand it correctly) to specify the GMP version explicitly; that should keep CMake from trying and failing to determine it. So I created a file containing this line: SET(GMP_VERSION 2.6.0) and invoked CMake with the argument -C path/to/my/file. But that didn't change anything. Then I tried invoking CMake with the argument -DCMAKE_TOOLCHAIN_FILE=/path/to/my/file instead. Again, no effect. I see that CMake is able to find and parse this file, however. So, how can I convince CMake to not try to build and execute cross-compiled programs on the host machine? I apologize in advance if this Unix & Linux StackExchange site is not the best place for this question. Last week [I posted my question on the CGAL mailing list](https://sympa.inria.fr/sympa/arc/cgal-discuss/2009-01/msg00203.html) (which is now the top three Google results for "cross-compiling cgal"; I am famous!) but received no replies.
Philip (293 rep)
Nov 19, 2012, 11:19 PM • Last activity: May 30, 2025, 05:03 PM
2 votes
1 answers
2724 views
libzip Linux cross-compile configuration
I am trying to cross compile **libzip-1.5.1** having previously successfully complied **zlib-1.2.11** (these are required by libzip and I have installed in a local home path), but I am experiencing problems with the cmake's process. The script I use to build and compile (from a build directory into...
I am trying to cross compile **libzip-1.5.1** having previously successfully complied **zlib-1.2.11** (these are required by libzip and I have installed in a local home path), but I am experiencing problems with the cmake's process. The script I use to build and compile (from a build directory into the libzip's sources folder) is the following: #!/bin/sh PREFIX=${PWD}/install CCPATH=/opt/arm64/gcc-linaro-6.3.1-2017.02-rc2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf ZLIBPATH=${PWD}/../../zlib-1.2.11/ # here is where zlib is installed # ZLIBINSTALLEDPATH contains include, lib, share directories ZLIBINSTALLEDPATH=${ZLIBPATH}/build_armhf64/install/ export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${ZLIBINSTALLEDPATH}/lib/pkgconfig/" export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${ZLIBINSTALLEDPATH}/lib/" export CMAKE_AR=${CCPATH}-ar export CC=${CCPATH}-gcc export CXX=${CCPATH}-g++ export CMAKE_LINKER=${CCPATH}-ld export CMAKE_RANLIB=${CCPATH}-ranlib export CMAKE_OBJDUMP=${CCPATH}-objdump export CMAKE_OBJCOPY=${CCPATH}-objcopy export CMAKE_STRIP=${CCPATH}-strip #export CMAKE_READELF=${CCPREFIX}-readelf export CMAKE_NM=${CCPATH}-nm cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DZLIB_INCLUDE_DIR=${ZLIBINSTALLEDPATH}/include/ \ -DZLIB_LIBRARY=${ZLIBINSTALLEDPATH}/lib/ \ ../ make -j 8 But at 94 % of building process, I get the following errors: [ 92%] Building C object regress/CMakeFiles/tryopen.dir/tryopen.c.o [ 94%] Building C object src/CMakeFiles/zipcmp.dir/zipcmp.c.o [ 94%] Linking C executable add_from_filep [ 94%] Linking C executable fopen_unchanged [ 94%] Linking C executable tryopen [ 94%] Building C object regress/CMakeFiles/hole.dir/source_hole.c.o [ 94%] Linking C executable zipmerge ../lib/libzip.so.5.0: undefined reference to `inflate' ../lib/libzip.so.5.0: undefined reference to `crc32' ../lib/libzip.so.5.0: undefined reference to `zError' ../lib/libzip.so.5.0: undefined reference to `deflate' ../lib/libzip.so.5.0: undefined reference to `deflateInit2_' ../lib/libzip.so.5.0: undefined reference to `inflateEnd' ../lib/libzip.so.5.0: undefined reference to `deflateEnd' ../lib/libzip.so.5.0: undefined reference to `inflateInit2_' collect2: error: ld returned 1 exit status regress/CMakeFiles/add_from_filep.dir/build.make:95: recipe for target 'regress/add_from_filep' failed make: *** [regress/add_from_filep] Error 1 CMakeFiles/Makefile2:726: recipe for target 'regress/CMakeFiles/add_from_filep.dir/all' failed make: *** [regress/CMakeFiles/add_from_filep.dir/all] Error 2 make: *** Waiting for unfinished jobs.... ../lib/libzip.so.5.0: undefined reference to `inflate' ../lib/libzip.so.5.0: undefined reference to `crc32' ../lib/libzip.so.5.0: undefined reference to `zError' ../lib/libzip.so.5.0: undefined reference to `deflate' ../lib/libzip.so.5.0: undefined reference to `deflateInit2_' ../lib/libzip.so.5.0: undefined reference to `inflateEnd' ../lib/libzip.so.5.0: undefined reference to `deflateEnd' ../lib/libzip.so.5.0: undefined reference to `inflateInit2_' collect2: error: ld returned 1 exit status regress/CMakeFiles/tryopen.dir/build.make:95: recipe for target 'regress/tryopen' failed make: *** [regress/tryopen] Error 1 CMakeFiles/Makefile2:800: recipe for target 'regress/CMakeFiles/tryopen.dir/all' failed make: *** [regress/CMakeFiles/tryopen.dir/all] Error 2 ../lib/libzip.so.5.0: undefined reference to `inflate' ../lib/libzip.so.5.0: undefined reference to `crc32' ../lib/libzip.so.5.0: undefined reference to `zError' ../lib/libzip.so.5.0: undefined reference to `deflate' ../lib/libzip.so.5.0: undefined reference to `deflateInit2_' ../lib/libzip.so.5.0: undefined reference to `inflateEnd' ../lib/libzip.so.5.0: undefined reference to `deflateEnd' ../lib/libzip.so.5.0: undefined reference to `inflateInit2_' collect2: error: ld returned 1 exit status regress/CMakeFiles/fopen_unchanged.dir/build.make:95: recipe for target 'regress/fopen_unchanged' failed make: *** [regress/fopen_unchanged] Error 1 CMakeFiles/Makefile2:615: recipe for target 'regress/CMakeFiles/fopen_unchanged.dir/all' failed make: *** [regress/CMakeFiles/fopen_unchanged.dir/all] Error 2 [ 94%] Building C object regress/CMakeFiles/ziptool_regress.dir/source_hole.c.o ../lib/libzip.so.5.0: undefined reference to `inflate' ../lib/libzip.so.5.0: undefined reference to `crc32' ../lib/libzip.so.5.0: undefined reference to `zError' ../lib/libzip.so.5.0: undefined reference to `deflate' ../lib/libzip.so.5.0: undefined reference to `deflateInit2_' ../lib/libzip.so.5.0: undefined reference to `inflateEnd' ../lib/libzip.so.5.0: undefined reference to `deflateEnd' ../lib/libzip.so.5.0: undefined reference to `inflateInit2_' collect2: error: ld returned 1 exit status src/CMakeFiles/zipmerge.dir/build.make:95: recipe for target 'src/zipmerge' failed make: *** [src/zipmerge] Error 1 CMakeFiles/Makefile2:432: recipe for target 'src/CMakeFiles/zipmerge.dir/all' failed make: *** [src/CMakeFiles/zipmerge.dir/all] Error 2 [ 94%] Linking C executable zipcmp [ 94%] Linking C executable ziptool [ 96%] Linking C executable hole CMakeFiles/zipcmp.dir/zipcmp.c.o.:. /Inlib /functionlibzip.so.5.0 :` compute_crcundefined' :reference zipcmp.cto: (`.inflatetext'+ 0x4a0.).:/ libundefined/ libzip.so.5.0reference: toundefined `referencecrc32 'to zipcmp.c`:crc32('. text.+.0x53e/)lib:/ libzip.so.5.0undefined: referenceundefined toreference tocrc32 ' zErrorCMakeFiles'/ zipcmp.dir./.zipcmp.c.o/:lib /Inlibzip.so.5.0 :function undefined` test_filereference': zipcmp.cto: (`.deflatetext'+ 0x1494.).:/ libundefined/ libzip.so.5.0reference: toundefined `referencecrc32' zipcmp.c:(.text+0x14fe): undefined reference to `crc32' .. /tolib /`libzip.so.5.0deflateInit2_:' undefined. .reference/ libto/ libzip.so.5.0`:inflate 'undefined .reference. /tolib /`libzip.so.5.0inflateEnd:' undefined. .reference/ libto/ libzip.so.5.0`:zError 'undefined .reference. /tolib /libzip.so.5.0deflateEnd:' undefined reference to deflate' . ../.lib//liblibzip.so.5.0/:libzip.so.5.0 :undefined undefinedreference referenceto to deflateInit2_'inflateInit2_ '. ./lib/libzip.so.5.0: undefined reference to `inflateEnd' ../lib/libzip.so.5.0: undefined reference to `deflateEnd' ../lib/libzip.so.5.0: undefined reference to `collect2: error: ld returned 1 exit status inflateInit2_' collect2: error: ld returned 1 exit status src/CMakeFiles/ziptool.dir/build.make:95: recipe for target 'src/ziptool' failed make: *** [src/ziptool] Error 1 src/CMakeFiles/zipcmp.dir/build.make:95: recipe for target 'src/zipcmp' failed make: *** [src/zipcmp] Error 1 CMakeFiles/Makefile2:469: recipe for target 'src/CMakeFiles/ziptool.dir/all' failed make: *** [src/CMakeFiles/ziptool.dir/all] Error 2 CMakeFiles/Makefile2:395: recipe for target 'src/CMakeFiles/zipcmp.dir/all' failed make: *** [src/CMakeFiles/zipcmp.dir/all] Error 2 ../lib/libzip.so.5.0: undefined reference to `inflate' ../lib/libzip.so.5.0: undefined reference to `crc32' ../lib/libzip.so.5.0: undefined reference to `zError' ../lib/libzip.so.5.0: undefined reference to `deflate' ../lib/libzip.so.5.0: undefined reference to `deflateInit2_' ../lib/libzip.so.5.0: undefined reference to `inflateEnd' ../lib/libzip.so.5.0: undefined reference to `deflateEnd' ../lib/libzip.so.5.0: undefined reference to `inflateInit2_' collect2: error: ld returned 1 exit status [ 98%] Linking C executable ziptool_regress regress/CMakeFiles/hole.dir/build.make:121: recipe for target 'regress/hole' failed make: *** [regress/hole] Error 1 CMakeFiles/Makefile2:652: recipe for target 'regress/CMakeFiles/hole.dir/all' failed make: *** [regress/CMakeFiles/hole.dir/all] Error 2 ../lib/libzip.so.5.0: undefined reference to `inflate' ../lib/libzip.so.5.0: undefined reference to `crc32' ../lib/libzip.so.5.0: undefined reference to `zError' ../lib/libzip.so.5.0: undefined reference to `deflate' ../lib/libzip.so.5.0: undefined reference to `deflateInit2_' ../lib/libzip.so.5.0: undefined reference to `inflateEnd' ../lib/libzip.so.5.0: undefined reference to `deflateEnd' ../lib/libzip.so.5.0: undefined reference to `inflateInit2_' collect2: error: ld returned 1 exit status regress/CMakeFiles/ziptool_regress.dir/build.make:121: recipe for target 'regress/ziptool_regress' failed make: *** [regress/ziptool_regress] Error 1 CMakeFiles/Makefile2:689: recipe for target 'regress/CMakeFiles/ziptool_regress.dir/all' failed make: *** [regress/CMakeFiles/ziptool_regress.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 It seems that cmake cannot find the compiled zlib libraries, even if the paths seems to be well configured (or not ?). Do some has experienced similar issues with libzip ? Is there any addition cmake's macro that would solve this issue ? **---- UPDATE ----** ---------- I actually get rid of this error suppressing building task for **zipcmp**, **zipmerge** and **ziptool** (since I don't need them) commenting the lines: #ADD_EXECUTABLE(zipcmp zipcmp.c ${SRC_EXTRA_FILES}) #TARGET_LINK_LIBRARIES(zipcmp zip) #INSTALL(TARGETS zipcmp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #ADD_EXECUTABLE(zipmerge zipmerge.c ${SRC_EXTRA_FILES}) #TARGET_LINK_LIBRARIES(zipmerge zip) #INSTALL(TARGETS zipmerge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #ADD_EXECUTABLE(ziptool ziptool.c ${SRC_EXTRA_FILES}) #TARGET_LINK_LIBRARIES(ziptool zip) #INSTALL(TARGETS ziptool RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) into src/CMakeLists.txt. Then I compiled the libs using make -j 8 zip and then make install/fast. It still returns the error Install the project... -- Install configuration: "" -- Installing: /home/simo/adtdev/Var_libs/libzip-1.5.1/build_armhf64/install/lib/pkgconfig/libzip.pc -- Installing: /home/simo/adtdev/Var_libs/libzip-1.5.1/build_armhf64/install/include/zipconf.h -- Installing: /home/simo/adtdev/Var_libs/libzip-1.5.1/build_armhf64/install/include/zip.h -- Installing: /home/simo/adtdev/Var_libs/libzip-1.5.1/build_armhf64/install/lib/libzip.a CMake Error at man/cmake_install.cmake:36 (file): file INSTALL cannot find "/home/simo/adtdev/Var_libs/libzip-1.5.1/build_armhf64/man/ZIP_SOURCE_GET_ARGS.3". Call Stack (most recent call first): cmake_install.cmake:46 (include) Makefile:89: recipe for target 'install/fast' failed make: *** [install/fast] Error 1 but I don't care about it since I have the libs and headers installed in the install dir, and this is what I need.
xyx (797 rep)
Nov 8, 2018, 01:41 PM • Last activity: May 23, 2025, 11:06 AM
5 votes
2 answers
11888 views
Cross-compiling Python
I am using an evaluation board with an ARM926EJ-S running Openembedded and I want to install python on it. I successfully cross-compiled python 2.7.13 on my Fedora 25 with the linaro toolchain (releases.linaro.org/components/toolchain/binaries/6.2-2016.11/) like this : CONFIG_SITE=config.site ./conf...
I am using an evaluation board with an ARM926EJ-S running Openembedded and I want to install python on it. I successfully cross-compiled python 2.7.13 on my Fedora 25 with the linaro toolchain (releases.linaro.org/components/toolchain/binaries/6.2-2016.11/) like this : CONFIG_SITE=config.site ./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabihf --disable-ipv6 --enable-unicode=ucs4 I had to do a config.site because during the compilation it asked me to precise : ac_cv_file__dev_ptmx=no/yes ac_cv_file__dev_ptc=no/yes And I put "no" to both of them like this guy did : datko.net/2013/05/10/cross-compiling-python-3-3-1-for-beaglebone-arm-angstrom/ Then I test to add : --host=arm-elf-linux Because it worked for another lib (pjsip), but unfortunately it didn't worked so I found this solution : --host=arm-unknown-linux-gnueabihf Here : github.com/jedisct1/libsodium/issues/274 And this was for an error during the configuration asking me to do so : --desable-ipv6 Then the configuration went well, so the make. To do the make install, because I had to install it on my board, I did : make install DESTDIR=root@IP_ADRESS This worked too, python is installed in root@IP_ADRESS/usr/local/lib/python2.7. But I can't find it in my board, nor launch the python shell. So I try this : export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib" Like answered here : stackoverflow.com/questions/4743233/is-usr-local-lib-searched-for-shared-libraries This doesn't change anything, and I figure out that /usr/local/lib does not exist... And I found that my pjsip lib is not installed too... Do you know where my libs went ? And how I can use them ? Thank you ! **EDIT :** Found the solution, in fact when you do : make install DESTDIR=root@IP_ADRESS It is not going to install it to root@IP_ADRESS, but it is creating a folder named "root@IP_ADRESS"... So I tar.bz2 all the files contained in this folder, send them with scp on my board and copy all the folders and files in the /usr/ of my board. But python is not working, when I try to launch it: ~# python -sh: /usr/bin/python: cannot execute binary file Is it because during the config part, the --host is not the good one?
Tagadac (191 rep)
Feb 6, 2017, 05:06 PM • Last activity: May 16, 2025, 06:38 AM
2 votes
1 answers
2558 views
Crosscompile go(lang) app with docker for alpine linux (musl) aarch64 with native libs so CGO enabled
## Background I'm writing an open-source GTK go app subsonic API client which: - targets on first place mobile friendly Linux like [postmarketOS][1] (alpine linux), [Mobian][2] (debian) - in future will be also extended to desktop Linux, Windows and Mac OS but not Android or iOS as they already have...
## Background I'm writing an open-source GTK go app subsonic API client which: - targets on first place mobile friendly Linux like postmarketOS (alpine linux), Mobian (debian) - in future will be also extended to desktop Linux, Windows and Mac OS but not Android or iOS as they already have one. - needs to be available at least on aarch64 and x86_64 - depends on native libs like portaudio, libasound, libopus - so it needs CGO to be enabled I haven't published app yet as I self-host my git and I have to do some additional config. It won't be available until late october 2021. App successfully compiles (on host) and runs on my main PC which is x86_64 fedora. App successfully compiles (on docker) and runs on aarch64 **glibc** distros like Mobian This is Dockerfile:
`
FROM golang:1.17-bullseye
LABEL os=linux
LABEL arch=arm64
ENV GOOS=linux
ENV GOARCH=arm64
ENV CGO_ENABLED=1
ENV CC=aarch64-linux-gnu-gcc
ENV PATH="/go/bin/${GOOS}_${GOARCH}:${PATH}"
ENV PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
# install build & runtime dependencies
RUN dpkg --add-architecture arm64 
RUN apt update && apt upgrade -y 
RUN apt install -y --no-install-recommends \
        protobuf-compiler \
        upx \
        gcc-aarch64-linux-gnu \
        libc6-dev-arm64-cross \
        pkg-config \
        libasound2-dev:arm64 \
    	libgtk-3-dev:arm64 \
    	libcairo2-dev:arm64 \
    	libglib2.0-dev:arm64 \
    	libgdk-pixbuf2.0-dev:arm64 \
        libsamplerate0:arm64 \
        libsamplerate0-dev:arm64 \
        libopusfile0:arm64 \
        libopusfile-dev:arm64 \
        libopus0:arm64 \
        libopus-dev:arm64 \
        libportaudio2:arm64 \
        portaudio19-dev:arm64 
# install build dependencies (code generators)
RUN go get github.com/hajimehoshi/oto \
    && go get github.com/faiface/beep \
    && go get github.com/faiface/beep/flac \
    && go get github.com/faiface/beep/speaker \
    && go get github.com/faiface/beep/mp3 \
    && go get github.com/faiface/beep/vorbis \
    && go get github.com/faiface/beep/wav\
    && go get github.com/gotk3/gotk3 \
    && go get github.com/delucks/go-subsonic \
    && go get github.com/hashicorp/go-retryablehttp \
    && go get github.com/zalando/go-keyring \
    && go get github.com/emirpasic/gods/lists/ \
    && go get github.com/emirpasic/gods/lists/arraylist \
` ## Problems 1. I can't run Mobian working binary on postmarketOS as alpine linux uses musl instead. file output is: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, (...) for GNU/Linux 3.7.0. not stripped. 2. I haven't manged to use musl toolchain in docker debian as it is 32 binary executable and image is 64 bit. 3. I couldn't find anything about multiarch in alpine so probably I can't use docker image goalng:1.17-alpine on x86_64 (I'd have also to find native libs packaged) I wish it's just problem with my config, if it's possible I'd love solution with docker as I'd like to use CI/CD in future. ## Resources, ideas, workarounds - I have raspberry pi with debian installed with some services. I could use with native musl toolchain and debian aarch64 docker container but it's not handy in production pipeline. Also, I haven't tried this. ## Good to read 1. Crosscompile CGO projects (also with docker) 2. Crosscompile with cross-platform musl toolchains 3. Related stackoverflow thread about alpine linux and go binaries
BigB (21 rep)
Aug 27, 2021, 09:27 PM • Last activity: May 10, 2025, 10:03 PM
1 votes
1 answers
1928 views
i686-cm-linux-gcc: Command not found
While cross compiling OpenWRT, I have I have replaced OpenWRT's toolchain with toolchain i686 architecture. But, I am getting below mentioned error: make[5]: Leaving directory `/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18' ./scripts/gcc-ver...
While cross compiling OpenWRT, I have I have replaced OpenWRT's toolchain with toolchain i686 architecture. But, I am getting below mentioned error: make: Leaving directory `/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18' ./scripts/gcc-version.sh: line 25: i686-cm-linux-gcc: command not found ./scripts/gcc-version.sh: line 26: i686-cm-linux-gcc: command not found make: Entering directory `/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18' arch/x86/Makefile:114: stack-protector enabled but compiler support broken Makefile:657: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler make: i686-cm-linux-gcc: Command not found CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CC kernel/bounds.s /bin/sh: 1: i686-cm-linux-gcc: not found make: *** [kernel/bounds.s] Error 127 make: *** [prepare0] Error 2 make: Leaving directory `/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18' make: *** [/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18/.modules] Error 2 make: Leaving directory `/home/hclintel/pankaj/fresh/trunk/target/linux/x86' make: *** [compile] Error 2 make: Leaving directory `/home/hclintel/pankaj/fresh/trunk/target/linux' make: *** [target/linux/compile] Error 2 make: Leaving directory `/home/hclintel/pankaj/fresh/trunk' make: *** [/home/hclintel/pankaj/fresh/trunk/staging_dir/target-i386_i486_musl-1.1.10/stamp/.target_compile] Error 2 make: Leaving directory `/home/hclintel/pankaj/fresh/trunk' make: *** [world] Error 2 hclintel@hclintel-ThinkCentre-M73:~/pankaj/fresh/trunk$ When I run echo $PATH, then I get below mentioned result: /home/hclintel/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games I think I need to modify path in configuration file but I am not able to find the right place to modify path.
Pankaj Yadav (11 rep)
Jul 22, 2015, 08:42 AM • Last activity: Apr 20, 2025, 03:03 AM
0 votes
1 answers
91 views
wrong number of arguments specified for '__deprecated__' attribute
I'm trying to compile newlib 3.0.0 for target m68k-aout I've already got binutils and gcc for the target built I'm building it with gcc-13.3.0, But I'm getting these two errors. ``` newlib-3.0.0/newlib/libc/include/stdlib.h:130: error: wrong number of arguments specified for '__deprecated__' attribu...
I'm trying to compile newlib 3.0.0 for target m68k-aout I've already got binutils and gcc for the target built I'm building it with gcc-13.3.0, But I'm getting these two errors.
newlib-3.0.0/newlib/libc/include/stdlib.h:130: error: wrong number of arguments specified for '__deprecated__' attribute
newlib-3.0.0/newlib/libc/include/stdlib.h:138: error: wrong number of arguments specified for '__deprecated__' attribute
Are there any workarounds or fixes I could try?
7dog123 (11 rep)
Dec 20, 2024, 02:54 PM • Last activity: Dec 20, 2024, 03:51 PM
0 votes
0 answers
122 views
apt-get build-dep for cross-architecture builds?
I am struggling with cross compiling certain packages. In my environment i do have already the source Debian package including debian/control. Building nativly for the host architecture (e.g. amd64) works like a charm. usually apt-get build-dep . will take care of the installation of the build depen...
I am struggling with cross compiling certain packages. In my environment i do have already the source Debian package including debian/control. Building nativly for the host architecture (e.g. amd64) works like a charm. usually apt-get build-dep . will take care of the installation of the build dependencies. However what's the cross-platform way to install build dependencies? there is no apt-get build-dep .:arm64 nor any command line argument such as --host-architecture or similar. Can someone point me how the build environment is commissioned prior dpkg-buildpackage -us -uc -b --host-arch arm64
Matthias Goldhoorn (183 rep)
Dec 17, 2024, 05:57 AM
2 votes
1 answers
209 views
Linking a 32-bit x86 program on 64-bit x86 Debian
I have an sample application and an make file. * `main.c` file contents ```lang-c #include /*int mainentry_entry(int argc, char *argv[]) {*/ int main(int argc, char *argv[]) { int i; printf("argc = %d\n", argc); for (i = 0; i /lib/i386-linux-gnu/libc.so.6 (0xea200000) /usr/lib/libc.so.1 => /lib/ld-l...
I have an sample application and an make file. * main.c file contents
-c
    #include 
    
    /*int mainentry_entry(int argc, char *argv[]) {*/
    int main(int argc, char *argv[]) {
        int i;
        printf("argc = %d\n", argc);
        for (i = 0; i  /lib/i386-linux-gnu/libc.so.6 (0xea200000)
        /usr/lib/libc.so.1 => /lib/ld-linux.so.2 (0xea48e000)
user3035194 (21 rep)
Nov 22, 2024, 06:21 AM • Last activity: Nov 25, 2024, 10:24 AM
0 votes
0 answers
347 views
How to cross-compile Linux tools/perf for embedded system?
I am working on an embedded Linux system (kernel-5.19.20) on MIPS, and I want to build `tools/perf` for my system. I want to have `libelf` feature enabled when cross compile perf, so I firstly cross-compile and installed the `libelf` to `$(proj)/sysroot/usr/lib/`. Then I tried following command to c...
I am working on an embedded Linux system (kernel-5.19.20) on MIPS, and I want to build tools/perf for my system. I want to have libelf feature enabled when cross compile perf, so I firstly cross-compile and installed the libelf to $(proj)/sysroot/usr/lib/. Then I tried following command to cross compile perf.
CC=mips-none-gnu-gcc make ARCH=mips CROSS_COMPILE=mips-none-gnu- EXTRA_CFLAGS="-I/home/t/proj/target/usr/include" LDFLAGS="-L/home/t/proj/target/usr/lib -Wl,-rpath-link=/home/t/proj/target/usr/lib"
And I got following feature list.
Auto-detecting system features:
...                         dwarf: [ OFF ]
...            dwarf_getlocations: [ OFF ]
...                         glibc: [ on  ]
...                        libbfd: [ OFF ]
...                libbfd-buildid: [ OFF ]
...                        libcap: [ OFF ]
...                        libelf: [ OFF ]
...                       libnuma: [ OFF ]
...        numa_num_possible_cpus: [ OFF ]
...                       libperl: [ OFF ]
...                     libpython: [ OFF ]
...                     libcrypto: [ OFF ]
...                     libunwind: [ OFF ]
...            libdw-dwarf-unwind: [ OFF ]
...                          zlib: [ OFF ]
...                          lzma: [ OFF ]
...                     get_cpuid: [ OFF ]
...                           bpf: [ on  ]
...                        libaio: [ on  ]
...                       libzstd: [ OFF ]
...        disassembler-four-args: [ OFF ]
I checked the ../build/feature/test-libelf.make.output, and I got,
/home/t/proj/mips-none-gnu/bin/ld: warning: libz.so.1, needed by /home/t/proj/target/usr/lib/libelf.so, not found (try using -rpath or -rpath-link)
/home/t/proj/target/usr/lib/libelf.so: undefined reference to `inflate'
/home/t/proj/target/usr/lib/libelf.so: undefined reference to `deflate'
/home/t/proj/target/usr/lib/libelf.so: undefined reference to deflateInit_'    /home/t/proj/target/usr/lib/libelf.so: undefined reference to inflateEnd'
/home/t/proj/target/usr/lib/libelf.so: undefined reference to `deflateEnd'
/home/t/proj/target/usr/lib/libelf.so: undefined reference to inflateInit_'    /home/t/proj/target/usr/lib/libelf.so: undefined reference to inflateReset'    collect2: error: ld returned 1 exit status
The libz.so is built within buildroot and already installed into /home/t/proj/target/usr/lib. So, how to make perf with libelf succeed in this case?
wangt13 (631 rep)
Oct 17, 2024, 06:25 AM • Last activity: Oct 17, 2024, 07:04 AM
1 votes
1 answers
70 views
Pi Zero Cross Compilation Floating Point Specification
I am trying to cross compile a go project (syzkaller) to target a Pi Zero so it can emulate usb devices. The problem is that I have been unable to find information regarding how to specify the proper floating point flag to ensure compatibility with the Pi Zero. Everything I have tried results in the...
I am trying to cross compile a go project (syzkaller) to target a Pi Zero so it can emulate usb devices. The problem is that I have been unable to find information regarding how to specify the proper floating point flag to ensure compatibility with the Pi Zero. Everything I have tried results in the VMOV assembly instruction being in the binary file and throwing an illegal instruction. My host machine is x86_64 running go1.21.4 and the pi zero is arm6l running go1.21.4. When cross compiling I am using GOOS=linux GOARCH=arm GOARM=5. The makefile I am using can be found here: https://github.com/google/syzkaller/blob/master/Makefile (I am compiling the execprog binary). From my research the GOARM=5 should be forcing software floating point operations, but the information sources are very outdated. I have also tried compiling for armv5 with no success. I also could be using the flag incorrectly since I am not very familiar with GO. Below are the exact compilation arguments for the binary. Any advice is appreciated, thanks. Must remake target 'execprog'. GOOS=linux GOARCH=arm go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.\ GitRevision=121701b62358a454bbfdccfadfcce9bb843602d6+ -X 'github.com/google/syzkaller\ /prog.gitRevisionDate=20240605-134717'" "-tags=syz_target syz_os_linux syz_arch_armv6\ GOARM=5" -o ./bin/linux_arm/syz-execprog github.com/google/syzkaller/tools/syz-execprog
Darrion Ramos (23 rep)
Jun 28, 2024, 03:30 AM • Last activity: Jun 28, 2024, 04:55 AM
0 votes
1 answers
801 views
Building GCC 12.2.0 from source for aarch64 target
I've been trying to cross compile the source code to build GCC 12.2.0 for my RaspberryPi 4 B running Ubuntu 22.04. SO far I've tried doing this while configuring the project: ```bash ../gcc-12.2.0/configure --build=x86_64-pc-linux-gnu --host=aarch64-linux-gnu --enable-languages=c,c++ --prefix-path=/...
I've been trying to cross compile the source code to build GCC 12.2.0 for my RaspberryPi 4 B running Ubuntu 22.04. SO far I've tried doing this while configuring the project:
../gcc-12.2.0/configure --build=x86_64-pc-linux-gnu --host=aarch64-linux-gnu --enable-languages=c,c++ --prefix-path=/opt/cross/gcc-12.2.0/build_aarch64 --disable-multilib
But this does not work, as when I'm building the project using make, the bootstrapping phase gives me a bunch of errors related to zstd.
undefined reference to `ZSTD_getErrorName'
undefined reference to `ZSTD_isError'
undefined reference to `ZSTD_compress'
undefined reference to `ZSTD_getErrorName'
... (you get it)
How do I go about solving this? Am I doing something wrong configuring my project? I've been looking at this from just straight up searching my error: https://github.com/crosstool-ng/crosstool-ng/issues/1613 , but it seems like scuffing it a bit, right? Would appreciate your help, guys.
MetalAllegiance (1 rep)
May 31, 2024, 10:37 PM • Last activity: Jun 2, 2024, 09:08 PM
14 votes
6 answers
26948 views
using cross-compiled Valgrind
I have downloaded the sources from the Valgrind trunk and built it for using on an embedded Linux system(Montavista Linux) powered by an ARM926(ARMv5t architecture). Everything went well until I tried to run it to check some application I've made; Valgrind tells me: *"valgrind: failed to start tool...
I have downloaded the sources from the Valgrind trunk and built it for using on an embedded Linux system(Montavista Linux) powered by an ARM926(ARMv5t architecture). Everything went well until I tried to run it to check some application I've made; Valgrind tells me: *"valgrind: failed to start tool 'memcheck' for platform 'arm-linux': No such file or directory".* Trying to run any other tool gives the same message. For *make install* I used the --prefix option pointing to the embedded system's filesystem which is mounted through NFS(e.g. --prefix=/home/NFS_mounted/opt/valgrind). I checked the installation location and the *lib* directory there contains the proper tools; I also checked the corresponding pkgconfig file for Valgrind and it seems to be OK so I'm kind of clueless right now and can't figure out what's going wrong. 2 questions: 1. Is it correct to use/install a cross-compiled Valgrind like that? Maybe I'm doing something wrong regarding the setup, or maybe there is something involving the host system that I'm missing(gdb/gdbserver like). 2. Has anyone tried running it on ARM architectures? I'm aware that the support is fairly recent so I'm wondering if I could get decent results.
celavek (785 rep)
Sep 6, 2010, 07:14 PM • Last activity: Apr 1, 2024, 02:55 PM
0 votes
1 answers
190 views
Failed to build GNU toolchain and newlib 4.4 for ARM from scratch in X86 Linux
I am working on an embedded RTOS on ARM, now I am going to build the GNU toolchain for the ARM in my X86 Linux host (ubuntu-20.04), so I did followings by referring to https://gnutoolchains.com/building/ 1. Download binutils-2.42.tar.gz 2. Download gcc-11.3.0.tar.gz 3. Download newlib-4.4.0-20231231...
I am working on an embedded RTOS on ARM, now I am going to build the GNU toolchain for the ARM in my X86 Linux host (ubuntu-20.04), so I did followings by referring to https://gnutoolchains.com/building/ 1. Download binutils-2.42.tar.gz 2. Download gcc-11.3.0.tar.gz 3. Download newlib-4.4.0-20231231 4. Download mpc-1.0.3.tar.gz 5. Download mpfr-3.1.6.tar.bz2 6. Download gmp-4.3.2.tar.bz2 7. Download gdb-14.1.tar.gz Put and extract them into /home/t/testmnt/armtoolchain/, as follows,
@t-VirtualBox:~/testmnt/armtoolchain$ ls -l
total 442348
drwxrwx--- 20 t t      4096 3月  21 09:11 binutils-2.42
drwxrwx--- 13 t t      4096 3月  23 18:06 binutils-2.42-build
-rwxrwx---  1 t t  51892456 1月  29 23:22 binutils-2.42.tar.gz
drwxrwx--- 38 t t      4096 4月  21  2022 gcc-11.3.0
drwxrwx--- 16 t t      4096 3月  23 19:56 gcc-11.3.0-build
-rwxrwx---  1 t t 143527306 4月  21  2022 gcc-11.3.0.tar.gz
drwxrwxr-x 23 t t      4096 3月  22 12:47 gdb-14.1
drwxrwxr-x 17 t t      4096 3月  22 12:53 gdb-14.1-build
-rw-rw-r--  1 t t  41058403 12月  3 13:39 gdb-14.1.tar.gz
drwxrwx--- 16 t t      4096 3月  21 10:37 gmp-4.3.2
-rwxrwx---  1 t t   1897483 2月   1  2010 gmp-4.3.2.tar.bz2
drwxrwx---  6 t t      4096 3月  21 10:42 mpc-1.0.3
-rwxrwx---  1 t t    669925 4月  28  2016 mpc-1.0.3.tar.gz
drwxrwx---  9 t t      4096 3月  21 10:46 mpfr-3.1.6
-rwxrwx---  1 t t   1287202 9月   7  2017 mpfr-3.1.6.tar.bz2
drwxrwx---  9 t t      4096 3月  22 08:05 newlib-4.4.0.20231231
drwxrwxr-x  4 t t      4096 3月  22 14:27 newlib-4.4.0.20231231-build
drwxrwx---  6 t t      4096 3月  23 18:07 out
I firstly configured and built gmp, mpc, and mpfr, and installed them into /usr/local/lib/ Then, I configured and built binutils as follows,
cd binutils-2.42-build/
../binutils-2.42/configure -target arm-test-eabi --prefix /home/t/testmnt/armtoolchain/out/
make install-strip
Then, I configured and built gcc as follows,
cd gcc-11.3.0-build/
../gcc-11.3.0/configure --target=arm-test-eabi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --prefix /home/t/testmnt/armtoolchain/out --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --enable-threads=posix --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-multilib-list=aprofile,rmprofile --with-headers=/home/t/testmnt/armtoolchain/newlib-4.4.0.20231231/newlib/libc/include  --with-pkgversion='GNU Arm Embedded Toolchain 11.3.0'

make -j12
Then, I hit the following errors.
make: Entering directory '/home/t/testmnt/armtoolchain/gcc-11.3.0-build/arm-test-eabi/arm/v5te/softfp/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/home/t/testmnt/armtoolchain/gcc-11.3.0-build/./gcc/xgcc -B/home/t/testmnt/armtoolchain/gcc-11.3.0-build/./gcc/ -B/home/t/testmnt/armtoolchain/out/arm-test-eabi/bin/ -B/home/t/testmnt/armtoolchain/out/arm-test-eabi/lib/ -isystem /home/t/testmnt/armtoolchain/out/arm-test-eabi/include -isystem /home/t/testmnt/armtoolchain/out/arm-test-eabi/sys-include    -g -O2 -marm -march=armv5te+fp -mfloat-abi=softfp -O2  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fno-inline -I. -I. -I../../../../.././gcc -I../../../../../../gcc-11.3.0/libgcc -I../../../../../../gcc-11.3.0/libgcc/. -I../../../../../../gcc-11.3.0/libgcc/../gcc -I../../../../../../gcc-11.3.0/libgcc/../include    -o emutls.o -MT emutls.o -MD -MP -MF emutls.dep -fexceptions -c ../../../../../../gcc-11.3.0/libgcc/emutls.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from ../../../../../../gcc-11.3.0/libgcc/gthr.h:148,
                 from ../../../../../../gcc-11.3.0/libgcc/emutls.c:31:
./gthr-default.h:102:9: error: 'pthread_once' undeclared here (not in a function); did you mean 'pthread_once_t'?
  102 | __gthrw(pthread_once)
      |         ^~~~~~~~~~~~
./gthr-default.h:90:19: note: in definition of macro '__gthrw2'
   90 |   static __typeof(type) name \
      |                   ^~~~
./gthr-default.h:102:1: note: in expansion of macro '__gthrw'
  102 | __gthrw(pthread_once)
      | ^~~~~~~
./gthr-default.h:103:9: error: 'pthread_getspecific' undeclared here (not in a function)
  103 | __gthrw(pthread_getspecific)
      |         ^~~~~~~~~~~~~~~~~~~
./gthr-default.h:90:19: note: in definition of macro '__gthrw2'
   90 |   static __typeof(type) name \
      |                   ^~~~
./gthr-default.h:103:1: note: in expansion of macro '__gthrw'
  103 | __gthrw(pthread_getspecific)
      | ^~~~~~~
./gthr-default.h:104:9: error: 'pthread_setspecific' undeclared here (not in a function)
  104 | __gthrw(pthread_setspecific)
      |         ^~~~~~~~~~~~~~~~~~~
./gthr-default.h:90:19: note: in definition of macro '__gthrw2'
   90 |   static __typeof(type) name \
      |                   ^~~~
./gthr-default.h:104:1: note: in expansion of macro '__gthrw'
  104 | __gthrw(pthread_setspecific)
      | ^~~~~~~
./gthr-default.h:106:9: error: 'pthread_create' undeclared here (not in a function); did you mean 'htab_create'?
  106 | __gthrw(pthread_create)
      |         ^~~~~~~~~~~~~~
./gthr-default.h:90:19: note: in definition of macro '__gthrw2'
   90 |   static __typeof(type) name \
      |                   ^~~~
./gthr-default.h:106:1: note: in expansion of macro '__gthrw'
  106 | __gthrw(pthread_create)
      | ^~~~~~~
./gthr-default.h:107:9: error: 'pthread_join' undeclared here (not in a function); did you mean 'pthread_kill'?
  107 | __gthrw(pthread_join)
      |         ^~~~~~~~~~~~
.....
.....
I checked the ../newlib-4.4.0.20231231/newlib/libc/include/pthread.h, it has following definitions,
254 /* Thread Creation, P1003.1c/Draft 10, p. 144 */
255 
256 int pthread_create (pthread_t *__pthread, const pthread_attr_t  *__attr,
257             void *(*__start_routine)(void *), void *__arg);
258 
259 /* Wait for Thread Termination, P1003.1c/Draft 10, p. 147 */
260 
261 int pthread_join (pthread_t __pthread, void **__value_ptr);
....
....
298 #define PTHREAD_ONCE_INIT _PTHREAD_ONCE_INIT
299 
300 int pthread_once (pthread_once_t *__once_control,
301               void (*__init_routine)(void));

....
....
308 /* Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 */
309 
310 int pthread_setspecific (pthread_key_t __key, const void *__value);
311 void *  pthread_getspecific (pthread_key_t __key);
I googled and found similar issues, one pointed out there should be something wrong in the building system, but I don't know what problem it is. So currently, building gcc-11.3.0 is failed with enable-threads=posix, how to fix it and build a ARM GNU toolchain with newlib? Thanks,
wangt13 (631 rep)
Mar 26, 2024, 08:05 AM • Last activity: Mar 26, 2024, 12:44 PM
0 votes
0 answers
273 views
How to compile this SDL2 sample program?
I tried to build [this SDL2 sample program](https://glusoft.com/sdl2-tutorials/display-image-sdl_image/), but failed. I made it with Makefile: ```lang-make CFLAGS = -I/usr/include CC = arm-linux-g++ sdltest: sdl2-test.cpp $(CC) sdl2-test.cpp -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2_image $(CFLAGS)...
I tried to build [this SDL2 sample program](https://glusoft.com/sdl2-tutorials/display-image-sdl_image/) , but failed. I made it with Makefile:
-make
CFLAGS = -I/usr/include
CC = arm-linux-g++
sdltest:        sdl2-test.cpp
        $(CC)  sdl2-test.cpp  -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2_image $(CFLAGS) sdl2-config  --cflags --libs -o sdl2-test

clean:
        rm sdl2-test
I made it and got the below result:
-shellsession
$ arm-linux-g++  sdl2-test.cpp  -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2_image -I/usr/include  sdl2-config  --cflags --libs -o sdl2-test
In file included from /usr/include/SDL2/SDL_stdinc.h:31:0,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from sdl2-test.cpp:2:
/usr/include/SDL2/SDL_config.h:4:35: fatal error: SDL2/_real_SDL_config.h: No such file or directory
 #include 
                                   ^
compilation terminated.
make: *** [Makefile:4: sdltest] Error 1
I then changed CFLAGS in Makefile to
-make
CFLAGS = -I/usr/include -I/usr/include/x86_64-linux-gnu
made it and then I got such a response
-shellsession
$ arm-linux-g++  sdl2-test.cpp  -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2_image -I/usr/include -I/usr/include/x86_64-linux-gnu sdl2-config  --cflags --libs -o sdl2-test
In file included from /usr/include/SDL2/SDL.h:38:0,
                 from sdl2-test.cpp:2:
/usr/include/SDL2/SDL_cpuinfo.h:102:23: fatal error: immintrin.h: No such file or directory
 #include 
                       ^
compilation terminated.
make: *** [Makefile:4: sdltest] Error 1
I can't find immintrin.h under /usr/include. What can I do to build such a sample program? P.S.: I installed SDL1 mistakenly before installing SDL2 because I am new and didn't know enough about SDL. Below is my installation:
-shellsession
~/prebuilts/gcc-x64/m1/sdl/sdl2-sample$ ll /usr/include/SDL* -d
drwxr-xr-x 2 root root 4096  三  13 16:37 /usr/include/SDL/
drwxr-xr-x 2 root root 4096  三  13 13:56 /usr/include/SDL2/

~/prebuilts/gcc-x64/m1/sdl/sdl2-sample$ ll /usr/include/x86_64-linux-gnu/ -d
drwxr-xr-x 11 root root 4096  三  13 16:37 /usr/include/x86_64-linux-gnu//

~/prebuilts/gcc-x64/m1/sdl/sdl2-sample$ ll /usr/include/x86_64-linux-gnu/SDL* -d
drwxr-xr-x 2 root root 4096  三  13 10:14 /usr/include/x86_64-linux-gnu/SDL2/
Stan Huang at Taiwan (103 rep)
Mar 14, 2024, 07:01 AM • Last activity: Mar 14, 2024, 01:32 PM
2 votes
0 answers
108 views
No such file or directory, but ldd reports all present
I have compiled canboat for PiCore64 from my amd64 workstation using docker and qemu. Specifically this is my build script: ``` lang-sh #!/bin/sh set -e NAME=canboat cd canboat make all cd .. mkdir -p ./root/usr/local/bin/ cp canboat/rel/linux-aarch64/* ./root/usr/local/bin/ patchelf --replace-neede...
I have compiled canboat for PiCore64 from my amd64 workstation using docker and qemu. Specifically this is my build script:
lang-sh
#!/bin/sh

set -e

NAME=canboat

cd canboat
make all
cd ..

mkdir -p ./root/usr/local/bin/
cp canboat/rel/linux-aarch64/* ./root/usr/local/bin/

patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/actisense-serial
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/analyzer
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/analyzer-explain
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/analyzer-explain-j1939
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/analyzer-j1939
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/candump2analyzer
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/command-group-function
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/ikonvert-serial
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/iptee
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/n2kd
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/nmea0183-serial
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/replay
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/request-group-function
patchelf --replace-needed libc.musl-aarch64.so.1 libc.so.6 --set-interpreter ld-linux-aarch64.so.1 ./root/usr/local/bin/socketcan-writer
#exit 1

mksquashfs ./root "$DEST"/"$NAME".tcz -all-root
md5sum "$DEST"/"$NAME".tcz > "$DEST"/"$NAME".tcz.md5.txt
cp "$NAME".tcz.dep "$DEST"
cp "$NAME".tcz.info "$DEST"
Dockerfile:
-docker
FROM arm64v8/alpine:3.19

RUN apk add gcc g++ python3 musl-dev make py3-pip py3-virtualenv libxslt libxml2-utils\
            squashfs-tools py3-yaml py3-urllib3 npm linux-headers patchelf
When I load this extension in PiCore64 14.1.0, I get this output:
$ /tmp/tcloop/canboat/usr/local/bin/actisense-serial
-sh: /tmp/tcloop/canboat/usr/local/bin/actisense-serial: not found
Diagnostics:
$ ls /tmp/tcloop/canboat/usr/local/bin/actisense-serial
/tmp/tcloop/canboat/usr/local/bin/actisense-serial
$ ldd /tmp/tcloop/canboat/usr/local/bin/actisense-serial
linux-vdso.so.1 (0x0000007f81963000)
libc.so.6 => /lib/libc.so.6 (0x0000007f81720000)
ld-linux-aarch64.so.1 => /lib/ld-linux-aarch64.so.1 (0x0000007f881926000)
$ readelf -l /tmp/tcloop/canboat/usr/local/bin/actisense-serial | grep interpr
[Requesting program interpreter: ld-linux-aarch64.so.1]
$ ls /lib
...
ld-linux-aarch64.so.1
...
libc.so.6
...
$ env
USER=tc
SHLVL=1
HOME=/home/tc
PAGER=less -EM
PS1=...
ENV=/home/tc/.ashrc
BACKUP=1
LOGNAME=tc
TERM=linux
PATH=/home/tc/.local/bin:/usr/local/sbin:/usr/local/bin:/apps/bin:/usr/sbin:/usr/bin:/sbin:/bin:/etc/sysconfig/tcedir/ondemand
G_FILENAME_ENCODING=iso8859-1
LANG=C
MANPAGER=less -isR
SHELL=/bin/sh
FLWM_TITLEBAR_COLOR=58:7D:AA
PWD=/home/tc
EDITOR=vi
$ strace /tmp/tcloop/canboat/usr/local/bin/actisense-serial
execve("/tmp/tcloop/canboat/usr/local/bin/actisense-serial", ["/tmp/tcloop/canboat/usr/local/bi"...], 0x7fd7ba350 /* 17 vars */) = -1 ENOENT (No such file or directory)
strace: exec: No such file or directory
+++ exited with 1 +++
(...: abbreviated for brevity or my laziness) So all required shared libraries apparently can be located, but I am still baffled as to why I get the error. Is there some way that I can find what it is looking for that it cannot find? What is it missing?
rhbvkleef (121 rep)
Feb 21, 2024, 10:14 AM • Last activity: Feb 21, 2024, 10:27 AM
Showing page 1 of 20 total questions