Missing GLIBC_2.27 and GLIBC_2.29 on Amazon Linux 2 arm64

2,537 views
Skip to first unread message

Lee Nave

unread,
Jan 5, 2022, 2:21:02 PM1/5/22
to Chromium-dev
I am trying to build headless_shell for Amazon Linux 2 arm64.  I am able to build and run headless_shell for amd64 in an AL2 amd64 docker container.  When I try to cross-compile for arm64 in that same container (by adding target_cpu=["arm64"] to .gclient and target_cpu="arm64" to args.gn) I get a successful binary built but when I go to run that binary in an AL2 arm64 container:

./headless_shell: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by ./headless_shell)
./headless_shell: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by ./headless_shell)


Here is my args.gn:

import("//build/args/headless.gn")
is_debug = false
symbol_level = 0
blink_symbol_level = 0
is_component_build = false
enable_nacl = false
target_cpu = "arm64"


Any suggestions?  The arm64 build was completely fresh, i.e., there were no artifacts or configs hanging around from the amd64 build.

Nico Weber

unread,
Jan 5, 2022, 2:33:36 PM1/5/22
to nav...@gmail.com, Chromium-dev
The build builds against a debian sid sysroot by default: https://source.chromium.org/chromium/chromium/src/+/main:build/config/sysroot.gni;l=42?q=sysroot%20file:%5C.gn&ss=chromium (Downloaded by a hook to build/linux/debian_sid_arm64-sysroot/ by build/linux/sysroot_scripts/install-sysroot.py via build/linux/sysroot_scripts/sysroots.json). It sounds like that sysroot is not compatible with Amazon Linux 2. So you'll have to get your own compatible sysroot and build against that, probably (by setting the `sysroot` GN arg, see first link).

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/dfbe5312-face-4e8c-aa39-0d713456f0cdn%40chromium.org.

Lee Nave

unread,
Jan 5, 2022, 2:46:44 PM1/5/22
to Chromium-dev, Nico Weber, Chromium-dev, Lee Nave
Thanks!

Lee Nave

unread,
Jan 10, 2022, 6:11:03 PM1/10/22
to Chromium-dev, Lee Nave, Nico Weber, Chromium-dev
Any idea why the arm64 build is downloading three sysroots:

debian_sid_amd64-sysroot
debian_sid_arm64-sysroot
debian_sid_i386-sysroot


Lee

Nico Weber

unread,
Jan 10, 2022, 6:37:37 PM1/10/22
to Lee Nave, Chromium-dev
Here are the conditionals: https://source.chromium.org/chromium/chromium/src/+/main:DEPS;l=3876?q=file:%5Edeps&ss=chromium

These variables are apparently initialized here: https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:gclient.py;l=1279?q=gclient.py (I don't know why we download the 32-bit intel sysroot when targeting 64-bit linux. Possibly historical reasons.)

Are you building arm64 on an intel linux host? If so, it looks like this https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:gclient.py;l=1483?q=gclient.py sets _enforced_cpu to the union of target_cpu and detect_host_arch.HostArch() unless you set target_os_only in your .gclient (which makes sense, since the build needs to build host tools for intel but target binaries for arm64).

Lee Nave

unread,
Jan 11, 2022, 12:27:03 PM1/11/22
to Chromium-dev, Nico Weber, Chromium-dev, Lee Nave
I am building on AL2 x86_64 targeting AL2 arm64.  More clues . . . if I target x86 (i.e.., not cross-compiling) the resulting binary works great on the AL2 host.  And here is the result of ldd | sort:

        libdl.so.2 => /lib64/libdl.so.2 (0x000000400d12e000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x000000400d334000)
        libnss3.so => /lib64/libnss3.so (0x000000400d552000)
        libnssutil3.so => /lib64/libnssutil3.so (0x000000400d87f000)
        libnspr4.so => /lib64/libnspr4.so (0x000000400daae000)
        libexpat.so.1 => /lib64/libexpat.so.1 (0x000000400dcea000)
        libm.so.6 => /lib64/libm.so.6 (0x000000400df1a000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000400e25c000)
        libc.so.6 => /lib64/libc.so.6 (0x000000400e472000)
        /lib64/ld-linux-x86-64.so.2 (0x0000004000000000)
        libplc4.so => /lib64/libplc4.so (0x000000400e81d000)
        libplds4.so => /lib64/libplds4.so (0x000000400ea22000)
        librt.so.1 => /lib64/librt.so.1 (0x000000400ec26000)


whereas if I target arm64, copy it to an AL2 arm64 host and run ldd | sort:

        /lib/ld-linux-aarch64.so.1 (0x0000ffffb7272000)
        libc.so.6 => /lib64/libc.so.6 (0x0000ffffac744000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000ffffacc1b000)
        libexpat.so.1 => /lib64/libexpat.so.1 (0x0000ffffac9bc000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000ffffac8ca000)
        libm.so.6 => /lib64/libm.so.6 (0x0000ffffac8fb000)
        libnspr4.so => /lib64/libnspr4.so (0x0000ffffac9fd000)
        libnss3.so => /lib64/libnss3.so (0x0000ffffacaa2000)
        libnssutil3.so => /lib64/libnssutil3.so (0x0000ffffaca51000)
        libplc4.so => /lib64/libplc4.so (0x0000ffffac723000)
        libplds4.so => /lib64/libplds4.so (0x0000ffffac702000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000ffffacbe6000)
        librt.so.1 => /lib64/librt.so.1 (0x0000ffffac6e1000)
        linux-vdso.so.1 (0x0000ffffb72b0000)
./chromium: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by ./chromium)
./chromium: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by ./chromium)

Vamsi manohar reddy

unread,
Aug 8, 2022, 6:40:31 PM8/8/22
to Chromium-dev, nav...@gmail.com, Nico Weber, Chromium-dev
I am also stuck with same problem. Is there any solution for this?
Reply all
Reply to author
Forward
0 new messages