Skip to content

improve zig cc flag integration #4784

@andrewrk

Description

@andrewrk

Extracted from #4774; see #3089 for the original issue.

  • llvm target triple vs zig target triple; llvm -mcpu vs zig -mcpu zig cc: parse -target and -mcpu/-march/-mtune flags according to clang #4911
  • 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 not needed
    • stack protector args not needed
    • -g
    • omit-frame-pointer not needed
    • -fsanitize
    • -m args affect cpu flags and -march=native zig cc: integration with -m flags #4912
    • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.zig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions