Unable to compile vcuserland

Tim Kientzle tim at kientzle.com
Tue Apr 16 04:16:46 UTC 2013


On Apr 15, 2013, at 3:09 AM, Alie Tan wrote:

> Tim also submitted additional patches via pull requests. Took me some time
> to get around to merge them but now vchiq-freebsd code should be compilable
> with clang
> 
> 
> Thanks, but now I am getting another error
> 
> CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
>   The C compiler "/usr/bin/gcc" is not able to compile a simple test program.
> 
>   It fails with the following output:
> 
>    Change Dir: /usr/src/vc/userland/build/arm-freebsd/release/CMakeFiles/CMakeTmp

That's because it tries to build with gcc and ends up with
the wrong compiler.  The following patch changes
it to use 'cc' so it will work with either gcc or clang:

--- a/makefiles/cmake/toolchains/arm-freebsd.cmake
+++ b/makefiles/cmake/toolchains/arm-freebsd.cmake
@@ -4,8 +4,8 @@
 #
 
 SET(CMAKE_SYSTEM_NAME FreeBSD)
-SET(CMAKE_C_COMPILER gcc)
-SET(CMAKE_CXX_COMPILER g++)
+SET(CMAKE_C_COMPILER cc)
+SET(CMAKE_CXX_COMPILER c++)
 SET(CMAKE_ASM_COMPILER as)
 SET(CMAKE_SYSTEM_PROCESSOR arm)
 

You'll hit some more errors after this (most seem to be real errors
in vcuserland that clang detects and gcc does not).  Getting
vcuserland to build with clang will take a little more work.

Note:  You don't need vcuserland or vchiq to use FreeBSD on
RaspberryPi; you just need those if you want to work with graphics.
If you're using Crochet, you might want to edit board/RaspberryPi/setup.sh
and comment out the vcuserland references.

Tim



More information about the freebsd-arm mailing list