[HN Gopher] Cross-Compiling Rust for RISC-V
       ___________________________________________________________________
        
       Cross-Compiling Rust for RISC-V
        
       Author : hasheddan
       Score  : 43 points
       Date   : 2022-03-21 13:48 UTC (2 days ago)
        
 (HTM) web link (danielmangum.com)
 (TXT) w3m dump (danielmangum.com)
        
       | unwind wrote:
       | This looks very thorough, nice!
       | 
       | I haven't (badly) used Rust in over a year, but this was
       | confusing:
       | 
       |  _x86_64-unknown-linux-gnu and other machine type identifiers are
       | referred to as target triples._
       | 
       | Isn't that four components, i.e a quad? What am I missing?
        
         | pcwalton wrote:
         | linux-gnu (GNU/Linux) is one component of the triple (x86_64,
         | unknown, linux-gnu). The fact that the hyphen is overloaded to
         | separate both components of the triple and words within those
         | components is unfortunate, but it's probably too difficult to
         | change at this point.
        
         | MitchellCash wrote:
         | The third field of the triplet is for the operating system
         | identifier [1] which can be expressed as two fields in the form
         | of `<sys>-<abi>` [2] as well as just `<sys>`, when applicable.
         | The LLVM docs also refer to the second part of the operating
         | system identifier as the "environment type" [3].
         | 
         | Examples of allowed operating system identifiers could be
         | `freebsd`, `linux-gnu` or `linux-android`. So, while it seems
         | like four components, the last two seem to get combined to
         | refer to a single "operating system identifier".
         | 
         | I'm no expert here, so corrections welcome, I was just curious
         | from your comment and thought I'd share what I had found.
         | 
         | [1] https://wiki.osdev.org/Target_Triplet
         | 
         | [2] https://clang.llvm.org/docs/CrossCompilation.html#target-
         | tri...
         | 
         | [3] https://llvm.org/doxygen/classllvm_1_1Triple.html
        
           | unwind wrote:
           | Great info, thanks!
        
         | remexre wrote:
         | Having the -gnu part is newer than it being called a triple.
        
       ___________________________________________________________________
       (page generated 2022-03-23 23:00 UTC)