Skip to content
  • Vassil Vassilev's avatar
    Implement support for cross-compilation with clang, using gcc toolchain. · 9d8c84b6
    Vassil Vassilev authored
    When building modules with clang from the trunk we need to build with gcc's
    libstdc++. Apparently this can be done in clang in 2 ways:
      1. Building clang with -DGCC_INSTALL_PREFIX=$(dirname `which gcc`)/../
         This would hardcode the patch to the gcc toolchain when compiling clang.
      2. Pass on every compiler invocation --gcc-toolchain=$(dirname `which gcc`)/../
         This allows relocatability of the toolchain.
    
    I decided to implement the second option and got stuck with implementing it in
    cmake. One of the reasons was I was unable to pass --gcc-toolchain early enough
    and try_compile fails at very early stages.
    
    Finally I decided to go for the first option hardcoding the gcc toolchain path
    at clang built time. This is sufficient for modules.
    
    This commit serializes the progress I did on 2 in configure make. Now we can
    configure with --gcc-toolchain in configure-make.
    9d8c84b6
Loading