LS Service cross compile issue


#1

I want to cross compile LS service (ex) build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/version)

I change toolchain.cmake file's CMAKE_C_COMPILER, and C_MAKE_CXX_COMPILER to my ubuntu's /usr/bin/clang and /usr/bin/clang++ in service directory.

and run command cmake.status's
cmake /home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22/git -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SO_NO_EXE=0 -DCMAKE_TOOLCHAIN_FILE=/home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22/toolchain.cmake -DCMAKE_VERBOSE_MAKEFILE=1 -DWEBOS_INSTALL_ROOT:PATH=/ -DWEBOS_COMPONENT_VERSION:STRING=1.0.22 -Wdev -Wno-dev

but error occurs

-- The CXX compiler identification is unknown
-- Check for working CXX compiler: /usr/bin/clang++-4.0
-- Check for working CXX compiler: /usr/bin/clang++-4.0 -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/clang++-4.0" is not able to compile a simple
test program.

It fails with the following output:

Change Dir: /home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_a2795/fast"

/usr/bin/make -f CMakeFiles/cmTC_a2795.dir/build.make
CMakeFiles/cmTC_a2795.dir/build

make[1]: Entering directory
`/home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22/CMakeFiles/CMakeTmp'

Building CXX object CMakeFiles/cmTC_a2795.dir/testCXXCompiler.cxx.o

/usr/bin/clang++-4.0 -march=armv7ve -mthumb -mfpu=neon-vfpv4
-mfloat-abi=hard -mcpu=cortex-a7
--sysroot=/home/seungho/webOS/build-webos/BUILD/sysroots/raspberrypi3 -O2
-pipe -g -feliminate-unused-debug-types
-fdebug-prefix-map=/home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22=/usr/src/debug/settingsservice/1.0.22-1-r22
-fdebug-prefix-map=/home/seungho/webOS/build-webos/BUILD/sysroots/x86_64-linux=
-fdebug-prefix-map=/home/seungho/webOS/build-webos/BUILD/sysroots/raspberrypi3=
-fvisibility-inlines-hidden -march=armv7ve -mthumb -mfpu=neon-vfpv4
-mfloat-abi=hard -mcpu=cortex-a7
--sysroot=/home/seungho/webOS/build-webos/BUILD/sysroots/raspberrypi3 -o
CMakeFiles/cmTC_a2795.dir/testCXXCompiler.cxx.o -c
/home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

clang: warning: argument unused during compilation: '-mthumb'
[-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-mfpu=neon-vfpv4'
[-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-mfloat-abi=hard'
[-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-mcpu=cortex-a7'
[-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-mthumb'
[-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-mfpu=neon-vfpv4'
[-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-mfloat-abi=hard'
[-Wunused-command-line-argument]

clang: warning: argument unused during compilation: '-mcpu=cortex-a7'
[-Wunused-command-line-argument]

error: unknown target CPU 'armv7ve'

make[1]: *** [CMakeFiles/cmTC_a2795.dir/testCXXCompiler.cxx.o] Error 1

make[1]: Leaving directory
`/home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22/CMakeFiles/CMakeTmp'

make: *** [cmTC_a2795/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:20 (project)

-- Configuring incomplete, errors occurred!
See also "/home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22/CMakeFiles/CMakeOutput.log".
See also "/home/seungho/webOS/build-webos/BUILD/work/raspberrypi3-webos-linux-gnueabi/settingsservice/1.0.22-1-r22/CMakeFiles/CMakeError.log".

so I try to original gcc, and g++ and run this command but error occur again...

so could you tell me how to re-build LS service by clang.

thanks!