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

remove not working archs from zig targets and add sub arch #438

Closed
andrewrk opened this Issue Aug 30, 2017 · 2 comments

Comments

Projects
None yet
1 participant
@andrewrk
Copy link
Member

andrewrk commented Aug 30, 2017

Currently, if you do zig targets on a macbook, you see darwin as the native target. What's the macosx target then?

Here's what I've learned:

some comments from llvm/include/ADT/triple.h:

  /// getMacOSXVersion - Parse the version number as with getOSVersion and then
  /// translate generic "darwin" versions to the corresponding OS X versions.
  /// This may also be called with IOS triples but the OS X version number is
  /// just set to a constant 10.4.0 in that case.  Returns true if successful.
  /// isMacOSX - Is this a Mac OS X triple. For legacy reasons, we support both
  /// "darwin" and "osx" as OS X triples.
  bool isMacOSX() const {
    return getOS() == Triple::Darwin || getOS() == Triple::MacOSX;
  }

it appears that the "macosx version" is an important thing for llvm to know, e.g. an example target triple clang gives is: x86_64-apple-macosx10.12.0. It's pretty clear from this that we should specify macosx if we can.

  • So let's make it so zig only reports macosx and ios, and not darwin. native target on macosx should be macosx. darwin should not be listed in zig targets or @import("builtin").Os.
  • Figure out the macosx native version and make sure to give that to llvm. when cross compiling for macosx, require specifying it. it should be part of the Target API.

@andrewrk andrewrk added this to the 0.2.0 milestone Aug 30, 2017

@andrewrk

This comment has been minimized.

Copy link
Member Author

andrewrk commented Oct 17, 2017

These targets as well don't work in freestanding mode.

--- a/README.md
+++ b/README.md
@@ -58,31 +58,17 @@ that counts as "freestanding" for the purposes of this table.
 |x86_64       | OK           | OK      | OK      | OK      | planned |
 |arm          | OK           | planned | planned | N/A     | planned |
 |aarch64      | OK           | planned | planned | planned | planned |
-|avr          | OK           | planned | planned | N/A     | planned |
 |bpf          | OK           | planned | planned | N/A     | planned |
 |hexagon      | OK           | planned | planned | N/A     | planned |
 |mips         | OK           | planned | planned | N/A     | planned |
-|msp430       | OK           | planned | planned | N/A     | planned |
-|nios2        | OK           | planned | planned | N/A     | planned |
 |powerpc      | OK           | planned | planned | N/A     | planned |
 |r600         | OK           | planned | planned | N/A     | planned |
 |amdgcn       | OK           | planned | planned | N/A     | planned |
-|riscv        | OK           | planned | planned | N/A     | planned |
 |sparc        | OK           | planned | planned | N/A     | planned |
 |s390x        | OK           | planned | planned | N/A     | planned |
-|tce          | OK           | planned | planned | N/A     | planned |
 |thumb        | OK           | planned | planned | N/A     | planned |
-|xcore        | OK           | planned | planned | N/A     | planned |
-|nvptx        | OK           | planned | planned | N/A     | planned |
-|le           | OK           | planned | planned | N/A     | planned |
-|amdil        | OK           | planned | planned | N/A     | planned |
-|hsail        | OK           | planned | planned | N/A     | planned |
 |spir         | OK           | planned | planned | N/A     | planned |
-|kalimba      | OK           | planned | planned | N/A     | planned |
-|shave        | OK           | planned | planned | N/A     | planned |
 |lanai        | OK           | planned | planned | N/A     | planned |
-|wasm         | OK           | N/A     | N/A     | N/A     | N/A     |
-|renderscript | OK           | N/A     | N/A     | N/A     | N/A     |

We need a layer on top of LLVM's enum for actually supported targets.

andrewrk added a commit that referenced this issue Oct 17, 2017

@andrewrk

This comment has been minimized.

Copy link
Member Author

andrewrk commented Oct 24, 2017

I think we should also introduce the SubArch target property.

AndreaOrru added a commit that referenced this issue Jan 7, 2018

@andrewrk andrewrk changed the title consolidate darwin and macosx os target remove not working archs from zig targets and add sub arch Jan 7, 2018

@andrewrk andrewrk modified the milestones: 0.2.0, 0.3.0 Jan 7, 2018

@andrewrk andrewrk modified the milestones: 0.3.0, 0.4.0 Feb 28, 2018

@andrewrk andrewrk closed this in ade1038 Feb 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.