[Support] Add MacOS as a host for ELD - #1818
Conversation
68c6301 to
c781011
Compare
|
Wow! Thanks for adding this support. Could you please add a github workflow to accompany and allow it to be tested on a mac ? You would need to add
|
I have added the support |
c781011 to
b2685ea
Compare
|
Do you plan on working and improving eld ? If so what areas are you planning to look at ? |
357dfb9 to
663a34d
Compare
|
one cause of concern here is that this is a CI instead of a nightly job(using github schedules). Since we are using the github free machines, it will significantly slow down CI as the CI that we have runs on self-hosted machines. I would prefer this to be a nightly job instead of a CI. Can we do this, and allows you to work independently to debug things if something ends up breaking and not affecting CI's. For now its definitely ok to see if the CI passes, but once the CI passes move it to nightly schedule. |
Makes sense, once the job pass I will move the schedule to nightly or maybe we can have a bot to start CI jobs based on tags along with nightly? |
Happy to keep contributing, though it'll be sporadic. I usually only work on this in my free time — traditionally I'm mostly on Zephyr, kernel, BeagleBoard for OSS stuff.
Happy to take pointers if there's something more useful for me to look at. |
Thanks for the contribution! While we have issues already posted, you can work on anything that feels natural and you think will benefit ELD and its users. This PR is going in the right direction. |
Appreciate the reply. More boards mean more testing opportunities. We're also focused on improving link-time performance, enhancing diagnostics, expanding reproducibility features for debugging, and adopting proven capabilities from BFD and LLD that can benefit both general-purpose and embedded linking use cases. Another area where contributions are valuable is expanding support for command-line options and improving compatibility with existing linker workflows, making it easier for users to migrate and adopt ELD in a wider range of environments. Leveraging linker plugins, which are already quite robust in ELD, within Zephyr could also be an effective way to address a number of challenges. There's plenty of value in helping improve documentation as well. Learning, documenting, and sharing best practices are all meaningful contributions. And of course, if you're interested in code size optimization, linker optimizations, or performance tuning, there are plenty of opportunities there too. Overall, any patches are welcome! |
3ae9a6e to
fcbef01
Compare
LLVM 22's llvm_add_library already uses PRIVATE/PUBLIC. Mixing that with the plain signature fails CMake. Use PRIVATE on LayoutMap and the TargetInfo libraries. Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
Unix Path.inc no longer includes unused Linux-only linux/nfs.h. Plugin libraries use .dylib, Mach-O-safe plugin metadata, and DYLD_LIBRARY_PATH / @loader_path search. CMake sets ELD_ON_APPLE, @loader_path rpath, bin/lib output dirs, and skips GNU version scripts on Apple ld64. Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
fcbef01 to
2ad59c0
Compare
|
Dhruv Menon (@malto101) to prevent having failures in tests due to missing tools (which could be expanded at any point), you can use "ninja" instead of "ninja ld.eld clang" to build everything. That will eliminate these kinds of failures. |
76d6483 to
5d50f0a
Compare
Add darwin/arm-darwin/aarch64-darwin features, python3, BSD tar, and DYLD_LIBRARY_PATH. Allow plugin FileCheck to match .dylib as well as .so/.dll. Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
macOS is a host for the ELF linker, not a Mach-O target. Document .dylib plugin naming and DYLD_LIBRARY_PATH search. Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
Test ld.eld on macos-latest so PRs get a Mac host build without changing the Linux self-hosted job. Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
Replaced inline scripts for checking non-documentation changes with a reusable action in ci.yml, ci-macos.yml, and ci-win.yml. This improves maintainability and consistency across workflows. The new action fetches the base branch from the Qualcomm repository and determines if the changes are solely documentation-related. Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
5d50f0a to
7ee80fa
Compare
Updated the CI workflow to stage the CheckNonDocChanges action at the workspace root, allowing for better path management. Added an optional input for the eld-root to support staging the action awa from its original location. Introduced a new lit configuration file for Linux x86_64 binaries to ensure compatibility with libc headers. Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
Thanks Steven Ramirez Rosa (@Steven6798) it helped a lot |
Shankar Easwaran (quic-seaswara)
left a comment
There was a problem hiding this comment.
Please make this ci-macos to be a nightly-macos.yml.
I will be able to approve this.
Thanks for getting this!
This PR adds MacOS support as a host for ELD (not a Mach-O target)
CMake detecs Darwin, uses "@loader_path" rpath and a kinda "bin/lib" layout, and skips GNU ver scripts on ld64
Runtime supports ".dylibs" plugins, Mach-O plugin metadata and "DYLD_LIBRARY_PATH/@loader_path" search. Lit gains Darwin features and FileChecks also accepts .dylib
also this was on my side
tried fixing "target_link_libraries" keyword that was mixed, it was breaking CMake on LLVM 22 on my host