-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about the build / package of libpdfium.so for new arch [ppc64le] #187
Comments
Based on this issue #82 I saw in my I was more or less following the chromium notes here Again, any help is appreciated :) |
Hi @mgiessing, Congratulations on building PDFium no ppc64le 🎉 Does it need the host to be ppc64le, or can it be cross-built? I wish I could help you, but as you saw in #82, I'm clueless about the GLIB version issues. Best regards, |
Thank you! It can be cross-compiled on an x86_64 system - I have a AlmaLinux8.9 and tried it manually using: dnf install -y git podman
mkdir -p $HOME/git && cd $HOME/git
git clone -b ppc64le https://github.com/mgiessing/pdfium-binaries
# pdfium-binaries use ubuntu:24.04 in their GH Actions
podman run -ti -v $HOME/git:/root/git --cap-add=AUDIT_WRITE ubuntu:24.04
apt update && apt install sudo lsb-release file git python3 python3-pip wget curl -y
cd /root/git/pdfium-binaries/
PDFium_BRANCH="chromium/6954" bash build.sh linux ppc64le However there are two "dirty" things that should probably be changed to the upstream pdfium/build/third_party project:
+ },
+ "bullseye_ppc64el": {
+ "Sha256Sum": "d2e359f5460d2a70fb938c91139b8022fe4d85475567baaa7864eb39073f4c5a",
+ "SysrootDir": "debian_bullseye_ppc64el-sysroot",
+ "Tarball": "debian_bullseye_ppc64el_sysroot.tar.xz",
+ "URL": "https://ibm.box.com/shared/static/n9n2zcuybktrgbtph6q6bsif02pkpfak.xz"
#Get libclang-rt for powerpc64le
pushd "${SOURCE}/third_party/llvm-build/Release+Asserts/lib/clang/20/lib/"
wget https://ibm.box.com/shared/static/7ez5z7vu75c0u2dno5t3anszwd2wrgdv.gz -O clang-rt-20-ppc.tar.gz
mkdir -p powerpc64le-unknown-linux-gnu
tar -xf clang-rt-20-ppc.tar.gz
rm -rf clang-rt-20-ppc.tar.gz
popd Once all of this matured better I'm happy to provide a clean PR :) |
I've successfully built
libpdfium.so
for ppc64le architecture, but when I tried to package it into a pypdfium2 manylinux wheel (2014/glibc2.17+ & 2_28/glibc2.28+) I figured out there must be an issue somewhere as I got:I then inspected the libpdfium for aarch64, x86_64 & ppc64le and saw that for the first two the highest glibc was indeed 2.17, but for ppc64le I had up to 2.29:
aarch64:
$ objdump -x lib/libpdfium.so | grep GLIBC 0x06969197 0x00 05 GLIBC_2.17 0x06969197 0x00 04 GLIBC_2.17 0x06969197 0x00 02 GLIBC_2.17 0x06969197 0x00 03 GLIBC_2.17
x86_64:
$ objdump -x lib/libpdfium.so | grep GLIBC 0x09691a75 0x00 08 GLIBC_2.2.5 0x09691972 0x00 11 GLIBC_2.3.2 0x09691a75 0x00 06 GLIBC_2.2.5 0x09691a75 0x00 02 GLIBC_2.2.5 0x0d696913 0x00 03 GLIBC_2.3 0x09691973 0x00 14 GLIBC_2.3.3 0x09691974 0x00 05 GLIBC_2.3.4 0x0d696914 0x00 04 GLIBC_2.4 0x0d696917 0x00 12 GLIBC_2.7 0x06969191 0x00 09 GLIBC_2.11 0x06969194 0x00 07 GLIBC_2.14 0x06969196 0x00 15 GLIBC_2.16 0x0d696913 0x00 10 GLIBC_2.3
ppc64le:
$ objdump -x lib/libpdfium.so | grep GLIBC 0x06969197 0x00 04 GLIBC_2.17 0x06969197 0x00 03 GLIBC_2.17 0x06969187 0x00 05 GLIBC_2.27 0x06969189 0x00 06 GLIBC_2.29 0x06969197 0x00 02 GLIBC_2.17 0x06969197 0x00 07 GLIBC_2.17
I did 3 main changes to make it work:
debian_bullseye_linux_ppc64el
with the sysroot_creator.py scriptlibclang_rt.builtins.a
for powerpc64le using the clang build.py scriptI believe the first two should be fine as I did it in the same git checkout but I'm wondering if I have somewhere forget a spot in the build toolchain to restrict the lib to e.g. 2.17?
Btw. I tried to keep it as simple as possible, here is the patch I apply after checking out:
https://github.com/mgiessing/pdfium-binaries/blob/ppc64le/patches/build_config_ppc64le.patch
Any help is appreciated :)
The text was updated successfully, but these errors were encountered: