FAQ Database Discussion Community


C++ cross-compile not handling newline input text file

c++,newline,cross-compiling
For clarity: This is NOT a duplicate of Getting std :: ifstream to handle LF, CR, and CRLF? This IS an extension of C++ cutting off character(s) when read lines from file I state this up front because when I posted the question at C++ cutting off character(s) when read...

Cross compiled py-spidev for arm

python,arm,cross-compiling
I'm trying to cross-compiled py-spidev module for an ARM9 (embedded system). So in a Ubuntu 64 bits VM, I did (in my home directory): git clone https://github.com/doceme/py-spidev cd py-spidev export PATH=$PATH:"Path_to_my_cross_compiler" export ARCH=arm export CROSS_COMPILE=arm-none-linux-gnueabi- python setup.py install --prefix=~/ But spidev_module.c is compiled with x86_64-linux-gnu-gcc and not my cross-compiler (arm-poky-linux-gnueabi-gcc)....

Cross compile stunnel

linux,makefile,cmake,arm,cross-compiling
I am having difficulties with cross compiling stunnel for an ARM device. Cross compiling OpenSSL was done via this CMake project: http://www.valvers.com/open-software/projects/openssl-cmake/ and it runs successfully on the target device. The CMake toolchain file I use when compiling OpenSSL: SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_C_COMPILER /home/elias/toolchains/axotec/3.4.1/bin/arm-linux-gcc) SET(CMAKE_CXX_COMPILER /home/elias/toolchains/axotec/3.4.1/bin/arm-linux-g++) SET(CMAKE_FIND_ROOT_PATH /home/elias/toolchains/axotec/3.4.1/arm-linux...

Installing libraries for arm-gcc-compiler

linux,gcc,arm,cross-compiling,embedded-linux
I have a functional arm cross compiler that I can use with arm-linux-gnueabi-gcc command. This works for simple programs but I run into problems when I have to compile bigger programs requiring libraries like x11, opengl as the required headers/files are not present in arm-linux-gnuebi directory but in normal gcc...

using Diab, dcc 5.9.4 to compile a windows executable

embedded,cross-compiling,wind-river-workbench
I'm doing some experiments with an evaluation version of the WindRiver dcc diab compiler. I would like to do some testing on my Windows PC. However I think I have the wrong target setup. I've got as far as using the 'dctrl -t' command to get the list of target...

Building libobjc2 with CMake + Clang + MinGW on Linux

cmake,clang,cross-compiling,mingw-w64,libobjc2
I'm trying to cross compile libobjc2 from Arch to Windows. I use the following command to configure with CMake: cmake .. -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS=$CLANG_WINDOWS_XFLAGS -DCMAKE_CXX_FLAGS=$CLANG_WINDOWS_XFLAGS -DCMAKE_INSTALL_PREFIX:PATH=/opt/cross/windows/gnustep CLANG_WINDOWS_XFLAGS is defined as: export CLANG_WINDOWS_XFLAGS="-target x86_64-w64-mingw32 -nostdinc -isystem /usr/lib/clang/3.6.0/include -isystem...

Install cross-compiler in debian

gcc,debian,cross-compiling
I am trying to install a cross-compiler in Debian, but I encountered the following error: arm-linux-gnueabihf-gcc: command not found When I try to install it: apt-get install gcc-arm-linux-gnueabihf It says unable to locate package gcc-arm-linux-gnueabihf (the tutorial I am following)....

Linux: Compiling userspace code for handling driver's ioctl

linux-kernel,linux-device-driver,cross-compiling,embedded-linux
I'm new to kernel compilation and am trying to cross-compile a userspace program for an existing kernel driver for an ARM board. Basically, I'm trying to access the ioctl facilities of the driver. I'm using arm-linux-gnueabihf-gcc (4.9.2). I can compile the kernel successfully. The userspace code looks like following getefuse.c...

How to cross compile a .c file for Openwrt?

linux,arm,cross-compiling,beagleboneblack,openwrt
I am trying to cross compile a .c file for Openwrt. I downloaded Openwrt and added my file in package directory and created Makefile for it but while compiling it is skipping. I don't know what is wrong This the Makefile : * include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=gav PKG_VERSION:=1 PKG_RELEASE:=1...

Trouble with Cross Compiling Asterisk

cross-compiling,asterisk
I've trying to Cross Compile Asterisk for Armhf platform. I was using g++-arm-linux-gnueabihf && gcc-arm-linux-gnueabihf packages for cross-compiling Asterisk with 2 following prerequisite : SQlite3 : ./configure --prefix=/usr/arm-linux-gnueabihf --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc make && make install Ncurses : ./configure --host=arm-linux-gnueabihf --prefix=/usr/arm-linux-gnueabihf CXX=arm-linux-gnueabihf-g++ make && make install When I cross compile Asterisk...

