Skip to main content

Questions tagged [cross-compilation]

Questions should concern compiling for a platform different than the one the compiler is running on. Compiling inside a VM does not count unless it's some sort of hybrid setup i.e. the host which is a different platform is involved.

Filter by
Sorted by
Tagged with
1 vote
1 answer
23 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 ...
Darrion Ramos's user avatar
0 votes
1 answer
68 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: ../gcc-12.2.0/configure --...
MetalAllegiance's user avatar
0 votes
0 answers
31 views

Failed to build GCC with uClibc-ng-1.0.48

I am trying to build a cross compiler of GCC for mips32 with uClibc. I downloaded GCC-10.3.0 and uClibc-ng-1.0.48, the system environment is setup as follows, export ARCH=mips export TARGET=mips-linux-...
wangt13's user avatar
  • 443
0 votes
1 answer
48 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/...
wangt13's user avatar
  • 443
0 votes
0 answers
89 views

How to compile this SDL2 sample program?

I tried to build this SDL2 sample program, but failed. I made it with Makefile: CFLAGS = -I/usr/include CC = arm-linux-g++ sdltest: sdl2-test.cpp $(CC) sdl2-test.cpp -L/usr/lib/x86_64-...
Stan Huang at Taiwan's user avatar
0 votes
0 answers
17 views

Failed to build newlib4.4 for ARM in WSL2 Linux x86_64

I am working on an embedded RTOS system for ARM platform, it is using newlib-3.1. Now I am trying to support newlib-4.4 for the system in WSL2 (Ubuntu-20.04.6 for X86_64). The cross-compiler for ARM ...
wangt13's user avatar
  • 443
2 votes
0 answers
46 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: #!/bin/sh set -e NAME=canboat cd canboat make all cd .. mkdir -p ./root/...
rhbvkleef's user avatar
  • 121
0 votes
0 answers
149 views

building gcc-13.2.0 cross compiler, generated makefile causes errors

I am trying to build a cross compiler for my Raspberry Pi Zero that runs on a Raspberry Pi 4. I used ../configure --build=x86_64-pc-linux-gnu --disable-multilib --disable-fixincludes --enable-...
Amiibo Alec's user avatar
0 votes
0 answers
43 views

emerge reports "nothing to merge" for a crossdev toolchain unless executed inside chroot

Meta My host Gentoo installation is bootstrapped from a stage3 tarball, systemd version. My crossdev toolchain is aarch64-unknown-linux-gnu without systemd, compiled from scratch, not --stable. As for ...
mkay's user avatar
  • 1
0 votes
0 answers
323 views

Compile git for /lib/ld-linux-armhf.so.3 from vm that links with /lib/ld-linux-aarch64.so.1 by default

I'm building git from source from a debian 10 vm that has /lib/ld-linux-aarch64.so.1, which ends up linked in the git binary after a basic NO_TCLTK=true make prefix=$(pwd)/2.41.0/arm make all and ~ ...
bpstrngr's user avatar
  • 101
1 vote
1 answer
1k views

How can I create the kernel headers for ARM on X86?

I have an ARM-based board, which I used with factory kernel (5.10.110). To manually build a kernel module, I needed the kernel-header package. To install this package it was explained in the ...
Daniel's user avatar
  • 339
0 votes
2 answers
495 views

could cross compiling be faster than compiling natively?

I've got an arm-based (arm_v8-64, ubuntu20.04) target machine and an amd-based host machine (x86_64, ubuntu20.04). Since the cpu is much more powerful on the host than on the target, I wonder whether ...
furynerd's user avatar
-1 votes
1 answer
104 views

What are the best practices on storing cross-compiled libs? [closed]

I have a project I want to cross compile (as well as native). I've installed my cross compiler under /opt/x-compiler/arm32/ and I also add some dependencies I have under /opt/lib/arm32/. The ...
CIsForCookies's user avatar
1 vote
1 answer
140 views

configure: error: Could not find alsa!

I'm trying to cross compile jdk for android. I run: ./configure --with-toolchain-path=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64 --with-sysroot=$ANDROID_NDK_HOME/platforms/android-21/...
kpwn Apps's user avatar
  • 121
0 votes
0 answers
59 views

What is the bootstrapping technique in terms of building cross-gcc and cross-glibc?

Some tutorials for building linux from ground do in first step building the cross compiler toolchain. They do this by invoking so called bootstrapping technique. First they build cross-gcc statically, ...
ptiza_v_nebe's user avatar
2 votes
1 answer
871 views

GCC linker search path when cross-compiling

I have various tool chain directories on my linux machine for compiling under specific compiler versions. I have a problem where the linker (in the tool chain dir) is selecting a library file from ...
kfank's user avatar
  • 21
0 votes
1 answer
794 views

what target flag should I set to cross compile arm 32 bit code in gcc?

I'm trying to build a cross compiling build server for some 32 bit arm devices, where the architecture is: (from uname -m) "armv5tejl" I have to specify the target for binutils, and gcc, ...
j0h's user avatar
  • 3,689
1 vote
0 answers
120 views

Testing gcc command in Linux From Scratch?

Linux From Scratch tells me to run these commands to test that the new toolchain is working: echo 'int main(){}' | gcc -xc - readelf -l a.out | grep ld-linux So since I am testing the new toolchain, ...
IPmanfkawde's user avatar
0 votes
1 answer
1k views

Cross-compiling a Debian package from source

There is a package I build from source, following this recipe: echo "deb-src http://archive.ubuntu.com/ubuntu focal main" >> /etc/apt/sources.list echo "deb-src http://archive....
rgov's user avatar
  • 253
0 votes
0 answers
97 views

cross compiling a kernel with backports

I have a "backport" which consists of a makefile that produces some ko files for device driver support. It also comes with some binaries that are dropped on to the host machine in addition ...
GodJohnson's user avatar
1 vote
1 answer
483 views

Unable to cross-compile GNU screen for ARM

I'm on Ubuntu, and trying to build GNU screen for an old ARM device running Busybox. I have a custom cross-compilation toolchain installed in /usr/local/toolchain. I downloaded screen 4.3.1 (from 7 ...
jerkstorecalled's user avatar
1 vote
1 answer
342 views

Compiling a C program with Clang for MIPS (32-bit) on a FreeBSD x86_64/AMD64 system

Is there a way to compile a C program with Clang compiler for MIPS (32-bit) on a FreeBSD x86_64/AMD64 system?
ordinary_guy's user avatar
1 vote
1 answer
135 views

Why this script stuck at "can't execute" branch?

I'm using this tool-chian provided by a manufacture of control boards. I followed the instruction step by step but when I tried to compile example code, the compilation process got stuck at "$...
cream_pi's user avatar
1 vote
1 answer
2k views

How to install armr5-none-eabi-g++ and associated toolchain?

I'm tasked with adding a cross-compiler to an existing Docker image that contains multiple cross-tools. From our existing Dockerfile, I see that apt-get install -y --no-install-recommends build-...
StoneThrow's user avatar
  • 1,787
0 votes
1 answer
333 views

Cross Compilation ARMHF or Compilation for Android from Debian or Ubuntu package?

I have two options to compile: Cross-compile using an amd64 Ubuntu or Debian system for armhf package compilation. Run an armhf image of Ubuntu or Debian in QEMU. The problem I have is that when ...
Matty A.D.'s user avatar
2 votes
0 answers
299 views

libtool (arm): error: only absolute run-paths are allowed

I am cross-compiling SSSD for ARM architecture.  When I run make, I obtain the following error: arm-xilinx-linux-gnueabi-libtool: error: only absolute run-paths are allowed I configure it as ...
user15061000's user avatar
1 vote
2 answers
2k 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 ...
powermignolo's user avatar
1 vote
1 answer
3k views

How can I install multi-architecture packages on RHEL 8

On an x86_64 Ubuntu 20.04 system, after some minor modifications under /etc/apt and running dpkg --add-architecture s390x, I can install the foo-dev:s390x package and the gcc-8-s390x-linux-gnu package ...
acm's user avatar
  • 257
0 votes
0 answers
1k views

Glibc 2.34 cross-compiling issue for aarch64 on x86_64

aarch64-linux-gnueabihf-gcc ../sysdeps/gnu/getutmpx.c -c -std=gnu11 -fgnu89-inline -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -fno-common -...
James's user avatar
  • 101
1 vote
0 answers
65 views

.NET 5 issue on "old" arm64 / how to publish for arm64/gcc4.x

Background I'm having more success than expected running binaries from a (relatively simple) C# program on "antiquated" arm and arm64 systems built on linux-x64 and published with RIDs linux-...
ppenguin's user avatar
  • 115
0 votes
0 answers
31 views

Ubuntu can't run on vm-ware after installing local packages

i want to do petalinux cross-compilation at ubuntu on vm-ware and offline. so, i downloaded all needed packages and installed them. and then i tried to restart ubuntu. but, unfortunately, ubuntu not ...
Leonardo's user avatar
0 votes
1 answer
318 views

Compilation order when cross compiling Linux

I've been following the Linux From Scratch book and just need to fill some gaps in my understanding of cross compiling Linux. Where a toolchain has already been built for the target machine, is the ...
oorst's user avatar
  • 101
8 votes
3 answers
4k views

Why is the Canadian Cross used for cross-compilation in Linux From Scratch?

I'm going through the Linux From Scratch 11.0 book. In III. Building the LFS Cross Toolchain and Temporary Tools, ii. Toolchain Technical Notes, there is a bit about Canadian Cross cross-compilation. ...
mnj's user avatar
  • 291
2 votes
1 answer
2k 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 (alpine linux), Mobian (debian) in future will be also ...
BigB's user avatar
  • 21
1 vote
0 answers
451 views

Error while loading shared libraries (libandroid.so): internal error

