c - run a 32bit program on a 64bit gentoo linux -


i having difficulties running 32bit code on 64bit gentoo, program simple:

#include <stdio.h>  main() {         printf("hello world");     } 

i compiled gcc -m32 -o hello32 hello.c. output seems correct:

ozn@yeni2gen:~$ gcc -m32 -o hello32 hello.c ozn@yeni2gen:~$ file hello32  hello32: elf 32-bit lsb executable, intel 80386, version 1 (sysv), dynamically linked, interpreter /lib/ld-linux.so.2, gnu/linux 2.6.32, not stripped 

but when try run file error:

./hello32  bash: ./hello32: no such file or directory 

updated

ozn@yeni2gen:~$ bash --version gnu bash, version 4.2.53(1)-release (x86_64-pc-linux-gnu) copyright (c) 2011 free software foundation, inc. license gplv3+: gnu gpl version 3 or later <http://gnu.org/licenses/gpl.html>   ozn@yeni2gen:~$ gcc -v using built-in specs. collect_gcc=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3/gcc collect_lto_wrapper=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.3/lto-wrapper target: x86_64-pc-linux-gnu configured with: /var/tmp/portage/sys-devel/gcc-4.8.3/work/gcc-4.8.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.3/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='gentoo 4.8.3 p1.1, pie-0.5.9' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --enable-lto --without-cloog --enable-libsanitizer thread model: posix gcc version 4.8.3 (gentoo 4.8.3 p1.1, pie-0.5.9)  

for skeptic, file there:

ozn@yeni2gen:~$ ls -l hello32  -rwxr-xr-x 1 ozn ozn 6825 may 31 19:04 hello32 

ok, hints. apparently, doing wrong gentoo. after digging lot in gentoo forums, , hints here, found solution:

(root)# ln -vs /lib32/ld-linux.so.2 /lib/ld-linux.so.2 

the original discussion in gentoo forums gave me hint.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -