Ubuntu 18.04 on ARM64: undefined reference to `exp@GLIBC_2.29'

1,588 views
Skip to first unread message

Benoit Blanchon

unread,
Jul 6, 2022, 1:47:51 PM7/6/22
to Chromium-dev
Hi,

I originally sent this question to the PDFium mailing list and was told to post it here.

I successfully compiled a shared library of PDFium on Ubuntu 20.04 with "target_cpu" set to either "x86", "x64", "arm", or "arm64"

However, if I try to do the same with Ubuntu 18.04, all targets build, except "arm64".
The link step fails with the following errors:
libpdfium.so: undefined reference to `exp@GLIBC_2.29'
libpdfium.so: undefined reference to `log@GLIBC_2.29'
libpdfium.so: undefined reference to `pow@GLIBC_2.29'

I investigated the problem and reported my conclusions here:
In short, "reversion_glibc.py", the script that changes the required glibc version in the sysroot, is skipped for arm64. The comment says "Glibc is compiled in a way where many libm math functions do not have compatibility symbols for versions <= 2.17."

This comment suggests that we can't target Ubuntu 18.04 on ARM64, but I'd like to know if there is a workaround.
Please let me know if you have any information that could help.

Best regards,
Benoit Blanchon



geisserml

unread,
Jan 3, 2023, 10:26:46 AM1/3/23
to Chromium-dev, benoit....@gmail.com
@Chromium Developers: Any feedback on this?
A project of mine that uses pdfium-binaries recently got an issue report because the minimum required glibc version is too high on ARM64 (see https://github.com/pypdfium2-team/pypdfium2/issues/165).

Lei Zhang

unread,
Jan 3, 2023, 3:08:36 PM1/3/23
to geis...@gmail.com, Chromium-dev, benoit....@gmail.com
This issue recently got resolved in https://crrev.com/1084974, and
PDFium will pick up that change in the very near future.
> --
> --
> 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/3873a536-2f15-4995-9092-c2d1d29b9c27n%40chromium.org.

Egor Pasko

unread,
Jan 4, 2023, 12:31:38 PM1/4/23
to geis...@gmail.com, Chromium-dev, benoit....@gmail.com
On Tue, Jan 3, 2023 at 4:26 PM geisserml <geis...@gmail.com> wrote:
@Chromium Developers: Any feedback on this?
A project of mine that uses pdfium-binaries recently got an issue report because the minimum required glibc version is too high on ARM64 (see https://github.com/pypdfium2-team/pypdfium2/issues/165).

 I guess as a workaround you can try building PDFium on an ARM64 machine running Ubuntu 18.04. Perhaps this would require some tweaks to sysroot setup, just to take system libraries without modification.

On Wednesday, July 6, 2022 at 7:47:51 PM UTC+2 benoit....@gmail.com wrote:
Hi,

I originally sent this question to the PDFium mailing list and was told to post it here.

I successfully compiled a shared library of PDFium on Ubuntu 20.04 with "target_cpu" set to either "x86", "x64", "arm", or "arm64"

However, if I try to do the same with Ubuntu 18.04, all targets build, except "arm64".
The link step fails with the following errors:
libpdfium.so: undefined reference to `exp@GLIBC_2.29'
libpdfium.so: undefined reference to `log@GLIBC_2.29'
libpdfium.so: undefined reference to `pow@GLIBC_2.29'

I investigated the problem and reported my conclusions here:
In short, "reversion_glibc.py", the script that changes the required glibc version in the sysroot, is skipped for arm64. The comment says "Glibc is compiled in a way where many libm math functions do not have compatibility symbols for versions <= 2.17."

This comment suggests that we can't target Ubuntu 18.04 on ARM64, but I'd like to know if there is a workaround.
Please let me know if you have any information that could help.

Best regards,
Benoit Blanchon



geisserml

unread,
Jan 4, 2023, 12:31:38 PM1/4/23
to Chromium-dev, Lei Zhang, Chromium-dev, benoit....@gmail.com, geisserml
That's great news, thanks!

Lei Zhang

unread,
Jan 4, 2023, 3:17:57 PM1/4/23
to geisserml, Chromium-dev, benoit....@gmail.com
Yes. It shouldn't be a problem for Ubuntu 18.04, which ships with glibc 2.27.

On Wed, Jan 4, 2023 at 11:51 AM geisserml <geis...@gmail.com> wrote:
>
> The description of https://crrev.com/1084974 says "the glibc version requirement has been bumped to 2.26" - does this apply to PDFium as well?

geisserml

unread,
Jan 6, 2023, 9:02:07 AM1/6/23
to Chromium-dev, geisserml, Lei Zhang, Chromium-dev, benoit....@gmail.com
The description of https://crrev.com/1084974 says "the glibc version requirement has been bumped to 2.26" - does this apply to PDFium as well?
On Wednesday, January 4, 2023 at 6:31:38 PM UTC+1 geisserml wrote:

geisserml

unread,
Jan 7, 2023, 11:55:00 AM1/7/23
to Chromium-dev, geisserml, Lei Zhang, Chromium-dev, benoit....@gmail.com
(note for readers: the previous two messages are in wrong order for some reason)

geisserml

unread,
Apr 10, 2023, 2:41:17 PM4/10/23
to Chromium-dev, geisserml, Lei Zhang, Chromium-dev, benoit....@gmail.com
Confusingly enough, the latest pdfium-binaries build (5692) still runs on my Debian 9 armhf device with glibc 2.24 .
How is that possible if pdfium is supposed to require glibc >= 2.26 ?

Lei Zhang

unread,
Apr 21, 2023, 7:13:55 PM4/21/23
to geisserml, Chromium-dev, benoit....@gmail.com
Since Chromium/PDFium folks are not the ones building the
pdfium-binaries you are referring to, we don't have an exact answer.

When crrev.com/1084974 bumped up the glibc requirement, it means
binaries built with that sysroot can potentially require glibc 2.26.
To be safe, that is the listed requirement. The actual requirement for
any given binary can be lower. e.g. Running `objdump -p
path/to/pdfium_test` in my local developer build shows only GLIBC_2.25
in the Version References section. But there's no guarantee and it can
be bumped up to 2.26 at any time.

geisserml

unread,
Apr 24, 2023, 1:29:29 PM4/24/23
to Chromium-dev, Lei Zhang, Chromium-dev, benoit....@gmail.com, geisserml
Thank you! Since pdfium-binaries use the official build tooling, I think it will be that sysroot.
Reply all
Reply to author
Forward
0 new messages