Skip to content
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

Force patchelf to use 64KB page size on aarch64/powerpc64le #33745

Merged
merged 2 commits into from
Nov 2, 2019

Conversation

staticfloat
Copy link
Sponsor Member

This fixes problems with binaries on these two platforms that often use
these large page sizes.

This probably needs some tweaking, we'll see what CI says. This isn't going to fix everything, we need to pass the same flags within BinaryBuilder, then rebuild the world so that Julia can work on AArch64.

@staticfloat staticfloat added building Build system, or building Julia or its dependencies system:arm ARMv7 and AArch64 ppc64le labels Nov 1, 2019
@staticfloat staticfloat requested a review from Keno November 1, 2019 20:05
@Keno
Copy link
Member

Keno commented Nov 1, 2019

Fixes #33293 (we think).

Copy link
Member

@Keno Keno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, modulo the syntax error CI complains about.

This fixes problems with binaries on these two platforms that often use
these large page sizes.
@Keno
Copy link
Member

Keno commented Nov 1, 2019

I'm happy to test on an aarch64 machine with big pages once we have a tarball with this fix.

@staticfloat
Copy link
Sponsor Member Author

To be clear; we still need to fix all the deps, but at least libgcc_s.so shouldn't be misaligned.

@Keno
Copy link
Member

Keno commented Nov 1, 2019

No dice:

[keno@wombat3 julia-5ceed9216e]$ ./bin/julia
./bin/julia: error while loading shared libraries: libgcc_s.so.1: ELF load command alignment not page-aligned
[keno@wombat3 julia-5ceed9216e]$ readelf -l ./lib/julia/libgcc_s.so.1

Elf file type is DYN (Shared object file)
Entry point 0x2880
There are 7 program headers, starting at offset 655360

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x00000000000122ac 0x00000000000122ac  R E    0x10000
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     0x10
  GNU_EH_FRAME   0x0000000000010f48 0x0000000000010f48 0x0000000000010f48
                 0x000000000000023c 0x000000000000023c  R      0x4
  LOAD           0x0000000000012db8 0x0000000000022db8 0x0000000000022db8
                 0x00000000000003c8 0x0000000000000688  RW     0x10000
  GNU_RELRO      0x0000000000012db8 0x0000000000022db8 0x0000000000022db8
                 0x0000000000000248 0x0000000000000248  R      0x1
  LOAD           0x00000000000a0000 0x0000000000024000 0x0000000000024000
                 0x0000000000000bb8 0x0000000000000bb8  RW     0x1000
  DYNAMIC        0x00000000000a0188 0x0000000000024188 0x0000000000024188
                 0x0000000000000200 0x0000000000000200  RW     0x8

 Section to Segment mapping:
  Segment Sections...
   00     .hash .dynsym .gnu.version .gnu.version_d .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame
   01
   02     .eh_frame_hdr
   03     .init_array .fini_array .got .got.plt .data .bss
   04     .init_array .fini_array .got
   05     .dynamic .dynstr
   06     .dynamic

@Keno
Copy link
Member

Keno commented Nov 2, 2019

That seems to have done it (for the gcc runtime libraries at least):

./bin/julia
WARNING: Error during initialization of module MPFR:
ErrorException("could not load library "libmpfr"
libmpfr.so: ELF load command alignment not page-aligned")
┌ Error: Error during initialization of module CHOLMOD
│   exception =
│    could not load library "libsuitesparse_wrapper"
│    libsuitesparse_wrapper.so: ELF load command alignment not page-aligned
│    Stacktrace:
│     [1] __init__() at /buildworker/worker/package_linuxaarch64/build/usr/share/julia/stdlib/v1.4/SuiteSparse/src/cholmod.jl:131
└ @ SuiteSparse.CHOLMOD /buildworker/worker/package_linuxaarch64/build/usr/share/julia/stdlib/v1.4/SuiteSparse/src/cholmod.jl:177
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.0-DEV.400 (2019-11-02)
 _/ |\__'_|_|_|\__'_|  |  refs/pull/33745/merge/ffb3ed0e74 (fork: 2 commits, 2 days)
|__/                   |

julia>

@staticfloat staticfloat marked this pull request as ready for review November 2, 2019 05:44
@staticfloat
Copy link
Sponsor Member Author

Fantastic. I'll merge this, then open PRs for pieces such as MPFR and GMP and whatnot piecemeal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies system:arm ARMv7 and AArch64 system:powerpc PowerPC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants