0

I need to run a dotnet5 app (or build dotnet5 from source) to be compatible with arm machines with very old glibc (as low as glibc-2.13, cannot be upgraded because these are semi-embedded systems).

The target machines come with libstdc++ based on gcc <5.1 and therefore don't support the necessary C++11 ABI.

First solution was to "just" get an arm-binary libstdc++.so.6.0.21 from somewhere and trying to run the app with it (via LD_LIBRARY_PATH). This almost worked, but this libstdc++ depended on glibc-2.16.

Next solution: build gcc >=5.1 (including libstdc++) from source in my debian-wheezy-armhf container, which is based on glibc-2.13. This works quite well, though I have to force a few things because the gcc build process at some stages seems to believe it's cross-building (but not really?), getting errors like this: cannot find bits/predefs.h and hard- vs. soft-float errors. These were solved by doing the build like this (Makefile rule executed in build container):

    C_INCLUDE_PATH=/usr/include:/usr/include/$$(gcc -print-multiarch); \
    CPATH=/usr/include:/usr/include/$$(gcc -print-multiarch); \
    LIBRARY_PATH=/usr/lib:/usr/lib/$$(gcc -print-multiarch); \
    CFLAGS="-mfloat-abi=hard"; \
    CXXFLAGS="-mfloat-abi=hard"; \
    LDFLAGS="-mfloat-abi=hard"; \
    export LIBRARY_PATH C_INCLUDE_PATH CPATH CFLAGS CXXFLAGS LDFLAGS; \
    ../gcc-5.5.0/configure --enable-languages=c,c++ --enable-shared=libgcc,libstdc++ `#--build=$$(gcc -print-multiarch)` --disable-multilib --disable-bootstrap --prefix=/build/install \
    && make -j24 && make install

... but the resulting libstdc++ doesn't contain version symbols:

> objdump -p .build/arm-glibc2.13/install/lib/libstdc++.so.6.0.21 | grep GLIBCXX
# nothing

/build/gcc-5.5.0-build/armv7l-unknown-linux-gnueabihf/libstdc++-v3/config.log shows:

configure:78121: WARNING: === You have requested GNU symbol versioning, but
configure:78123: WARNING: === you are not building a shared libgcc_s.
configure:78125: WARNING: === Symbol versioning will be disabled.

so that appears to be the reason. But why am I not building a shared libgcc_s? Even with --enable-shared=libgcc,libstdc++ (which is supposed to be the default anyway) it doesn't work...

Any ideas?

ppenguin
  • 103
  • 1
  • 8

0 Answers0