顯示具有 Cross Compile 標籤的文章。 顯示所有文章
顯示具有 Cross Compile 標籤的文章。 顯示所有文章

2016年12月20日 星期二

[Samba][ARM] samba-4.1.5 cross compile for ARMv7

Download Samba from github
Samba for ARM

Download repository from github
git clone https://github.com/Jumbo88888/Samba

Modify auto.sh
cd Samba/EMBED/samba

Modify following ARM-gcc
CC=arm-linux-gnueabihf-gcc \
AR=arm-linux-gnueabihf-ar \
CPP=arm-linux-gnueabihf-cpp \
RANLIB=arm-linux-gnueabihf-gcc-ranlib \
Save it.

Start to compile the code.
make && make install

2016年11月30日 星期三

[Compiler Server] Building compiler server for ARM

Install library package for 32bit



Edit /etc/pacman.conf

[multilib]
Include = /etc/pacman.d/mirrorlist



update the package list and upgrade with pacman -Syu
pacman -Syu

pacman -S lib32-zlib # Compression library implementing the deflate compression method found in gzip and PKZIP (32-bit)
pacman -S lib32-gcc-libs # Runtime libraries shipped by GCC (32-bit)
pacman -S lib32-glibc # GNU C Library (32-bit)


Install system tool package



Download Regina-REXX-3.9.1.tar.gz and compile it.
After compile the package, then install it.
Regina-REXX-3.9.1.tar.gz

sudo pacman -S bison
sudo pacman -S flex
sudo pacman -S intltool
sudo pacman -S lzop
sudo pacman -S libtool
sudo pacman -S ccache
sudo pacman -S jdk8-openjdk 


Envrionment settings



Set python to version 2.7
Using python2.7 compile the code.
cd /bin
ln -sf python2.7 python


Add following code into .bashrc
vim ~/.bashrc

export CXC_COMPILER_ROOT_DIR=/opt/toolchains/zOEMtools_eCos/eCos20/gnutools/mipsisa32-elf-i386-linux
export GNUTOOLS=/opt/toolchains/zOEMtools_eCos/eCos20/gnutools
export ARM_TOOLCHAIN_PATH=/opt/toolchains/stbgcc-4.5.4-2.5/bin
PATH=$CXC_COMPILER_ROOT_DIR/bin:/opt/toolchains/BrcmUtils:/opt/toolchains/stbgcc-4.8-1.5/bin:/opt/toolchains/uclibc-crosstools-gcc-4.2.3-4/usr/bin:$ARM_TOOLCHAIN_PATH:$PATH

2016年1月8日 星期五

[Cross Compile][C] How to compile code by using cross compile

Copy all header file and share library to separate folder. (include & lib)


Set path which can find armeb-gnueabi-cc.
Ex:
set PATH=$PATH:/opt/bin


Start to compile the code.
Compile one c file by using cross compiler.
armeb-gnueabi-cc \
-I/home/happy/include/ \
-L/home/happy/lib/ \
-lticc \
send.c -o icc_send


-I = The folder of header file
-L = The folder of share file
-l = Indicate which share library need to be used

2015年8月30日 星期日

[crossdev][Gentoo] use crossdev to build own toolchain


Install crossdev
emerge sys-devel/crossdev

Build the folder of portage
mkdir -p /usr/local/portage/

crossdev –ov-output /usr/local/portage/ -S -t armv7a-hardfloat-linux-gnueabi
 * crossdev version:      20150602
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   arm
 * Target System:         armv7a-hardfloat-linux-gnueabi
 * Stage:                 4 (C/C++ compiler)
 * ABIs:                  

 * binutils:              binutils-[stable]
 * gcc:                   gcc-[stable]
 * headers:               linux-headers-[stable]
 * libc:                  glibc-[stable]

 * CROSSDEV_OVERLAY:      /usr/local/portage/
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    
 * Portage flags:         

Reference:


Meet Problem
Q:
* You need to specify an output overlay. Please use –ov-output, or consult
* https://wiki.gentoo.org/wiki/Overlay/Local_overlay for more details.


A:
add following parameter to crossdev -S -t armv7a-hardfloat-linux-gnueabi
–ov-output /usr/local/portage/
Reference:

2015年6月17日 星期三

[Cross Compile] How to set parameter into Linux environment


1. Add following command to .bashrc
[Example]
For binary:
export PATH=:\
/opt/toolchain/usr/bin:\
$PATH

For library:
export LD_LIBRARY_PATH=/opt/toolchain/usr/lib/:\
/opt/toolchain/usr/armeb-linux/sysroot/usr/lib:\
/opt/toolchain/usr/linux-gnu/armeb-linux/lib/:\
$LD_LIBRARY_PATH

2. Compiler the package which you want. like tar or whatever.
If you have .configration error, please look config.log.