Skip to content

macOS Support & README Overhaul - #18

Merged
johnhringiv merged 2 commits into
mainfrom
mac_fixes
Jan 13, 2026
Merged

johnhringiv merged 2 commits into
mainfrom
mac_fixes

Conversation

@johnhringiv

Copy link
Copy Markdown
Owner

Summary

Adds full macOS (Intel) support and comprehensively rewrites the README.

macOS Support

Object File Emission (emit_iced.rs)

  • Added Mach-O displacement patching for RIP-relative data references
  • Fixed external function calls to emit raw CALL rel32 bytes (Mach-O linker expects zero displacement)

Linker Integration (main.rs)

  • Made libwild import conditional on Linux (#[cfg(target_os = "linux")])
  • Added link_with_ld() for macOS: uses -syslibroot, -lSystem, and queries SDK path via xcrun
  • Renamed --gcc flag to --external-linker for clarity

Linux Linker Improvements

  • Added get_cc_file() to query CRT paths via cc -print-file-name=<name>
  • Added get_cc_library_paths() to discover library search paths via cc -print-search-dirs
  • Replaced hardcoded paths with dynamic discovery from the C toolchain
  • Extracted build_linux_linker_args() shared between ld and libwild

README Overhaul

  • Rewrote intro: mentions iced-x86, object crate, platform support
  • Added side-by-side C code / assembly example with static variables
  • Reorganized: Usage moved above Requirements for better flow
  • Updated --gcc → --external-linker in options table
  • Added platform-specific installation instructions (Linux/macOS)
  • Merged Makefile requirements into main Requirements section

Test Changes

  • Updated test runner to use --external-linker flag

Test Plan

  • cargo test passes (831 tests on Linux)
  • macOS build and basic compilation verified

🤖 Generated with Claude Code

@claude

claude Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@codecov

codecov Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.73684% with 24 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/main.rs 82.50% 14 Missing ⚠️
src/emit_iced.rs 33.33% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

@claude

claude Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@johnhringiv
johnhringiv merged commit 9eeac23 into main Jan 13, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant