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

"ELF load command alignment not page-aligned" issue on ppc64le #33293

Closed
nasica88 opened this issue Sep 17, 2019 · 7 comments
Closed

"ELF load command alignment not page-aligned" issue on ppc64le #33293

nasica88 opened this issue Sep 17, 2019 · 7 comments
Labels
building Build system, or building Julia or its dependencies system:arm ARMv7 and AArch64 system:powerpc PowerPC

Comments

@nasica88
Copy link

I am trying to build julia on Ubuntu 18.04 LTS, ppc64le (IBM POWER8), and came across the following error of "ELF load command alignment not page-aligned".

Any comment ?

root@5b95ee340ef3:/tmp/julia# git checkout tags/v1.2.0

root@5b95ee340ef3:/tmp/julia# nohup make -j8 &
...
Serialization ── 1.911660 seconds
Libdl ────────── 0.074467 seconds
Markdown ─────── 1.986755 seconds
error during bootstrap:
LoadError("sysimg.jl", 16, LoadError("/tmp/julia/usr/share/julia/stdlib/v1.2/LibGit2/src/LibGit2.jl", 21, LoadError("/tmp/julia/usr/share/julia/stdlib/v1.2/LibGit2/src/utils.jl", 44, ErrorException("error compiling version: could not load library "libgit2"\nlibcurl.so.4: ELF load command alignment not page-aligned"))))
rec_backtrace at /tmp/julia/src/stackwalk.c:94
record_backtrace at /tmp/julia/src/task.c:219 [inlined]
...

@yuyichao
Copy link
Contributor

Do you have a huge page kernel? I've seen something similar (less clear error message) on arm when the libraries are not aligned to the larger page size. Fix would be to either use smaller page size (4k) or recompile the library that has the issue.

@ViralBShah ViralBShah added ppc64le building Build system, or building Julia or its dependencies labels Sep 17, 2019
@vtjnash
Copy link
Sponsor Member

vtjnash commented Sep 17, 2019

I think ppc64le frequently uses huge pages (64k), and so sounds like the problem is with BinaryBuilder (@staticfloat) and might need -Wl,-z,max-page-size=0x10000 (although the default might have been 0x200000 already for ld autoconfig???)

@yuyichao
Copy link
Contributor

For arm I believe the latest binutils already default to a large enough page size. I had problem before due to binaries that are built with older linker that hasn't been updated.

@nasica88
Copy link
Author

I don't think I am using any huge page now. Is there any specific way to check if this is indeed a huge page problem ?

root@5b95ee340ef3:/tmp/julia# grep -i huge /proc/meminfo
AnonHugePages: 0 kB
root@5b95ee340ef3:/tmp/julia# egrep 'trans|thp' /proc/vmstat
nr_anon_transparent_hugepages 0
thp_fault_alloc 0
thp_fault_fallback 0
thp_collapse_alloc 0
thp_collapse_alloc_failed 0
thp_split 0
thp_zero_page_alloc 0
thp_zero_page_alloc_failed 0

@nasica88
Copy link
Author

I finally succeeded in building julia on ppc64le, but this is only a makeshift. I replaced the *.so files with the page-alignment error with the corresponding OS files under /usr/lib directory, just like below.

root@5b95ee340ef3:/tmp/julia# cp /usr/lib/powerpc64le-linux-gnu/libcurl.so.4.5.0 ./usr/lib/libcurl.so.4

root@5b95ee340ef3:/tmp/julia# cp /usr/lib/powerpc64le-linux-gnu/libmbedtls.so.2.8.0 ./usr/lib/libmbedtls.so.2.6.0

root@5b95ee340ef3:/tmp/julia# cp /usr/lib/powerpc64le-linux-gnu/libssh2.so.1.0.1 ./usr/lib/libssh2.so.1.0.1

After that, make works fine.

root@5b95ee340ef3:/tmp/julia# make
...
REPL ─────────── 1.273557 seconds
Statistics ───── 0.487972 seconds
Stdlibs total ── 93.832328 seconds
Sysimage built. Summary:
Total ─────── 146.463495 seconds
Base: ─────── 52.627857 seconds 35.9324%
Stdlibs: ──── 93.832328 seconds 64.0653%
JULIA usr/lib/julia/sys-o.a
Generating precompile statements... 898 generated in 131.715009 seconds (overhead 97.270528 seconds)
LINK usr/lib/julia/sys.so

@staticfloat
Copy link
Sponsor Member

Thanks for this debugging @nasica88, it's really helpful. We've identified some steps in our build process that assume wrong page sizes, and we're patching it up in #33745

@maleadt
Copy link
Member

maleadt commented Jan 14, 2020

Fixed by #33745

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

No branches or pull requests

8 participants