gcc-cross-compiler | compile GCC toolchain for various target architectures | Compiler library
kandi X-RAY | gcc-cross-compiler Summary
kandi X-RAY | gcc-cross-compiler Summary
A script to cross-compile GCC toolchain for various target architectures.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build the target
- Build a gcc
- Build binutils
- Build gdb
- Removes previous build files
- Unpack tarballs
- Create directory
- Delete a directory
- Unpack a tarball
- Return the target for the given platform
- Prepare the binaries
- Show the available dependencies
- Download a GCC package
- Check the integrity of an archive
- Check the headers
- Check the dependencies of a given dependency
gcc-cross-compiler Key Features
gcc-cross-compiler Examples and Code Snippets
Community Discussions
Trending Discussions on gcc-cross-compiler
QUESTION
I've built the cross toolchain for Linux under CYGWIN environment using the article at https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/ as a source.
Compilation and installation finished with success.
Used components are:
- binutils-2.35
- cloog-0.18.1
- gcc-10.2.0
- glibc-2.32
- gmp-6.1.2
- isl-0.20
- linux-5.9.3
- mpc-1.1.0
- mpfr-4.0.2
GCC is configured as:
...ANSWER
Answered 2020-Nov-16 at 11:07I've managed to solve the issue.
The problem was in the sys-include directory
opt/cross/x86_64-unknown-linux-gnu/sys-include
This directory has include files with the same names as the ones from
opt/cross/x86_64-unknown-linux-gnu/include
but with different content.
The sys-include
directory was searched by the compiler before the regular include
.
Renaming or removing sys-include
solves the issue and code can be compiled.
I don't know the purpose of the sys-include
directory, when it was created and why the duplicated files in this directory have another content.
Accepting my own post as answer to indicate that the issue can be solved.
QUESTION
I followed this guide to build a cross compiler for Raspberry Pi ARMv7. It works fine (compiles ok hello world) but the problem is I can't use Raspberry Pi libraries such as wiringpi, sqlite etc.
This is my Makefile.
...ANSWER
Answered 2020-Apr-17 at 17:32You have to tell the linker where to look for the libraries.
You can add the flag -L$HOME/raspberrypi/rootfs/usr/lib
, or wherever libwiringPi.so
is located.
You have to point the compiler to the right headers as well. For that you use the -I
flag. E.g. -I$HOME/raspberrypi/rootfs/usr/include
. This goes in the CFLAGS
of the targets that include wiringPi.h
.
Also, -lwiringPi -pthread -lpthread
don't belong in the CFLAGS
, they are linker flags. You only need them in the target that builds PROGRAM
. You could add a separate variable LDFLAGS
, for example.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gcc-cross-compiler
You can use gcc-cross-compiler like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page