From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] running tools on build host?
Date: Tue, 16 Nov 2010 20:25:37 +0100 [thread overview]
Message-ID: <20101116202537.37f4ab2f@surf> (raw)
In-Reply-To: <201011071149.48457.oao@oao.no>
Hello,
On Sun, 7 Nov 2010 11:49:47 +0100
Odd Arild Olsen <oao@oao.no> wrote:
> I have built the gcc/uclibc toolchain and got the files installed in a
> /usr/local directory.
>
> I develop for an embedded i386 machine and need uClibc for that.
>
> I also wish to execute the compiled programs on the build machine during
> development. But I have not found any combination of options and environment
> variables that let me run the program with dynamic linking. The linker always
> goes to the /lib directory and gets confused by libc6 stuff.
>
> I can compile and run a statically linked program
>
> And I can compile the program and then copy the executable to the root image,
> chroot and run it
>
> Are there any way I can set this up so I can run my programs on the build host
> without copying the toolchain librariess to /lib
This is a bit clunky, but you could try something like :
gcc -o foobar foobar.c \
-Wl,--dynamic-linker=/path/to/your/lib/ld-uClibc.so \
-Wl,-rpath=/path/to/your/lib \
-Wl,-rpath=/path/to/your/usr/lib
I haven't tried, so I don't know if it really works, but it probably
should. Running your programs inside a chroot is definitely a better
solution.
Regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
prev parent reply other threads:[~2010-11-16 19:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-07 10:49 [Buildroot] running tools on build host? Odd Arild Olsen
2010-11-16 19:25 ` Thomas Petazzoni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101116202537.37f4ab2f@surf \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox