swampdog
Posts: 1007
Joined: Fri Dec 04, 2015 11:22 am

libicu 72_1

Sat Mar 18, 2023 8:31 pm

A weird one. I'm stumped. My QT build broke on 32bit using 71.1 and is doing the same with 72.1. I can't even remember why I had to add icu source to the build in the first place. It's even possible this is the first time I have ever attempted the 32bit build with icu. It's been nothing but trouble: 71.1 won't even build out of tree (72.1 will fortunately) and it likes to conflict with the system libicu. I'm hoping the cause/fix/patch for this is known for 32bit raspian builds.

The problem manifests as..

Code: Select all

foo@pi18:~/usr/src/QT $ sd-qt ldd obj-qt-6.4/qtbase/libexec/qvkgen
	linux-vdso.so.1 (0xbef6b000)
	/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6f51000)
	libQt6Core.so.6 => /home/foo/usr/src/QT/obj-qt-6.4/qtbase/lib/libQt6Core.so.6 (0xb69c2000)
	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6978000)
	libstdc++.so.6 => /usr/local/QT/6400r/lib/libstdc++.so.6 (0xb67a8000)
	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6726000)
	libgcc_s.so.1 => /usr/local/QT/6400r/lib/libgcc_s.so.1 (0xb66f7000)
	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb65aa000)
	libicui18n.so.71 => /usr/local/QT/6400r/lib/libicui18n.so.71 (0xb62ef000)
	libicuuc.so.71 => /usr/local/QT/6400r/lib/libicuuc.so.71 (0xb6124000)
	libicudata.so.71 => not found
	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6111000)
	libglib-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb6001000)
	libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0xb5fef000)
	librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb5fd8000)
	/lib/ld-linux-armhf.so.3 (0xb6f66000)
	libicudata.so.71 => not found
	libicudata.so.71 => not found
	libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb5f61000)
libicudata.so.71.1 is there and its symlinks. LD_DEBUG=files,libs reveals it does look in /usr/local/QT/6400r/lib but skips it silently. The above uses clang and a load of other stuff. However, the same can be achieved with system gcc compiler: wget https://github.com/unicode-org/icu/rele ... _1-src.tgz. No need to install, just configure and make.

Only libicudata.so is "soft float" which I'm assuming is the reason for the "not found" above.

Code: Select all

foo@pi18:~/usr/src/icu/obj $ objdump -p lib/libicudata.so

lib/libicudata.so:     file format elf32-littlearm

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**16
         filesz 0x01dcdf80 memsz 0x01dcdf80 flags r--
    LOAD off    0x01dcdf90 vaddr 0x01dddf90 paddr 0x01dddf90 align 2**16
         filesz 0x0000007c memsz 0x0000007c flags rw-
 DYNAMIC off    0x01dcdf90 vaddr 0x01dddf90 paddr 0x01dddf90 align 2**2
         filesz 0x00000070 memsz 0x00000070 flags rw-
    NOTE off    0x000000f4 vaddr 0x000000f4 paddr 0x000000f4 align 2**2
         filesz 0x00000024 memsz 0x00000024 flags r--
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4
         filesz 0x00000000 memsz 0x00000000 flags rw-
   RELRO off    0x01dcdf90 vaddr 0x01dddf90 paddr 0x01dddf90 align 2**0
         filesz 0x00000070 memsz 0x00000070 flags r--

Dynamic Section:
  SONAME               libicudata.so.72
  SYMBOLIC             0x00000000
  GNU_HASH             0x00000118
  STRTAB               0x00000158
  SYMTAB               0x00000138
  STRSZ                0x0000001e
  SYMENT               0x00000010
  FLAGS                0x00000002
private flags = 5000200: [Version5 EABI] [soft-float ABI]
The rest are as expected..

Code: Select all

foo@pi18:~/usr/src/icu/obj $ objdump -p lib/libicutu.so

lib/libicutu.so:     file format elf32-littlearm

Program Header:
0x70000001 off    0x00027700 vaddr 0x00027700 paddr 0x00027700 align 2**2
         filesz 0x00000768 memsz 0x00000768 flags r--
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**16
         filesz 0x00027e6c memsz 0x00027e6c flags r-x
    LOAD off    0x000287dc vaddr 0x000387dc paddr 0x000387dc align 2**16
         filesz 0x00000f38 memsz 0x00032ca0 flags rw-
 DYNAMIC off    0x00028ec8 vaddr 0x00038ec8 paddr 0x00038ec8 align 2**2
         filesz 0x00000138 memsz 0x00000138 flags rw-
    NOTE off    0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**2
         filesz 0x00000024 memsz 0x00000024 flags r--
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4
         filesz 0x00000000 memsz 0x00000000 flags rw-
   RELRO off    0x000287dc vaddr 0x000387dc paddr 0x000387dc align 2**0
         filesz 0x00000824 memsz 0x00000824 flags r--

Dynamic Section:
  NEEDED               libicui18n.so.72
  NEEDED               libicuuc.so.72
  NEEDED               libicudata.so.72
  NEEDED               libpthread.so.0
  NEEDED               libdl.so.2
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  SONAME               libicutu.so.72
  SYMBOLIC             0x00000000
  INIT                 0x00008f6c
  FINI                 0x00020f54
  INIT_ARRAY           0x000387dc
  INIT_ARRAYSZ         0x00000008
  FINI_ARRAY           0x000387e4
  FINI_ARRAYSZ         0x00000004
  GNU_HASH             0x00000138
  STRTAB               0x00003034
  SYMTAB               0x00000b44
  STRSZ                0x000049ca
  SYMENT               0x00000010
  PLTGOT               0x00039000
  PLTRELSZ             0x00000750
  PLTREL               0x00000011
  JMPREL               0x0000881c
  REL                  0x00007f7c
  RELSZ                0x000008a0
  RELENT               0x00000008
  FLAGS                0x00000002
  VERNEED              0x00007e9c
  VERNEEDNUM           0x00000004
  VERSYM               0x000079fe
  RELCOUNT             0x000000e1

Version References:
  required from libpthread.so.0:
    0x0d696914 0x00 11 GLIBC_2.4
  required from libgcc_s.so.1:
    0x0b792655 0x00 10 GCC_3.5
  required from libstdc++.so.6:
    0x0bafd178 0x00 09 CXXABI_1.3.8
    0x02297f89 0x00 08 GLIBCXX_3.4.9
    0x0297f861 0x00 07 GLIBCXX_3.4.11
    0x056bafd3 0x00 06 CXXABI_1.3
    0x0297f871 0x00 05 GLIBCXX_3.4.21
    0x0849afa3 0x00 04 CXXABI_ARM_1.3.3
    0x08922974 0x00 03 GLIBCXX_3.4
  required from libc.so.6:
    0x0d696914 0x00 02 GLIBC_2.4
private flags = 5000400: [Version5 EABI] [hard-float ABI]
Both the 32bit and 64bit builds have the same compilation line..

Code: Select all

clang -O3  -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings  -Qunused-arguments -Wno-parentheses-equality  -nodefaultlibs -nostdlib -shared -Wl,-Bsymbolic -Wl,-soname -Wl,libicudata.so.71 -o libicudata.so.71.1 stubdata.o 
rm -f libicudata.so.71 && ln -s libicudata.so.71.1 libicudata.so.71
rm -f libicudata.so && ln -s libicudata.so.71.1 libicudata.so
..ditto sameness with gcc system compiler.

I would be grateful for any hints.

swampdog
Posts: 1007
Joined: Fri Dec 04, 2015 11:22 am

Re: libicu 72_1

Mon Mar 20, 2023 11:42 am

Seems the cause is one or both of "-nodefaultlibs -nostdlib".

swampdog
Posts: 1007
Joined: Fri Dec 04, 2015 11:22 am

Re: libicu 72_1

Mon Mar 20, 2023 6:23 pm

Once I eventually found "LDFLAGSICUDT" and googled on that, an old post suggested commenting it out. This appears to have worked. I won't be sure until I've rebuilt everything from scratch which is going to take a while!

Code: Select all

$ cat icu-72.1.patch.000 
--- icu-72.1/source/config/mh-linux.ORIGINAL	2022-10-19 01:53:21.000000000 +0100
+++ icu-72.1/source/config/mh-linux	2023-03-19 16:28:59.285593135 +0000
@@ -23,7 +23,7 @@
 LD_RPATH_PRE = -Wl,-rpath,
 
 ## These are the library specific LDFLAGS
-LDFLAGSICUDT=-nodefaultlibs -nostdlib
+#LDFLAGSICUDT=-nodefaultlibs -nostdlib
 
 ## Compiler switch to embed a library name
 # The initial tab in the next line is to prevent icu-config from reading it.

Return to “C/C++”