Coder Social home page Coder Social logo

linux/ppc64el: fails to build LLVM with `./elf/thunks.cc:257: void mold::elf::OutputSection<E>::create_range_extension_thunks(mold::elf::Context<E>&) [with E = mold::elf::PPC64V2]: Assertion `thunk->size() < max_thunk_size' failed.` about mold HOT 10 CLOSED

sylvestre avatar sylvestre commented on August 17, 2024
linux/ppc64el: fails to build LLVM with `./elf/thunks.cc:257: void mold::elf::OutputSection::create_range_extension_thunks(mold::elf::Context&) [with E = mold::elf::PPC64V2]: Assertion `thunk->size() < max_thunk_size' failed.`

from mold.

Comments (10)

rui314 avatar rui314 commented on August 17, 2024

Just to confirm: I can reproduce the issue if I build Clang with mold on ppc64le, right?

from mold.

sylvestre avatar sylvestre commented on August 17, 2024

Yes, except if it is caused by some extra LDFLAGS that we use (but you can see them in the log)

from mold.

sylvestre avatar sylvestre commented on August 17, 2024

I also see it on arm64:
https://llvm-jenkins.debian.net/job/llvm-toolchain-18-binaries/architecture=arm64,distribution=unstable,label=arm64/73/console

from mold.

rui314 avatar rui314 commented on August 17, 2024

It is not easy to reproduce the issue for me because it involves lots of Debian-specific toolings. Could you reproduce the issue just by building LLVM from source without using Debian-specific tools?

from mold.

sylvestre avatar sylvestre commented on August 17, 2024

Just running the cmake will all the arg should be good but I will try to make a test case. Any recommendation on what to do next?
Thanks

from mold.

rui314 avatar rui314 commented on August 17, 2024

I fired up debian:unstable docker image, installed build-deps for clang-18, installed mold, checked out the llvm repo from github, and then copy-and-pasted the cmake command line, but it built just fine. So I think there's a hidden condition to reproduce the issue. Ideally, I want to know a procedure to reproduce the issue with the docker image.

from mold.

jcelerier avatar jcelerier commented on August 17, 2024

I'm seeing the same thing on fedora 40 aarch64 (asahi linux) on a different codebase.
Trace:

Thread 1 "ld.mold" hit Breakpoint 1.1, mold::elf::OutputSection<mold::elf::ARM64>::create_range_extension_thunks (this=0x40cbe27ca80, ctx=...) at /usr/src/debug/mold-2.31.0-1.fc40.aarch64/elf/thunks.cc:257
257         assert(thunk->size() < max_thunk_size);
(gdb) bt
#0  mold::elf::OutputSection<mold::elf::ARM64>::create_range_extension_thunks (this=0x40cbe27ca80, ctx=...) at /usr/src/debug/mold-2.31.0-1.fc40.aarch64/elf/thunks.cc:257
#1  mold::elf::compute_section_sizes<mold::elf::ARM64> (ctx=...) at /usr/src/debug/mold-2.31.0-1.fc40.aarch64/elf/passes.cc:1429
#2  0x0000aaaaaafc6158 in mold::elf::elf_main<mold::elf::ARM64> (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/mold-2.31.0-1.fc40.aarch64/elf/main.cc:578
#3  0x0000aaaaaafb30a0 in mold::elf::redo_main<mold::elf::X86_64> (ctx=..., argc=82, argv=0xffffffffdae8) at /usr/src/debug/mold-2.31.0-1.fc40.aarch64/elf/passes.cc:26
#4  mold::elf::elf_main<mold::elf::X86_64> (argc=82, argv=0xffffffffdae8) at /usr/src/debug/mold-2.31.0-1.fc40.aarch64/elf/main.cc:366
#5  0x0000fffff7900a1c in __libc_start_call_main (main=main@entry=0xaaaaaaba0fc0 <main(int, char**)>, argc=argc@entry=82, argv=argv@entry=0xffffffffdae8) at ../sysdeps/nptl/libc_start_call_main.h:58
#6  0x0000fffff7900afc in __libc_start_main_impl (main=0xaaaaaaba0fc0 <main(int, char**)>, argc=82, argv=0xffffffffdae8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>)
    at ../csu/libc-start.c:360
#7  0x0000aaaaaaba2a70 in _start ()
(gdb) 

Dump: https://fromsmash.com/2qzqnkmPiN-it

from mold.

rui314 avatar rui314 commented on August 17, 2024

I need a reproducer to debug it. Is your program open-source?

from mold.

jcelerier avatar jcelerier commented on August 17, 2024

Here's a small reproducer:

data.zip

$ ld.mold --version
mold 2.31.0 (compatible with GNU ld)

$ ld.mold -EL --hash-style=gnu --build-id --eh-frame-hdr -m aarch64linux -shared obj.o lib.a
ld.mold: /builddir/build/BUILD/mold-2.31.0/elf/thunks.cc:257: void mold::elf::OutputSection<E>::create_range_extension_thunks(mold::elf::Context<E>&) [with E = mold::elf::ARM64]: Assertion `thunk->size() < max_thunk_size' failed.

from mold.

rui314 avatar rui314 commented on August 17, 2024

Please try again with git head.

from mold.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.