Giter Club home page Giter Club logo

Comments (6)

DimitryAndric avatar DimitryAndric commented on July 23, 2024 1

Okay, this turned out to be my own fault. In llvm/llvm-project@6255157d24e2 I turned on trivial std::pair copy constructors for FreeBSD >= 14. Which was a bad idea, in hindsight, because the ABI changes. The idea at the time was to bump the libc++ version to be able to break the ABI, but we never got to that.

Long story short, because of the mismatch a libLLVMnn.so compiled against a "new ABI" libc++ tends to crash in interesting ways, when you use it from a precompiled ldc2 executable, that was originally compiled against the "old ABI" libc++.

In DimitryAndric/freebsd-src@4c0e8f6 I reverted that, rebuilt the FreeBSD world and ports, and now lang/ldc builds just fine, at least without any crashes! I haven't extensively tested the resulting ldmd2 and ldc2, but if they are able to build the D runtime, I assume they are OK.

from ldc.

DimitryAndric avatar DimitryAndric commented on July 23, 2024

ping @alonsobsd who is maintainer of the lang/ldc port.

from ldc.

kinke avatar kinke commented on July 23, 2024

Thx for the report. AFAICT, the relevant code (in master, but shouldn't have changed significantly since v1.35) looks as harmless as it gets wrt. inserting some pointers into a stack-allocated and default-initialized llvm::SmallSet<llvm::Use *, 16> Visited. We have been using v15.0.7 as primary LLVM version for a while (incl. extensive CI coverage), but I've never seen any issues when building the little ldc-build-runtime tool.

from ldc.

kinke avatar kinke commented on July 23, 2024

Oh and our current FreeBSD CI does use the LLVM v15.0.7 port too, and its clang as C++ host compiler: https://cirrus-ci.com/task/5161765764333568

from ldc.

DimitryAndric avatar DimitryAndric commented on July 23, 2024

Yeah, the mystery here is that the devel/llvm15 port, when compiled by clang 17.0.6, does seem to work, whereas if the devel/llvm15 port is compiled by clang 18, it does not.... I just built a ldc2 binary with debug info on a FreeBSD 15-CURRENT machine with clang 17.0.6 and copied it over the the FreeBSD machine with a clang-18 compiled libLLVM15.so, and for some reason it is now allocating ~25 GiB of data in the "SmallPtrSet". :)

I'm thinking that some sort of optimization has messed up the assumptions under which such SmallPtrSets can be used, but I can't see the problem with other ports that use llvm15, so I'm still not sure whether the problem is in GarbageCollect2Stack, in llvm15, or in clang18...

from ldc.

kinke avatar kinke commented on July 23, 2024

Oh wild. I'd make sure that the same clang that was used to compile libLLVM is used as C++ host compiler for LDC too.

from ldc.

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.