Using ELLCC to cross compile tip LLVM fails with missing arcrandom?

Home Forums Forum Using ELLCC to cross compile tip LLVM fails with missing arcrandom?

This topic contains 0 replies, has 1 voice, and was last updated by  Neil Henning 9 years, 1 month ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #23342

    Neil Henning

    I’m trying to compile tip LLVM with ellcc (from the trunk branch).

    FAILED: /<some dir>/ellcc/bin/ecc++   -DGTEST_HAS_RTTI=0 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -target mipsel-linux-eng  -stdlib=libc++ -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wnon-virtual-dtor -Wno-comment -std=c++11 -fcolor-diagnostics -O3 -DNDEBUG -Ilib/Support -I/<some dir>/llvm/lib/Support -Iinclude -I/<some dir>/llvm/include    -fno-exceptions -fno-rtti -MMD -MT lib/Support/CMakeFiles/LLVMSupport.dir/Process.cpp.o -MF "lib/Support/CMakeFiles/LLVMSupport.dir/Process.cpp.o.d" -o lib/Support/CMakeFiles/LLVMSupport.dir/Process.cpp.o -c /<some dir>/llvm/lib/Support/Process.cpp
    ecc: warning: argument unused during compilation: '-stdlib=libc++'
    In file included from /<some dir>/llvm/lib/Support/Process.cpp:95:
    /<some dir>/llvm/lib/Support/Unix/Process.inc:452:10: error: use of undeclared identifier 'arc4random'
      return arc4random();
             ^
    1 error generated.
    ecc: warning: argument unused during compilation: '-stdlib=libc++'

    Is my error – its missing the arc4random function. This function is only enabled is _BSD_SOURCE is enabled in musl – what is truly weird though is the try_compile step to detect whether arc4random is present passes, thus enabling the use of this function within LLVM, but when it comes to finally compile the function is no longer there.

    The arc4random try_compile step is;

    Determining if the arc4random exist passed with the following output:
    Change Dir: /<some dir>/build/llvm-ci20/build/CMakeFiles/CMakeTmp
    
    Run Build Command:/usr/bin/ninja cmTryCompileExec2899720451
    [1/2] Building C object CMakeFiles/cmTryCompileExec2899720451.dir/CheckSymbolExists.c.o
    [2/2] Linking C executable cmTryCompileExec2899720451
    ecc: warning: argument unused during compilation: '-rdynamic'
    /<some dir>/ellcc/bin/ecc-ld: /<some dir>/ellcc/bin/../libecc/lib/mipsel-linux-eng/libc.a(syscall.o): warning: linking abicalls files with non-abicalls files
    
    File /<some dir>/build/llvm-ci20/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
    /* */
    #include <stdlib.h>
    
    int main(int argc, char** argv)
    {
      (void)argv;
    #ifndef arc4random
      return ((int*)(&arc4random))[argc];
    #else
      (void)argc;
      return 0;
    #endif
    }

    Anyone have any ideas? Been banging my head against this for a day now! 🙁

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.