Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to use zig cc as a drop-in C compiler #4774

Merged
merged 6 commits into from
Mar 22, 2020
Merged

ability to use zig cc as a drop-in C compiler #4774

merged 6 commits into from
Mar 22, 2020

Conversation

andrewrk
Copy link
Member

@andrewrk andrewrk commented Mar 21, 2020

This implements #3089.

Here are some todo list items. None of these are merge blockers; this can pretty much be merged as soon as it's passing all the tests.

  • llvm target triple vs zig target triple
  • test it with building some projects
    • libsoundio (I had to disable -fprofile-arcs)
    • LuaJIT (native)
    • LuaJIT (aarch64-linux-musl) - undefined symbol: __divtf3
  • specific special args
    • -MD, -MV, -MF
    • -nostdinc and how it relates to the native target
    • stack protector args
    • -g
    • omit-frame-pointer
    • -fsanitize
    • -m args affect cpu flags and -march=native
    • linker script
    • passing args to the linker
      • -z
      • -Xlinker
      • --for-linker
    • -L
    • version script
    • subsystem
    • -F
    • -framework
    • optimization flags
  • look at the list of generated options and determine if any more need to be detected

 * The generated options data file is sorted now in a way that
   makes sure longer prefixes are first. This prevents collisions
   with some parameters.
 * Add support for `-fPIC`, `-fno-PIC`, `-nostdlib`, `-shared`,
   `-rdynamic`, `-Wl,-soname`, `-Wl,-rpath`
 * Better support for `-o`.
 * Disable generating h files
 * Shared library support.
 * Better positional argument support.
@mikdusan
Copy link
Member

cherry pick: mikdusan@3c2bb85

@andrewrk andrewrk merged commit 7ffdf59 into master Mar 22, 2020
@andrewrk andrewrk deleted the zig-cc branch March 22, 2020 23:20
@andrewrk andrewrk mentioned this pull request Mar 22, 2020
23 tasks
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.

2 participants