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

improve zig cc flag integration #4784

Closed
17 of 23 tasks
andrewrk opened this issue Mar 22, 2020 · 2 comments
Closed
17 of 23 tasks

improve zig cc flag integration #4784

andrewrk opened this issue Mar 22, 2020 · 2 comments
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig cc Zig as a drop-in C compiler feature
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Mar 22, 2020

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
@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig cc Zig as a drop-in C compiler feature labels Mar 22, 2020
@andrewrk andrewrk added this to the 0.7.0 milestone Mar 22, 2020
@andrewrk andrewrk added the contributor friendly This issue is limited in scope and/or knowledge of Zig internals. label Mar 22, 2020
@andrewrk
Copy link
Member Author

andrewrk commented Mar 27, 2020

some linker flags to add support for:

warning: unsupported linker arg: -E

warning: unsupported linker arg: -O3

warning: unsupported linker arg: --gc-sections

warning: unsupported linker arg: -z
warning: unsupported linker arg: nodelete

warning: unsupported linker arg: -z
warning: unsupported linker arg: defs

warning: unsupported linker arg: -allow-shlib-undefined

warning: unsupported linker arg: --version-script
warning: unsupported linker arg: /home/andy/Downloads/llvm-project-10/llvm/build-release-aarch64/tools/remarks-shlib/Remarks.exports

@andrewrk
Copy link
Member Author

andrewrk commented Apr 2, 2020

This is done now; some stuff has been extracted into separate issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig cc Zig as a drop-in C compiler feature
Projects
None yet
Development

No branches or pull requests

1 participant