Unix/Linux Go Back    

Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Please: a litte help to crosscompile.


crosscompiler, solved

Thread Tools Search this Thread Display Modes
Old Unix and Linux 4 Days Ago   -   Original Discussion by Linusolaradm1
Linusolaradm1's Unix or Linux Image
Linusolaradm1 Linusolaradm1 is offline
Registered User
Join Date: Jun 2011
Last Activity: 16 May 2018, 3:23 PM EDT
Posts: 198
Thanks: 28
Thanked 7 Times in 6 Posts
Please: a litte help to crosscompile.

I have installed the "mipsel tuxbox" compile suite for crosscompile
Host system is x86_64 slackware
destination is mipsel32bit "vuduo+"

For example,I want to compile a program, I use this script

    make clean
    export TOOLCHAIN=/opt/mipsel-tuxbox-linux-gnu
    export PATH="$TOOLCHAIN/bin:$PATH"
    export CC=/opt/mipsel-tuxbox-linux-gnu/mipsel-tuxbox-linux-gnu/bin/gcc
    export RANLIB=/opt/mipsel-tuxbox-linux-gnu/mipsel-tuxbox-linux-gnu/bin/ranlib

Compile works but executable is..x86_64!

If I use this line give me a lot of error about includes not found

   make CC=/opt/mipsel-tuxbox-linux-gnu/mipsel-tuxbox-linux-gnu/bin/gcc STRIP=/opt/mipsel-tuxbox-linux-gnu/mipsel-tuxbox-linux-gnu/bin/strip CPPFLAGS="-I/opt/mipsel-tuxbox-linux-gnu/mipsel-tuxbox-linux-gnu/sysroot/usr/include/linux/ -I/opt/mipsel-tuxbox-linux-gnu/mipsel-tuxbox-linux-gnu/sysroot/usr/include/sys/"

What's wrong?

So I try this script and..doesn't work,executable is still x86_64

make clean
export TOOLCHAIN=/opt/mipsel-tuxbox-linux-gnu
export PATH=$PATH:/opt/mipsel-tuxbox-linux-gnu/libexec/gcc/mipsel-tuxbox-linux-gnu/4.8.1/
CROSS_COMPILE=/opt/mipsel-tuxbox-linux-gnu/bin/mipsel-tuxbox-linux-gnu- make all

Of course cross_compile is present in makefile.

---------- Post updated at 02:23 PM ---------- Previous update was at 02:13 PM ----------

Solution found

A script like this works fine

make clean
export TOOLCHAIN=/opt/mipsel-tuxbox-linux-gnu
export PATH=$PATH:/opt/mipsel-tuxbox-linux-gnu/libexec/gcc/mipsel-tuxbox-linux-gnu/4.8.1/:/opt/mipsel-tuxbox-linux-gnu/bin
export LDCFLAGS=/opt/mipsel-tuxbox-linux-gnu/lib
export LD_LIBRARY_PATH=/opt/mipsel-tuxbox-linux-gnu/lib
make CC=mipsel-tuxbox-linux-gnu-gcc LD=mipsel-tuxbox-linux-gnu-ld

The Following User Says Thank You to Linusolaradm1 For This Useful Post:
Corona688 (4 Days Ago)
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to enable ping?a litte complex Linusolaradm1 Solaris 13 04-10-2018 02:42 PM

All times are GMT -4. The time now is 12:21 PM.