Re: building 32-bit app on 64-bit system



On 9 июн, 19:07, Rainer Weikusat <rweiku...@xxxxxxxxxxx> wrote:
Andrey Rusanov <rusanov...@xxxxxxxxx> writes:

[...]



3. add path to 32bit libgcc
build command:
g++ -m32 -L/opt/lib32/usr/lib -L/opt/lib32/usr/lib/gcc/i686-pc-linux-
gnu/4.4.3 emtyapp.cpp
output:
/usr/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /
lib/libc.so.6
/usr/bin/ld: cannot find /lib/libc.so.6
collect2: ld returned 1 exit status

4. add path to  32bit libc.so.6
build command:
g++ -m32 -L/opt/lib32/usr/lib -L/opt/lib32/usr/lib/gcc/i686-pc-linux-
gnu/4.4.3 -L/opt/lib32/lib emtyapp.cpp
output:
/usr/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /
lib/libc.so.6
/usr/bin/ld: cannot find /lib/libc.so.6
collect2: ld returned 1 exit status

So problem is that linker is looking for "/lib/libc.so.6" instead of
"lc".

-lc is a request to the linker to link with the first file named
libc.so* or libc.a* found in the current library search
path. Consequently, the output quoted above tells you that no
compatible C-library was found in the place where you believed one to
be (/opt/lib32/lib)

ok, in this case linker must look for "libc.so.6". but not for "/lib/
libc.so.6".
/lib/libc.so.6 - is default location of libc.so.6.

i tried to use -L/opt/lib32 hoping linker will concatenate it with /
lib/libc.so.6, but no success.
.



Relevant Pages

  • Re: Scriptbasic - Compiling the generated C code
    ... compiler), which I have used in the past, tell me that it has a GCC ... a command line similar to Microsoft C. ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.system)
  • Re: building 32-bit app on 64-bit system
    ... (The compiler turns printf with a constant format, ... build command: ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.apps)
  • Re: TRUE is 0 is FALSE
    ... In shell TRUE is 1 and FALSE is zero as evidenced by this code: ... It isn't intended to show exit status, it shows OUTPUT of the boolean ... by conditional statements of the shell command language, ... the exit status is 0 for SUCCESS and 1 for FAILURE. ...
    (comp.unix.shell)
  • Re: building 32-bit app on 64-bit system
    ... Andrey Rusanov writes: ... build command: ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.apps)
  • Re: [PATCH] Avoid overflows in kernel/time.c
    ... collect2: ld returned 1 exit status ... but the timeconst stuff worked fine. ... I tried it both from the command line and using your xb script. ...
    (Linux-Kernel)