Undefined reference to printf when using GCC cross compiler

c,gcc,mips,cross-compiling,undefined-reference
I'm trying to get the following simple 'Hello World' program to compile using a cross compiler (GCC 4.9.2) targeting mips: #include <stdio.h> int main() { int x = 5; printf("x = %d\n", x); } The x variable is there to stop GCC changing printf to puts, which it seems to...

Android NDK OpenSSL error cross-compiling

c,windows,android-ndk,openssl,cross-compiling
I am new in NDK and I am following this guide to build OpenSSL for Android, I am using Windows 7 and Cygwin for this. I'm having errors when trying to build the OpenSSL library. # From the 'root' directory $ . ./setenv-android.sh $ cd openssl-1.0.1g/ $ perl -pi -e...

How to Compile Google stressapptest for Android x86 Phone?

android,compilation,android-ndk,cross-compiling,stress-testing
Step (1) Download Source svn checkout http://stressapptest.googlecode.com/svn/trunk/ stressapptest Step (2) How to Compile above Code for Android x86 Phone ? Answer Not available with me. Step (3) How to Install ? adb push stressapptest /data/local/tmp/ adb shell chmod 777 /data/local/tmp/stressapptest adb shell /data/local/tmp/stressapptest Step (4) How to Run ? User...

Raspberry pi kernel 3.2.27 no keyboard detected on boot

keyboard,kernel,raspberry-pi,cross-compiling,boot
I'm trying to cross-compile a driver for Raspberry Pi. The driver works in kernel 3.2 so I downloaded the 3.2.27 raspberry pi's kernel. I compiled the kernel as follows: make -j3 ARCH=arm CROSS_COMPILE=<dir>/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- make -j3 ARCH=arm CROSS_COMPILE=<dir>/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- modules make -j3 ARCH=arm...

Cross-compile node module with native bindings with node-gyp

node.js,amazon-web-services,cross-compiling,node-gyp,aws-lambda
I'm using AWS Lambda, which involves creating an archive of my node.js script, including the node_modules folder and uploading that to their infrastructure to run. This works fine, except when it comes to node modules with native bindings (using node-gyp). Because the binding was complied and project archived on my...

How to deal with libraries like Boost when cross compiling for arm?

ubuntu,cmake,g++,cross-compiling,beagleboneblack
I'd like to cross compile from my AMD64 desktop to ARM7 for Beagleboard Black. So I started with this to get the cross compilers installed: sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf I also created a cmake toolchain file: set (CMAKE_SYSTEM_NAME Linux) set (CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) set (CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) When I run cmake,...

Rebar: Cross Compilation Options

erlang,cross-compiling,rebar
I'm trying use rebar to generate a 32-bit arch release on 64-bit arch system. It's unclear to me how I need to modify an application's rebar.config to be able to do this. I have taken a look at the rebar source to see how they are detecting my environment: rebar_utils.erl...

Prelink Error: prelink-cross: simple hello world example

c++,compilation,arm,cross-compiling,prelink
I am trying to cross-prelink a simple hello world program. I use the cross-compile toolchain arm-2012.03-57-arm-none-linux-gnueabi-i686-pc-linux-gnu and I am not sure if I have used the prelink-cross options correclty. I'll be glad if someone could point me to the right direction. More details about the source code on github. Thank...

arm-linux-gnueabi-ld and fpc ppcrossarm still links to linux-i386

linux,arm,cross-compiling,freepascal
I was able to build a freepascal crosscompiler for arm, but now when i want to build a a simple graphical app in lazarus or rebuild LCL the compilation works until is called arm-linux-gnueabi-ld which one still looking for all graphics librarys in /usr/lib/gcc/i586-linux-gnu/4.9/ instead /usr/lib/gcc/arm-linux-gnueabi/4.9. so how i can...

How to export a program with an alternate extension in SCons on Windows

compilation,compiler-errors,cross-compiling,scons
I am using SCons to cross-compile embedded code using a Windows host. My colleagues are running Ubuntu. We have many lines in our SConscript files like the following: prog = env.Program("progname.elf", obj, libs) On Ubuntu this works fine. On Windows it fails with the following error: scons: *** An executable...

How to cross-compile with MinGW on Linux for Windows?

linux,mingw,qt5,cross-compiling,travis-ci
I'm trying to compile a Qt5 application for Windows on Linux with MinGW. I'm using Travis-CI to get continuous builds of two windows executables (win32, win64). I've set up a build matrix, which contains the definition of the different MinGW dependencies. The before-install section defines the Qt, MinGW and gcc...

Cross compiling driver for mips

driver,mips,cross-compiling
I am trying to compile a simple driver example for a mips device. The driver is really just a test: #include <linux/init.h> #include <linux/module.h> MODULE_LICENSE("Dual BSD/GPL"); int ath_pci_init(void) { printk(KERN_ALERT "alive and hacked\n"); return 0; } void ath_pci_exit(void) { printk(KERN_ALERT "dead and hacked\n"); } module_init (ath_pci_init); module_exit (ath_pci_exit); And compiles...

How to cross-compile asterisk with dahdi already cross-compiled for arm?

linux-kernel,arm,cross-compiling,asterisk
I'm trying to cross-compile asterisk for ARM. Everything's fine when I cross compile mandatory modules like sqlite3, ncurses and openssl and then including them when cross-compiling asterisk with their respective option --with-sqlite3, --with-ncurses --with-crypto and --with-ssl. But when I tried to include dahdi, nothing came true. This happened when --with-dahdi=$(DAHDI_DIR)/linux:...

BeagleBoneBlack Cross Compile on Mac Error

c++,arm,cross-compiling,beagleboneblack
I use gcc-linaro-arm-linux-gnueabihf-2014.05 for cross-compling BeagleBoneBlack (Rev c) on my mac using eclipse. I used this weblog instructions: http://www.welzels.de/blog/en/arm-cross-compiling-with-mac-os-x/ when I compile the hello world sample it works "ok" on BBB, but the problem is when I compile my full program using pthread and stdio and etc... it fails to...

Assembly unknown mnemonic AArch64 ARMv8

gcc,assembly,cross-compiling,arm64
I'm trying to compile a project (from GitHub: link) with a couple of assembly files, which are written for the ARMv8 AArch64 architecture. When I try to compile these files I get the same error on pretty much every line, it starts with: authenc_ac_gcm_low.S: Assembler messages: authenc_ac_gcm_low.S:80: Error: unknown mnemonic...

Finding the last variable in __attribute__(section)

c,linker,cross-compiling,gnu,xilinx
I'm currently working on an embedded system, and in order to meet time constraints I've needed to lock some code in cache. I've placed all the functions I will need to be locked cache into the section MEMORY_CACHEABLE by using the section variable attribute. Because the board I'm using sets...

Build DAHDI for Beablebone Black

linux,linux-kernel,cross-compiling,asterisk,beagleboneblack
I'm planning to build DAHDI for Beagleboneblack Firstly, I built the kernel for BBB completely by following this tutorial http://elinux.org/Building_BBB_Kernel, make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- beaglebone_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtbs make ARCH=arm CROSS_COMPILE=arm-linux-gnu- uImage-dtb.am335x-boneblack modules I used linaro toolchain for armhf (CROSS_COMPILE=arm-linux-gnueabihf-) instead of the instructed one. And then I start...

Can I use CMAKE_SYSTEM_PROCESSOR, defined in a toolchain file, in CMakeLists?

c++,cmake,arm,raspberry-pi,cross-compiling
I'd like to add Raspberry Pi as a cross compilation target to a C++ project which uses CMake. Following the accepted answer to this question, I've set up the environment successfully. The project has many build targets already, all of them defined in the main CMakeLists.txt in a quite ugly...

arm-none-eabi-g++ compiler throws compilation error pthread_exit was not declared in this scope

c++,linux,c++11,debian,cross-compiling
Running in debian linux arm-none-eabi-g++ pthread.c -o pthread -lpthread throws below compilation error. But if I run the g++ pthread.c -o pthread -lpthread there is no compilation errors. I never used cross compiler. I knew there is problem in linking in libraries. Please help me. I searched lot in the...

Cross compiling for Raspberry pi 2 error

c,gcc,raspberry-pi,cross-compiling,raspberry-pi2
I wanted to start cross compiling for raspberry pi2 on Ubuntu 32bit (in virtual box), so I downloaded the toolchain on the github site (https://github.com/raspberrypi/tools) and tried to compile a simple hello world program with the command (I've included the path to the bin folder that contains arm-linux-gnueabihf-gcc-4.8.3 to the...

Error when trying to compile chromium on Ubuntu 14.04

python,ubuntu,cross-compiling,chromium
I am following this link to compile Chromium Browser and I successfully walked through each step but I get the following error at the 17th step: gclient sync: [email protected]:~/chromium/buildhost/src$ gclient sync Syncing projects: 4% ( 3/72) src/chrome/tools/test/reference_build/chrome_linSyncing projects: 5% ( 4/72) src/sdch/open-vcdiff Syncing projects: 100% (75/75), done. ________ running '/usr/bin/python...

Illegal instruction when running simple ELLCC-generated ELF binary on a Raspberry Pi

arm,raspberry-pi,cross-compiling,raspbian,ellcc
I have an empty program in LLVM IR: define i32 @main(i32 %argc, i8** %argv) nounwind { entry: ret i32 0 } I'm cross-compiling it on Intel x86-64 Windows for ARM Linux using ELLCC, with the following command: ecc++ hw.ll -o hw.o -target arm-linux-engeabihf It completes without errors and generates an...

Building glibc for cross compiler fails on Cygwin

windows,gcc,cygwin,cross-compiling,glibc
I'm trying to build a cross-compiler toolchain under Cygwin on Windows so that I (or rather someone I'm helping out - I'd use Linux but Windows is much easier for many people) can compile sources targeting the MIPS architecture. I have a script which successfully builds a cross-compiler toolchain for...

LLVM: How to Cross Compile C++ Programs

c++,llvm,cross-compiling,clang++,libstdc++
I tried to use LLVM to compile C++ source code to arm binaries. Here's an example: //hello.cpp #include <iostream> int main() { std::cout << "Hello World!\n" << std::endl; return 0; } I use the following commands: clang++ -emit-llvm -c hello.cpp -o hello.bc llc -march=arm hello.bc -o hello.s // I do...

How to install gcc-arm-none-eabi for MinGW users?

c++,windows,gcc,arm,cross-compiling
I am interested in taking my C++ program and cross compiling it into something that can run on an ARM MCU. To do this, I am required to have gcc-arm-none-eabi installed. I'm currently on a Windows 7 machine, and so I have installed GCC/make/g++/etc. via MinGW. From the research I've...

Linking issue with libcrypto: undefined reference to `__imp__CertFreeCertificateContext'

c++,qt,mingw,cross-compiling,bitcoin
I'm trying to cross-compile cachecoin binaries on a linux host using gitian and i686-w64-mingw for a windows target. The compilation works fine until the final step of static linking of the dependencies. This is what I get: /home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x1ff): undefined reference to `[email protected]' Google suggests it's a missing -lcrypto link or...

Where to go from Sourcery CodeBench **LITE** [closed]

linux,arm,cross-compiling,archlinux
I have been using Sourcery CodeBench LITE for ARM targets until today when I realized that it is no longer available for ARM targets. Instead Mentor graphics wants us to pay the nonfree Sourcery CodeBench. I wonder. Isn't Sourcery CodeBench LITE derived from GNU GCC? Then why don't they make...

cross compile Boost 1.57.0 on ubuntu for arm

g++,arm,cross-compiling
I am new into cross compile process. Need to cross compile boost library for arm. Please suggest step to cross-compile boost library. Is it possible to cross compile required feature of boost library?

JDK Cross Compilation uses which version of JAX WS and JAXB?

java,maven,jaxb,jax-ws,cross-compiling
I have JDK 8 installed on my machine. My code's POM has a Maven Compiler Plugin which uses source value as 1.7 and target as 1.8 I have JAXWS and JAXB dependency in my code. JDK 8 comes bundled with 2.2.9 version of JAXWS and JAXB. JDK 7 with 2.2.4...

How to build x86 and/or x64 on Windows from command line with CMAKE?

c,visual-studio,cmake,cross-compiling,x86-64
One way to get cmake to build x86 on Windows with Visual Studio is like so: Start Visual Studio Command prompt for x86 Run cmake: cmake -G "NMake Makefiles" \path_to_source\ nmake One way to get cmake to build x64 on Windows with Visual Studio is like so: Start Visual Studio...

how can I prevent arm-none-eabi compiler generating main symbol

gdb,cross-compiling,debug-symbols
I'm using arm-none-eabi to compile source file. after compiling and generating elf file. I got the following symbols using nm command 00021da8 T ISR_Init U main U malloc 010008b0 D MASTER_AHB_MAP I'm using gdb to debug, but I have problem with main symbol which is not defined. gdb generate following...

Cross compilation: can't resolve symbol 'register_printf_function'

linux,linker,shared-libraries,cross-compiling
I have cross-compiled strongswan-5.2.2, a open source project implementing VPN server&client, for embedded-linux running on mipsel (target) on Ubuntu12.04 running on Intel x86 machine. But executing the cross-compiled strongswan on mipsel machine fails as follows: $ ./charon ./charon: can't resolve symbol 'register_printf_function' It seems like that libc.so is not refereed...