cross compiling os x -> linux

Jacob Carlborg via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Mar 29 05:52:17 PDT 2016


On 2016-03-29 12:59, 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?!

Yes. I tried using the ellcc cross compiler [1], which contains the 
linker and similar necessary tools for all targets it supports. 
Unfortunately I got errors of missing symbols related to backgrace:

undefined reference to `backtrace_symbols_fd'
undefined reference to `backtrace_symbols'

[1] http://ellcc.org

-- 
/Jacob Carlborg


More information about the digitalmars-d-ldc mailing list