I'm trying to run a sample sensor NDK application in an embedded target with Qualcomm Snapdragon QCS610 running a Linux BSP supplied from the dev board manufacturer. The sensor application depends on ...
Laks's user avatar
  • 11
0 votes
1 answer
443 views

emacs ./configure encounters missing function 'tputs' when cross-compiling for arm-linux-gnueabihf

I'm trying to cross compile Emacs for an armv7l system on my main rig through an Arch virtual-box, and so far I've had no issues until the ./configure stage. I've properly set up the build, host, and ...
itz-el's user avatar
  • 1
0 votes
1 answer
3k views

$ arm-none-eabi-gcc --version error

Iam using MX linux OS. I am trying to use stm32f103c8t6 MCU. From the user manual Beginning STM32 by Warren gay I installed git clone of stm32f103c8t6, libopencm3 and FreeRTOS successfully as per ...
Deepak Kumar's user avatar
0 votes
1 answer
2k views

Where to get linux "5.4.0-77-generic" kernel source?

I have installed ubuntu 20.04 on a qemu arm64 virtual machine. This is based on qemu's arm64 'virt' machine and I added a peripheral in the virtual machine. Now to test device driver, I need to build ...
Chan Kim's user avatar
  • 397
5 votes
1 answer
13k views

How do I cross compile the Linux kernel?

I've spent hours, if not days figuring out how to cross compile Linux for AArch64. I'm using Ubuntu in a VM to do this, however all guides I managed to find didn't work completely. Most of them ...
László Szerémi's user avatar
0 votes
0 answers
943 views

How to crosscompile a kernel for raspbian in an arch linux host?

I have a raspberrypi 3B and want to compile and install a new kernel on it, but I only have an arch linux(x86_64) host to compile it on. Following the official documentation I get stuck trying to ...
barzilay's user avatar
1 vote
1 answer
572 views

LFS GCC-10.2.0 Pass 2 Fails with source-code error in crtstuff.c

When I'm trying to run Chapter 6.18 of the LFS (with systemd) book, make fails because in the file crtstuff.c, line 695, there is an undefined reference to __CTOR_END__. This seems like some sort of g+...
Alexander P's user avatar
1 vote
1 answer
864 views

Why can my statically compiled ARM binary of BusyBox run on my x86_64 PC? [duplicate]

Bit of a strange situation there. I compiled a static executable of BusyBox 1.32.1 for the ARM platform (32-bit) and strangely it runs without problems on both platforms. Look by yourself: root@...
Nicolas Mailloux's user avatar
0 votes
1 answer
382 views

Linux Kernel custom module build skips module

I'm trying to cross-compile (arm64) a custom module on my linux box. So what I did so far is: install the target Kernel sources install the cross-compiler enable module and build the Kernels with the ...
cips's user avatar
  • 1
1 vote
1 answer
2k views

Cross-compiling Linux kernel fails on bzImage

I want to compile a Linux kernel from scratch for the arm64 (aarch64) platform, used for booting a Raspberry Pi 4. The host is amd64 and is running a Debian-variant (Ubuntu 20.04.1 LTS) I created the ...
Grez's user avatar
  • 21
1 vote
0 answers
149 views

what are the leftovers from the previous builds of Qt?

it's been a while that I am trying to cross compile Qt for my Raspberry pi 4 on a lite version of OS (that has no desktop, no x server ..) on my Ubuntu 18.04 I tried many times and I changed the ...
mina's user avatar
  • 111
0 votes
1 answer
360 views

What is convention on where to install cross-platform libraries?

What is the prevailing (or correct) convention on where to install cross-platform libraries? E.g. libfoo.so.1.0.0 compiled for the host might typically be located at /usr/local/lib/. If I also had to ...
StoneThrow's user avatar
  • 1,787
1 vote
1 answer
4k views

Building a gcc cross compiler on linux, how do I know which "--target"s are supported and the exact keyword for specifying them?

I'm trying to build gcc compiler to producing executables that are supposed to run on x86-64 machines. I'm actually using existing 64bit gcc compiler on my computer. It is redundant but I'm doing it ...
User's user avatar
  • 254
0 votes
0 answers
267 views

Error on building gcc cross compiler toolchain

I'm following this guide to build a linux system for learning experience On the the guide at the section titled GCC (Static), I'm having an error, on running the command ` $ ln -vs libgcc.a `${...
User's user avatar
  • 254
1 vote
1 answer
231 views

Which of these commands actually installs gcc?

I'm writing a "custom" Linux system, mainly using this guide. Great guide! But, my problem is, once I boot into my system, I don't have gcc. Now, it's completely possible that I missed a ...
Bobbbay's user avatar
  • 411
1 vote
1 answer
3k views

-lcrypt error cross compiling 64 to 32

I am trying to compile dirtycow exploit file which can be found in here. gcc -pthread dirty.c -o dirty -m32 -lcrypt Because my target is 32 bit I compile it with -m32 and -lycrypt to make sure it ...
hanysfa's user avatar
  • 103

1
2 3 4 5 6