cross compiling os x -> linux

Kai Nacke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Mar 29 09:46:44 PDT 2016


On Tuesday, 29 March 2016 at 10:59:41 UTC, yawniek wrote:
> is it possible to cross compile linux binaries from os x?
>
> or in other words, is there a tutorial on how to build such a 
> toolchain?
>
> what i tried:
> ldc2 -of test -mtriple=i686-unknown-linux-gnu 
> -relocation-model=pic test.d
> ld: library not found for -lrt
> clang: error: linker command failed with exit code 1 (use -v to 
> see invocation)
> Error: /usr/bin/gcc failed with status: 1
>
> so i guess i need a directory with all my linux libraries and 
> the correct parameters?!

Hi yawniek!

A description how to cross-compile can be found here: 
http://forum.dlang.org/post/fhwvxatxezkafnalwhqr@forum.dlang.org. 
For sure to build a linux binary you need all the referenced libs.

I can't give you advice on how to build such an environment on OS 
X. Linux distributions usually provide some cross-compilers and 
libraries. Maybe you find a brew package.

Regards,
Kai


More information about the digitalmars-d-ldc mailing list