On 3 October 2014 15:20, Evgeniy Stepanov <eugenis at google.com> wrote:> That's a third option. This flag only really makes sense for one or > several test cases in a large GTest file. They can be split and moved > to X86. But this adds more complexity to build system which, in my > opinion, is never good.Roger.> Compiler-rt and llvm build systems know very little about cross-compiling.Well, right now, it doesn't matter how many targets you build LLVM for, it'll only run the unit tests on the host platform. It doesn't seem to have been designed that way, but it works. Compiler-rt, OTOH, tries to run AArch64 unit tests, which there's no guarantee they'll work on any other platform. There may be something missing in its CMake files that is present in the LLVM's? cheers, --renato
On Fri, Oct 3, 2014 at 9:18 PM, Renato Golin <renato.golin at linaro.org> wrote:> On 3 October 2014 15:20, Evgeniy Stepanov <eugenis at google.com> wrote: >> That's a third option. This flag only really makes sense for one or >> several test cases in a large GTest file. They can be split and moved >> to X86. But this adds more complexity to build system which, in my >> opinion, is never good. > > Roger. > > >> Compiler-rt and llvm build systems know very little about cross-compiling. > > Well, right now, it doesn't matter how many targets you build LLVM > for, it'll only run the unit tests on the host platform. It doesn't > seem to have been designed that way, but it works. > > Compiler-rt, OTOH, tries to run AArch64 unit tests, which there's no > guarantee they'll work on any other platform. There may be something > missing in its CMake files that is present in the LLVM's?I guess the only difference is that compiler-rt tests require execution of target binaries. There is platform test logic in cmake/config-ix.cmake that tries compilation (but not execution) for arm and aarch64 on ARM hosts. Maybe the easiest fix would be to try both on aarch64 host, and only 32-bit arm on 32-bit arm host?> cheers, > --renato
On 6 October 2014 09:57, Evgeniy Stepanov <eugenis at google.com> wrote:> There is platform test logic in cmake/config-ix.cmake that tries > compilation (but not execution) for arm and aarch64 on ARM hosts. > Maybe the easiest fix would be to try both on aarch64 host, and only > 32-bit arm on 32-bit arm host?Not all AArch64 systems can run AArch32 code (needs special kernel configuration), so I wouldn't assume anything on either arches. I guess the least problematic would be to get config-ix to try_compile and try_run on each arch you think should run, so that you can get x86 on x86_64 and AArch32 on 32-bit-supporting-AArch64. You should only fail if the arch can't compile a chosen arch, but only enable the tests if the arch can run. Warnings during CMake time would be appropriate, I think. cheers, --renato