Estou tentando executar um openjdk-8 em um sistema incorporado linux-uclibc
ARM.
O sistema alvo usa um kernel-4.5.7 / uclib-ng-1.0.16, mas eu tive que construir o JDK usando uma toolchain (openembedded) construída sobre uma versão ligeiramente diferente (kernel-4.4.26 / uclibc-ng-1.0 .12)
O jdk e suas dependências ausentes ( libiconv
e libgcc_s
) foram manualmente instalados em sua localização esperada (para evitar problemas de link dinâmico):
$ ls -al /lib/libgcc_s.so* /usr/lib/libiconv.so*
lrwxrwxrwx 1 root root 13 Jan 8 18:51 /lib/libgcc_s.so -> libgcc_s.so.1*
lrwxrwxrwx 1 root root 13 Jan 8 19:17 /lib/libgcc_s.so.0 -> libgcc_s.so.1*
-rwxrwxrwx 1 root root 115524 Jan 8 03:27 /lib/libgcc_s.so.1*
lrwxrwxrwx 1 root root 17 Jan 8 02:55 /usr/lib/libiconv.so -> libiconv.so.2.5.1*
lrwxrwxrwx 1 root root 17 Jan 8 02:54 /usr/lib/libiconv.so.2 -> libiconv.so.2.5.1*
-rwxr-xr-x 1 root root 909608 Jan 8 03:15 /usr/lib/libiconv.so.2.5.1*
Agora as dependências parecem a serem resolvidas, por exemplo:
$ ldd /usr/lib/jvm/openjdk-8/bin/java
libjli.so => /usr/lib/jvm/openjdk-8/bin/../lib/arm/jli/libjli.so (0xb6fb1000)
libc.so.1 => /lib/libc.so.1 (0xb6f47000)
libdl.so.1 => /lib/libdl.so.1 (0xb6f33000)
libpthread.so.1 => /lib/libpthread.so.1 (0xb6f0d000)
ld-uClibc.so.1 => /lib/ld-uClibc.so.0 (0xb6fd7000)
$ ldd /usr/lib/jvm/openjdk-8/jre/lib/arm/server/libjvm.so
checking sub-depends for '/usr/lib/libiconv.so.2'
checking sub-depends for '/lib/libm.so.1'
libc.so.0 => /lib/libc.so.0 (0xb6f28000)
ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f92000)
checking sub-depends for '/lib/libdl.so.1'
libc.so.0 => /lib/libc.so.0 (0xb6f4b000)
ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6fb5000)
checking sub-depends for '/lib/libpthread.so.1'
ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6fda000)
libdl.so.0 => /lib/libdl.so.0 (0xb6fc6000)
libc.so.0 => /lib/libc.so.0 (0xb6f5c000)
checking sub-depends for '/usr/lib/libffi.so.6'
checking sub-depends for '/lib/libc.so.1'
ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f2e000)
checking sub-depends for '/lib/libgcc_s.so.1'
checking sub-depends for '/lib/libc.so.0'
ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f37000)
libiconv.so.2 => /usr/lib/libiconv.so.2 (0x00000000)
libm.so.1 => /lib/libm.so.1 (0x00000000)
libdl.so.1 => /lib/libdl.so.1 (0x00000000)
libpthread.so.1 => /lib/libpthread.so.1 (0x00000000)
libffi.so.6 => /usr/lib/libffi.so.6 (0x00000000)
libc.so.1 => /lib/libc.so.1 (0x00000000)
/lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00000000)
libc.so.0 => /lib/libc.so.0 (0x00000000)
/lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
Mas a inicialização do jvm ainda falha com símbolos não resolvidos:
$ /usr/lib/jvm/openjdk-8/bin/java
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_unwind_cpp_pr0': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__divdi3': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '_Unwind_GetRegionStart': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_d2lz': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_cdcmple': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_f2lz': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_cdrcmple': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '_Unwind_VRS_Set': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_uldivmod': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__udivmoddi4': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '_Unwind_VRS_Pop': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_d2ulz': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_f2ulz': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_ul2d': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_idiv': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_l2f': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_uidiv': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_l2d': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_ul2f': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_cfcmple': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '_Unwind_GetTextRelBase': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_cfrcmple': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '_Unwind_GetLanguageSpecificData': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '_Unwind_VRS_Get': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__gnu_unwind_frame': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '_Unwind_GetDataRelBase': can't resolve symbol
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_ldivmod': can't resolve symbol
Error: dl failure on line 893
Error: failed /usr/lib/jvm/openjdk-8/jre/lib/arm/server/libjvm.so, because (null)
Esses símbolos são definidos em /lib/libgcc_s.so
. O que ainda poderia impedir o carregador do Linux de resolvê-los?
Atualizar :
Preloading libgcc_s.so dá:
$ LD_PRELOAD=/lib/libgcc_s.so /usr/lib/jvm/openjdk-8/bin/java
/usr/lib/jvm/openjdk-8/bin/java: symbol '__aeabi_unwind_cpp_pr0': can't resolve symbol
Detalhes : - a opção LD_DEBUG não está disponível no sistema - o sistema libc libs está localizado aqui:
$ ls -al /lib/libc.so*
lrwxrwxrwx 1 root root 19 Jan 1 00:02 /lib/libc.so.0 -> libuClibc-1.0.16.so*
lrwxrwxrwx 1 root root 19 Jan 1 00:02 /lib/libc.so.1 -> libuClibc-1.0.16.so*
lrwxrwxrwx 1 root root 19 Jan 2 01:10 /lib/libc.so.6 -> libuClibc-1.0.16.so*
Tags dynamic-linking ld linux embedded