Alljoyn - 15.09a build - linking issue on pi - build

15.09 does build fine on my normal linux system (ubuntu 64bit 14.04).
When trying to build Alljoyn 15.09a on my raspberry pi b+
using
scons CPU=arm OE_BASE=/usr CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- BINDINGS=cpp BT=off ICE=off WS=off
the build stops with with a linker error when linking alljoyn/test/proptester
anyone else encountering this?
15.04 builds fine on the pi.
15.09 fails the same way.
Is there a way to disable building the test programs?
Only thing I saw inside the bug tracker that might be related is:
https://jira.allseenalliance.org/browse/ASACORE-2642

Related

How to invoke clang to use current OS GLIBC?

I am building an application in which the application is using GN and ninja to build files. The application is currently building on Ubuntu 20.04 and I am using clang to compile files. But the issue is when I try to build and execute the executable in Ubuntu 18.04, it is giving me this error:-
./application: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /path/to/lib.so)
So, this basically means that clang is not able to build the files according to the current OS. Is there any flag I need to use to make it work with the current OS? or is there any other to overcome this issue?

'CXXABI_1.3.11' not found`

I can't get a cross compiled build running on my Raspberry Pi 1 B+. The error I keep getting is:
ImportError: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version 'CXXABI_1.3.11'
not found. I tried multiple compilers with different settings but I keep getting the same error. Also changing the LD_LIBRARY_PATH to the location of libstdc++ on my Pi didn't work. Today I got a sort of breakthrough finding out that the make process outputs "will change in GCC 7.1" after an argument. I'm not a hundred percent sure that this is what cause the error, but GCC 7.1 comes with version 1.3.11 of CXXABI, so I suspect it to be the cause. Is there anybody that knows how to stop this from happening? I'm building on a VM with Ubuntu 17.10. I'm building using sh autogen.sh; ./configure --host=arm-linux-gnueabihf; make -j8
Thanks
Edit: Found the solution myself, it was: export CXX=/path/to/toolchain/arm-linux-gnueabihf-g++
Your cross-GCC comes with a version of libstdc++.so which is not compatible with the one installed on your system. You can either run compiled program with modified LD_LIBRARY_PATH (or -Wl,-rpath), pointing to directory with cross-compiler's libstdc++.so, or downgrade your cross-compiler to match your distro.

How to Cross-Compile Raspberry Pi using Eclipse on Windows

Recently, I got a new raspberry pi, and I want to use Eclipse on Windows with MinGW compiler to build c++ codes and run them on the raspberry pi. Is there any way to do that?
You need Cross-Compilation. When you create a project you need to Select the Cross GCC Toolchain and you need to set the Cross compile prefix to: "arm-linux-gnueabihf-"
Tutorial

Cross compile google v8 library for raspberry pi

I am having a problem with cross compiling google v8 libraries for raspberry pi, and constantly getting "Illegal instruction" error when compiling official sample from site. These are the steps i followed:
Downloaded cross compile https://github.com/raspberrypi/tools/
Cloned v8 git https://chromium.googlesource.com/v8/v8.git
Exported CXX LINK point to arm-linux-gnueabihf-g++ from cross compile tools.
run make arm.release armv7=false hardfp=on snapshot=off armfpu=vfp armfloatabi=hard -j5
Copied generated executable shell and d8 from out/arm.release directory to pi (Raspbian kernel version 3.6.11) and it WORKS.
These steps prove that cross compilation toolchain is functional.
Problem occurs when trying to run other cross-compiled software that is linked to v8 libraries. For example sample code from https://developers.google.com/v8/get_started#intro.
Code is cross-compiled with this command (same as example, just changed compiler)
arm-linux-gnueabihf-g++ -I. hello_world.cc -o hello_world -Wl,--start-group out/x64.release/obj.target/{tools/gyp/libv8_{base,libbase,snapshot,libplatform},third_party/icu/libicu{uc,i18n,data}}.a -Wl,--end-group -lrt -pthread
When i copy that code to pi and run it i get SIGILL (Illegal instruction).
Note: cross compiled software that doesn't use v8 libraries works fine. Also x64 v8 libraries on host computer work fine.
On newer kernel versions shell and d8 were also throwing SIGILL but than i switched to older version 3.6.11 (problems with newer kernel https://groups.google.com/forum/#!topic/v8-users/IPT9EeYK9bg) and they started working, but compiled sample code is still showed same issues.
Did anyone have similar experience? Any suggestion on how to overcome this problem?
I found a solution thanks to post on v8 google group. https://groups.google.com/forum/#!topic/v8-users/LTppUbqNrzI
Problem was in make arguments it should be.
make arm arm_version=6 armfpu=vfp armfloatabi=hard

Cross-Compiling for RaspBerry Pi

With a RaspBerry Pi and from my computer, I'm trying to cross-compile a simple helloWorld written in C++. I'm using Code Sourcery toolchain for linux to compile.
When copy the helloWorld binary to raspBerry by TFTP and give it execution permissions with chmod, the next error appears:
"Illegal instruction"
If make a 'file' over binary I get:
"raspberry: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped"
This is because I used "-static -static-libstdc++" when linking.
If I don't use static linking, the error is:
"Segmentation fault"
The Code:
/*
* main.cpp
*
* Created on: 26/06/2012
* Author: ccortiz
*/
#include <iostream>
using namespace std;
int main(void){
cout << "Hello Cross Compilling for ARM!" << endl << flush;
return 0;
}
How could I compile and run my program in a right way?
Thanks.
The reason why are you getting Segmentation fault error is different ABI. Raspberry Pi when running Raspbian is using linux-arm-gnueabihf ABI which assumes hardfp and VFP support in hardware (which is rare in ARMv6 environment) so requires some additional patches for GCC and EGLIBC (these patches can be found in Raspbian repository).
Your Code Sourcery cross-toolchain most likely does not have these patches, so it's using another ABI (linux-arm-gnueabi) hence the crash at runtime (static linking works because kernel ABI does not depend on hardfp/softfp).
Another possible reason why you may be getting Illegal Instruction error is Code Sourcery cross-toolchain configured for ARMv7 and Raspberry Pi is ARMv6. But in this case both static and dynamic linking will yield the same error.
Here is a step-by-step guide how to build Raspberry Pi cross compiler in Windows, both hardfp/softfp ABI versions. Resulting cross-compiler supports C++ and does not depend on cygwin runtime library (cygwin1.dll).
The problem was to use ASCII mode instead of binary mode in my FTP transfers.
Today I prefer to use SFTP (SSH).
Thanks.
I'd recommend trying biicode, it automatically sets up the cross compiler environment for you and sends generated binaries to the raspberry after building
You could try the toolchain at: https://github.com/kallaballa/Raspberry-GCC-4.7.3
It's a pre-built gcc-4.7.3 toolchain for armv6 with hardfp using gnueabi. I'm using it to cross compile c++11 for a raspberrian target.
Please note it only works on linux x86_64 hosts.
My recommendation is here, http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
He does a good job on explaining how to use Eclipse to compile HelloWorld.cpp, download, and execute it in Raspberry pi board. Check it out.
Using Visual studio and Visual GDB plugin you can download cross compiler for raspberry pi. After that you can create a ssh connection and also you can deploy your program remotely into raspberry pi.