running tools on build host?
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
Hello,
Quoted 10 lines · On Sun, 7 Nov 2010 11:49:47 +0100 Odd Arild Olsen <[email protected]> wrote:
I have built the gcc/uclibc toolchain and got the files installed in a
/usr/localdirectory.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.
Quoted 7 lines
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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com