Re: libstdc++.so did not link cause of libm.a was not compiled with fpic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 13 Jun 2024 at 13:11, Klaus Rudolph via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
>
> I try to cross compile gcc 14.1.0 for an older arm linux.
>
> During compilation it fails with a long list of linking problems for
> libstdc++.so
>
> I configured gcc with:
> ../configure --prefix=/opt/armv7_$(GCC_VERSION) --enable-languages=c,c++
> --with-sysroot=/opt/podman_debian8/merged --enable-multiarch
> --with-fpu=vfpv3-d16 --with-mode=thumb --with-arch=armv7-a
> --target=arm-linux-gnueabihf --disable-multilib --with-stdc++lib=static
>
> Is it possible to add/remove some flags for ./configure to get the new
> compiler to work even with the libm.a library from the target system
> which was not compiled with fPic.

I don't think so, no.

If you don't have a dynamic library for libm, I don't think you'll be
able to have a dynamic library for libstdc++ either.

You could possibly modify the libstdc++ sources and/or build system to
include dummy stub definitions of the libm functions in libstdc++.so,
and not export them. But things might break if anything in
libstdc++.so tried to actually use those stubs.

You might also be able to change the build system so that libstdc++.so
can be linked without those definitions, which would require the user
program to link to libm later. I'm not sure how to do that.

There are no configure flags to make this easy.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux