Add x64-linux triplets and toolchains - #127
Conversation
Mirror the x64-osx structure for Linux: dynamic linkage with the same per-port static overrides, a carbon toolchain (C++17, PIC, hidden visibility, IPO, shared warning set) with a GCC-compatible MATH_OPTIMIZE_FLAG branch, and a chainload shim that includes vcpkg's linux.cmake.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3aee2f4e9e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…default Extend carbon-core's supports expression with (linux & x64) now that the port is validated there. Remove the global IPO default from the Linux toolchain: Clang's -flto requires an LLVM-aware linker (lld/LLVMgold) and a toolchain-wide default fails configure-time compiler checks on plain binutils setups; consuming projects can still opt in. The carbon umbrella port is left unchanged since most of its components have no Linux port yet.
|
Hey LelandJin - thanks a lot for your contribution! I work at Fenris Creations and wanted to let you know that we've acknowledged your PR. We'll take a proper look at it as soon as we can and really appreciate you taking the time to contribute. |
|
Ha, so I am not the only weirdo that wants Linux support :D If you are interested, I have this and even more patches and fixes for Linux here: https://github.com/TrueBrain/carbonengine-linux/ . Might avoid you walking into the same pitfalls I did :) You have a nicer way of dealing with clang/gcc; I am going to borrow that :) |
CCP-Aporia
left a comment
There was a problem hiding this comment.
Hi @LelandJin ,
thank you for this interesting PR, there are some good bits in here. See the inline comments for requested changes.
Please take note that we are still in the process of sorting out specifics around accepting contributions. So even with those requested changes, the PR may sit here for a while longer.
…rts change Restore CMAKE_INTERPROCEDURAL_OPTIMIZATION ON to match the other platforms; with Clang this requires an LLVM-aware linker (lld or LLVMgold) in the build environment. The carbon-core supports update moves to a separate PR to avoid a circular dependency with carbonengine/core#31.
|
Thanks for the review @CCP-Aporia! Both points are addressed: the carbon-core supports change moved to #129 to break the circular dependency, and IPO is back on for Linux with the linker requirement documented. No rush on the contribution-process side — happy to keep this in sync with main in the meantime. |
Summary
Adds
x64-linuxsupport to the registry, mirroring the existing macOS/Windows structure:x64-linux-debug,x64-linux-internal,x64-linux-release,x64-linux-trinitydev— identical to theirx64-osxcounterparts (dynamic CRT/library linkage,VCPKG_BUILD_TYPE release, per-port static-linkage overrides), withVCPKG_CMAKE_SYSTEM_NAME Linuxand no Apple-specific variables.x64-linux-carbon.cmake(C++17, PIC, hidden visibility, IPO,CCP_PLATFORM=Linux, the shared warning set, andMATH_OPTIMIZE_FLAGwith a GCC branch — GCC has no-fhonor-infinities/-fhonor-nans, so it uses-ffast-math -fno-finite-math-onlyto keep Inf/NaN honored like the Clang platforms) andx64-linux-triplet.cmake(chainload shim including vcpkg'slinux.cmake).This is a companion to the carbon core PR that adds
x64-linuxCMake presets and a POSIX port of the platform-specific code.Validation
Used to configure, build, and test carbon core on Fedora Linux 43 (WSL2, GCC 15.2.1) via the new
x64-linux-debugpreset; all 20 dependencies (tracy, gtest, lz4, python3 host tools and their transitive deps) build with these triplets, and core's full gtest suite passes (184/184).Note for CI environments: vcpkg's bundled patchelf 0.15.5 corrupted the ELF
DT_INITentry of dynamic libraries produced by newer binutils during RPATH adjustment (loader crash incall_initondlopen, observed with libffi/liblzma). Building with patchelf ≥ 0.18 resolves it; this may be worth pinning when Linux CI is set up.