To build a 32-bit application on a powerpc64le system(target:power8), you need the 32-bit development libraries, such as glibc, which are not available as precompiled packages for powerpc64le. Therefore, you need to build the 32-bit glibc library from source. However, building the 32-bit glibc library depends on the 32-bit libgcc.a library. This creates a circular dependency issue.
how to solve this?
When building glibc using the command:
../configure --prefix=/usr/glibc-powerpc32 CC="gcc -m32 -mcpu=power8 -mtune=power8" --disable-werror --disable-multi-arch --host=powerpc-linux-gnu"
the final linking requires the 32-bit libgcc.a library. Therefore, i need to build the libgcc.a library from source code. However, when compiling GCC with the --enable-multilib configuration option, i encounter the error:
/usr/bin/ld: skipping incompatible //usr/lib64/libc.so when searching for -lc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory
This error is caused by the absence of the 32-bit glibc library, creating a circular dependency issue.
how to resolve this?