I can't get dynamic shared object loading for C++ sources. Apparently, the linker is not even capable of creating shared libraries for C++ while it's reported being capable of producing shared libraries for C.

I'm using uclibc-0.9.28.2 through OpenWRT's toolchain. I compile the toolchain myself and use the resulting SDK to compile my own sources for the intended MIPS32 architecture. The toolchain is running on x86 architecture and cross compiles to MIPS32.

The build of the toolchain produced libstdc++ (6.0.3) which is reported to be an ELF 32bit LSB shared object, MIPS, version 1 (SYSV).

'configure' (on my own sources) reports (below) shared libraries are possible when using ...gcc as the linker, but not when using ...g++ as the linker, although the same linker is apparently used in both instances.

I don't know what's preventing the use of shared libraries for C++. I checked the uClibc sources involved in building the toolchain. One of the possible (far-fetched?) causes is that the tree of ldso includes mips but not mipsel causing some kind of problems as the toolchain is little endian, although I'd expect 'mips' to be followed in this case? And this can't be right as this would hinder C shared libraries as well. I'm also wondering to what extent the kernel (linux 2.4.34) options are related to this. The kernel build uses the following (possibly related) options:

CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_ELF_AOUT is not set
# CONFIG_MIPS32_COMPAT is not set
# CONFIG_MIPS32_O32 is not set
# CONFIG_MIPS32_N32 is not set
# CONFIG_BINFMT_ELF32 is not set
# CONFIG_BINFMT_MISC is not set

I don't immediately know if the lack of MIPS32 options is causing this problem. But the CONFIG_BINFMT_ELF_AOUT annotation states that:

'The kernel may support ELF executables which use an a.out format interpreter (dynamic linker) and/or a.out shared libraries, in addition to the usual ELF-ELF setups. You shouldn't need this.'.

I'm wondering if I do need this, i.e. is there an a.out format interpreter involved with uclibc's dynamic linker? But if this is the cause, I'd expect the C shared libraries to be hindered in this way as well.

So (from configure output below) I (we) can produce position independant code, shared libraries for C, but not shared libraries for C++ code although the toolchain produces libstdc++ as a shared library (inferring in this case that libstdc++ is written in C?).

A pointer (shove) in the right direction is most appreciated.

Thanks,

Miyagi

From running configure with --host=mips32 --enable-shared (with or without
--with-gnu-ld) for my own sources I get the following output in config.log:

configure:6667: checking if /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86_32/staging_d
ir_mipsel/bin/mipsel-linux-uclibc-gcc PIC flag -fPIC works
configure:6685: /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86_32/staging_dir_mipsel/bi n/mipsel-linux-uclibc-gcc -c -Os -w -DMIPS32=1 -fexceptions -fPIC -DPIC conftes
t.c >&5
configure:6689: $? = 0
configure:6702: result: yes
configure:6730: checking if /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86_32/staging_d
ir_mipsel/bin/mipsel-linux-uclibc-gcc static flag -static works
configure:6758: result: yes
configure:6768: checking if /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86_32/staging_d
ir_mipsel/bin/mipsel-linux-uclibc-gcc supports -c -o file.o
configure:6789: /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86_32/staging_dir_mipsel/bi n/mipsel-linux-uclibc-gcc -c -Os -w -DMIPS32=1 -fexceptions -o out/conftest2.o
conftest.c >&5
configure:6793: $? = 0
configure:6815: result: yes
configure:6841: checking whether the /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86_32/ staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc linker (/tmp/OpenWrt-SDK-brcm-2.4 -for-Linux-x86_32/staging_dir_mipsel/mipsel-linux-uclibc/bin/ld) supports shared
libraries
configure:7799: result: yes

...

configure:7866: checking dynamic linker characteristics
configure:8475: result: no
configure:8484: checking how to hardcode library paths into programs
configure:8509: result: immediate
configure:8523: checking whether stripping libraries is possible
configure:8528: result: yes
configure:9362: checking if libtool supports shared libraries
configure:9364: result: no
configure:9367: checking whether to build shared libraries
configure:9388: result: no
configure:9391: checking whether to build static libraries
configure:9395: result: yes

...

configure:10078: checking for ld used by /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86
_32/staging_dir_mipsel/bin/mipsel-linux-uclibc-g++
configure:10145: result: /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86_32/staging_dir_
mipsel/mipsel-linux-uclibc/bin/ld
configure:10154: checking if the linker (/tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86
_32/staging_dir_mipsel/mipsel-linux-uclibc/bin/ld) is GNU ld
configure:10169: result: yes
configure:10220: checking whether the /tmp/OpenWrt-SDK-brcm-2.4-for-Linux-x86_32 /staging_dir_mipsel/bin/mipsel-linux-uclibc-g++ linker (/tmp/OpenWrt-SDK-brcm-2. 4-for-Linux-x86_32/staging_dir_mipsel/mipsel-linux-uclibc/bin/ld) supports share
d libraries
configure:11158: result: no

_________________________________________________________________
Make every IM count. Download Messenger and join the i’m Initiative now. It’s free. http://im.live.com/messenger/im/home/?source=TAGHM_MAY07

_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to