|
|
Subscribe / Log in / New account

Oh FFS!

Oh FFS!

Posted Nov 25, 2024 12:14 UTC (Mon) by pizza (subscriber, #46)
In reply to: Oh FFS! by Wol
Parent article: NonStop discussion around adding Rust to Git

> Don't get into circular arguments. Who cares if LLVM and gcc need a C++ compiler because C++ needs LLVM or gcc. Just don't use C++! What do you *NEED* it for? YOU DON'T.

In the short term, you're cross-compiling anyway.

But it's a lot simpler to just port the parts of GCC/LLVM necessary for cross-compilation of C (including a very minimal libc) than it is to _also_ port the inftastructure neeed for C++ (and Rust) including their respective standard/runtime libraries.

Once you have the basics going, then you can go back and port a full-featured libc, then move on to the infrastructure needed for C++, Rust, and so forth as needed.


to post comments

Oh FFS!

Posted Nov 25, 2024 18:04 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

> But it's a lot simpler to just port the parts of GCC/LLVM necessary for cross-compilation of C (including a very minimal libc) than it is to _also_ port the inftastructure neeed for C++ (and Rust) including their respective standard/runtime libraries.

Oh, absolutely. Interestingly, adding Rust is _easier_ than C++. You don't need to worry about a lot of gnarly stuff like multiple inheritance, member pointers, and so on.

Oh FFS!

Posted Nov 30, 2024 14:35 UTC (Sat) by mathstuf (subscriber, #69389) [Link] (1 responses)

What platform specifics are there for multiple inheritance and member pointers? ABI decisions? I'd expect most to just import the Itanium ABI for such things which would be minimal consideration for porting. But if one wants to describe their own ABI…yes, Rust probably has fewer decision points than C++.

Oh FFS!

Posted Nov 30, 2024 21:01 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

> What platform specifics are there for multiple inheritance and member pointers?

Virtual table layouts, virtual tables during object construction, and so on. For member pointers: the way you represent pointers to virtual functions (via offsets in a vtable). Also various small things, like allocating storage for the array length so that delete[] can properly run destructors.

Nothing too complicated, but still a fair bit of work. And I assume that you don't want to just re-use the existing ABI for some reason, because it equally applies to Rust as well as C++.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds