Using Clang on Windows to Build for Linux

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Clang on Windows to Build for Linux

via cfe-dev
We're a predominantly Windows shop but are moving some of our code to
Linux but would like to use Clang on Windows to compile for Linux.

Is that possible? Is there a prepackaged version of Clang for that?
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using Clang on Windows to Build for Linux

via cfe-dev
On Wed, Oct 17, 2018 at 10:58:35AM -0700, Hayden Livingston via cfe-dev wrote:
> We're a predominantly Windows shop but are moving some of our code to
> Linux but would like to use Clang on Windows to compile for Linux.
>
> Is that possible? Is there a prepackaged version of Clang for that?

Put a copy of /usr/lib* and /usr/include from your Linux distro into a
directory, e.g. C:/linux-sysroot. Then compile with e.g.
  clang -target x86_64-pc-linux-gnu -Btooldir --sysroot C:/linux-sysroot

where tooldir contains your cross-linker (possibly lld).

Joerg
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev