Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] running tools on build host?
@ 2010-11-07 10:49 Odd Arild Olsen
  2010-11-16 19:25 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Odd Arild Olsen @ 2010-11-07 10:49 UTC (permalink / raw)
  To: buildroot

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

oao

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Buildroot] running tools on build host?
  2010-11-07 10:49 [Buildroot] running tools on build host? Odd Arild Olsen
@ 2010-11-16 19:25 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2010-11-16 19:25 UTC (permalink / raw)
  To: buildroot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-16 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-07 10:49 [Buildroot] running tools on build host? Odd Arild Olsen
2010-11-16 19:25 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox