kiwix / kiwix-build

Kiwix & openZIM build engine
GNU General Public License v3.0
87 stars 42 forks source link

aarch64 bionic should not require GLIBCXX 3.4.26 and 3.4.29 #634

Closed rgaudin closed 1 year ago

rgaudin commented 1 year ago

See the downstream ticket https://github.com/openzim/python-libzim/issues/170

mgautierfr commented 1 year ago

I'm looking to recompile the toolchain from https://github.com/tttapa/docker-arm-cross-toolchain

The current version already have CT_GLIBC_V_2_27=y I haven't found a option for GLIBCXX.

Maybe we should open a issue upstream, it seems to me a bug that we need glibc3.4 as it is a deliberate choice to have glibc2.27 (see https://github.com/tttapa/docker-arm-cross-toolchain/issues/2#issuecomment-1436046637)

rgaudin commented 1 year ago

I've seen that comment and the release notes which mentions 2.27 as well. GLIBCXX comes with stdlib which comes with GCC. This toolchain properly uses glibc 2.27 but how those GLIBCXX symbols are brought in is beyond my understanding.

mgautierfr commented 1 year ago

A objdump -p libzim.so.8.2.1 on the aarch64_bionic release shows me:

Références de version:
 requis par libgcc_s.so.1:
    0x0b792650 0x00 25 GCC_3.0
 requis par librt.so.1:
    0x06969197 0x00 14 GLIBC_2.17
 requis par libpthread.so.0:
    0x06969197 0x00 12 GLIBC_2.17
 requis par libm.so.6:
    0x06969197 0x00 04 GLIBC_2.17
 requis par libc.so.6:
    0x06969197 0x00 03 GLIBC_2.17
 requis par libstdc++.so.6:
    0x0297f870 0x00 24 GLIBCXX_3.4.20
    0x0bafd178 0x00 23 CXXABI_1.3.8
    0x0297f868 0x00 22 GLIBCXX_3.4.18
    0x0bafd173 0x00 21 CXXABI_1.3.3
    0x0bafd179 0x00 20 CXXABI_1.3.9
    0x0afd17f1 0x00 19 CXXABI_1.3.11
    0x0297f879 0x00 18 GLIBCXX_3.4.29
    0x0297f876 0x00 17 GLIBCXX_3.4.26
    0x02297f89 0x00 16 GLIBCXX_3.4.9
    0x056bafd3 0x00 15 CXXABI_1.3
    0x0297f861 0x00 13 GLIBCXX_3.4.11
    0x0297f864 0x00 11 GLIBCXX_3.4.14
    0x0bafd175 0x00 10 CXXABI_1.3.5
    0x0297f872 0x00 09 GLIBCXX_3.4.22
    0x0297f871 0x00 08 GLIBCXX_3.4.21
    0x0afd17f3 0x00 07 CXXABI_1.3.13
    0x0297f865 0x00 06 GLIBCXX_3.4.15
    0x0297f869 0x00 05 GLIBCXX_3.4.19
    0x08922974 0x00 02 GLIBCXX_3.4

So we properly set GLIBC to 2.17 The problem is GLIBCXX

Can you share me your working libzim (rebuild with previous toolchain) ?

rgaudin commented 1 year ago

http://tmp.kiwix.org/ci/libzim_linux-aarch64-bionic-2023-08-01.tar.gz

mgautierfr commented 1 year ago

You working libzim shows:

libzim.so.8.2.1:     format de fichier elf64-little

En-tête de programme:
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**16
         filesz 0x000000000129c79d memsz 0x000000000129c79d flags r-x
    LOAD off    0x000000000129cff0 vaddr 0x00000000012acff0 paddr 0x00000000012acff0 align 2**16
         filesz 0x0000000000039026 memsz 0x000000000003bb58 flags rw-
 DYNAMIC off    0x00000000012bf4a8 vaddr 0x00000000012cf4a8 paddr 0x00000000012cf4a8 align 2**3
         filesz 0x0000000000000240 memsz 0x0000000000000240 flags rw-
     TLS off    0x000000000129cff0 vaddr 0x00000000012acff0 paddr 0x00000000012acff0 align 2**4
         filesz 0x0000000000000004 memsz 0x0000000000000048 flags r--
EH_FRAME off    0x00000000011ab370 vaddr 0x00000000011ab370 paddr 0x00000000011ab370 align 2**2
         filesz 0x00000000000213ec memsz 0x00000000000213ec flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
   RELRO off    0x000000000129cff0 vaddr 0x00000000012acff0 paddr 0x00000000012acff0 align 2**0
         filesz 0x0000000000024010 memsz 0x0000000000024010 flags r--

Section dynamique:
  NEEDED               libpthread.so.0
  NEEDED               librt.so.1
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  SONAME               libzim.so.8
  INIT                 0x0000000000249dd0
  FINI                 0x00000000006a4a98
  INIT_ARRAY           0x00000000012ad000
  INIT_ARRAYSZ         0x0000000000000128
  FINI_ARRAY           0x00000000012ad128
  FINI_ARRAYSZ         0x0000000000000008
  HASH                 0x00000000000001c8
  STRTAB               0x000000000008f078
  SYMTAB               0x0000000000022448
  STRSZ                0x00000000001200ed
  SYMENT               0x0000000000000018
  PLTGOT               0x00000000012d0fe8
  PLTRELSZ             0x000000000003e268
  PLTREL               0x0000000000000007
  JMPREL               0x000000000020bb68
  0x6ffffef6           0x00000000002734c0
  0x6ffffef7           0x00000000012d0fe0
  RELA                 0x00000000001b8420
  RELASZ               0x0000000000053748
  RELAENT              0x0000000000000018
  VERNEED              0x00000000001b8270
  VERNEEDNUM           0x0000000000000006
  VERSYM               0x00000000001af166
  RELACOUNT            0x0000000000001a93

Références de version:
 requis par libgcc_s.so.1:
    0x0b792650 0x00 22 GCC_3.0
    0x0b792654 0x00 18 GCC_3.4
 requis par librt.so.1:
    0x06969197 0x00 14 GLIBC_2.17
 requis par libpthread.so.0:
    0x06969197 0x00 12 GLIBC_2.17
 requis par libm.so.6:
    0x06969197 0x00 05 GLIBC_2.17
 requis par libc.so.6:
    0x06969197 0x00 03 GLIBC_2.17
 requis par libstdc++.so.6:
    0x0297f870 0x00 21 GLIBCXX_3.4.20
    0x0bafd178 0x00 20 CXXABI_1.3.8
    0x0297f868 0x00 19 GLIBCXX_3.4.18
    0x02297f89 0x00 17 GLIBCXX_3.4.9
    0x0bafd179 0x00 16 CXXABI_1.3.9
    0x056bafd3 0x00 15 CXXABI_1.3
    0x0297f861 0x00 13 GLIBCXX_3.4.11
    0x0297f864 0x00 11 GLIBCXX_3.4.14
    0x0bafd175 0x00 10 CXXABI_1.3.5
    0x0bafd173 0x00 09 CXXABI_1.3.3
    0x0297f872 0x00 08 GLIBCXX_3.4.22
    0x0297f865 0x00 07 GLIBCXX_3.4.15
    0x0297f869 0x00 06 GLIBCXX_3.4.19
    0x0297f871 0x00 04 GLIBCXX_3.4.21
    0x08922974 0x00 02 GLIBCXX_3.4

So we have mostly the same version of GLIBCXX. Do you have more information of how auditwheel checks symbols and what is expected ?

mgautierfr commented 1 year ago

From this line : https://github.com/pypa/auditwheel/blob/ebd4bc0de49394adcad557532eb19fe6598cd886/src/auditwheel/policy/manylinux-policy.json#L286

It seems we many linux 2_28 accept GLIBCXX up to 3.4.24 on aarch64.

Broken libzim has GLIBCXX 3.4.26 and 3.4.29

mgautierfr commented 1 year ago

Upstream issue opened at https://github.com/tttapa/docker-arm-cross-toolchain/issues/5

mgautierfr commented 1 year ago

Faulty symbols are:

_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev@GLIBCXX_3.4.26
_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev@GLIBCXX_3.4.26
_ZSt28__throw_bad_array_new_lengthv@GLIBCXX_3.4.29