Cloudef / wlc

High-level Wayland compositor library
MIT License
330 stars 58 forks source link

clang build issue #158

Closed fedya closed 8 years ago

fedya commented 8 years ago

trying to build wlc with clang

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.68931
+umask 022
+cd /home/omv/wlc/BUILD
+'[' 1 -eq 1 ']'
+'[' 1 -eq 1 ']'
+'[' 1 -eq 1 ']'
+cd /home/omv/wlc/BUILD
+rm -rf wlc-0.0.2
+/bin/tar -xf /home/omv/wlc/wlc-0.0.2.tar.bz2
+cd wlc-0.0.2
+/bin/tar -xf /home/omv/wlc/chck-20160427.tar.xz
+exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.68931
+umask 022
+cd /home/omv/wlc/BUILD
+cd wlc-0.0.2
+'[' 1 -eq 1 ']'
+'[' 1 -eq 1 ']'
+CC=/usr/bin/clang
+export CC
+CXX=/usr/bin/clang++
+export CXX
+CFLAGS='-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto'
+export CFLAGS
+CXXFLAGS='-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto'
+export CXXFLAGS
+FFLAGS='-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto'
+export FFLAGS
+LDFLAGS='-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto -Wl,-O2  -Wl,--no-undefined -flto '
+export LDFLAGS
+CROSSCOMPILE='--target=x86_64-mandriva-linux-gnu --build=x86_64-mandriva-linux-gnu'
+export CROSSCOMPILE
+mkdir -p build
+cd build
+CROSSCOMPILE=
+export CROSSCOMPILE
+/usr/bin/cmake .. -DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR:PATH=lib64 -DLIB_INSTALL_DIR:PATH=lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DCMAKE_BUILD_TYPE=release -DLIB_SUFFIX=64 -DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF '-DCMAKE_C_FLAGS=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto' '-DCMAKE_C_FLAGS_RELEASE=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto' '-DCMAKE_C_FLAGS_RELWITHDEBINFO=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto' '-DCMAKE_CXX_FLAGS=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto' '-DCMAKE_CXX_FLAGS_RELEASE=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto' '-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto' '-DCMAKE_EXE_LINKER_FLAGS=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto -Wl,-O2  -Wl,--no-undefined -flto ' '-DCMAKE_SHARED_LINKER_FLAGS=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4  -fPIC -flto -Wl,-O2  -Wl,--no-undefined -flto ' '-DCMAKE_MODULE_LINKER_FLAGS=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -flto -Wl,-O2  -flto' -DCMAKE_BUILD_TYPE=Release -DWLC_BUILD_TESTS=OFF -DSOURCE_WLPROTO=ON
-- The C compiler identification is Clang 3.8.1
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Could NOT find chck (missing:  CHCK_LIBRARIES CHCK_INCLUDE_DIRS) 
Adding chck as subdirectory
-- Performing Test has_fstack_protector_strong
-- Performing Test has_fstack_protector_strong - Success
-- Performing Test ok
-- Performing Test ok - Success
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Could NOT find valgrind (missing:  VALGRIND_INCLUDE_DIRS) 
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Found MATH: /usr/lib64/libm.so  
-- Found WAYLAND_CLIENT: /usr/lib64/libwayland-client.so  
-- Found WAYLAND_SERVER: /usr/lib64/libwayland-server.so  
-- Found WAYLAND_EGL: /usr/lib64/libwayland-egl.so  
-- Found WAYLAND: /usr/lib64/libwayland-client.so;/usr/lib64/libwayland-server.so;/usr/lib64/libwayland-egl.so  
-- Found PIXMAN: /usr/lib64/libpixman-1.so  
-- Found XKBCOMMON: /usr/lib64/libxkbcommon.so  
-- Found UDEV: /usr/include  
-- Found LIBINPUT: /usr/include  
-- Found X11: /usr/lib64/libX11.so;/usr/lib64/libX11-xcb.so;/usr/lib64/libXfixes.so  
-- Found XCB: /usr/lib64/libxcb.so;/usr/lib64/libxcb-ewmh.so;/usr/lib64/libxcb-composite.so;/usr/lib64/libxcb-xkb.so;XCB_LIBRARIES_xcb-image-NOTFOUND;/usr/lib64/libxcb-xfixes.so  
-- Found GLESv2: /usr/lib64/libGLESv2.so  
-- Found EGL: /usr/lib64/libEGL.so  
-- Found DRM: /usr/include/libdrm  
-- Found GBM: /usr/include  
-- Found DBUS: /usr/include/dbus-1.0;/usr/lib64/dbus-1.0/include  
-- Found SYSTEMD: /usr/include  
-- Looking for mkostemp
-- Looking for mkostemp - found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - found
-- Found wlproto: /usr/share/wayland-protocols  
-- 
-- The following features have been enabled:

 * Static , Compile as static library
 * Examples , Compile example programs
 * wayland-protocols/unstable/xdg-shell/xdg-shell-unstable-v5 , Protocol extension

-- The following OPTIONAL packages have been found:

 * ZLIB
   Enables compression support
 * Threads
   Enables threading support
 * PkgConfig

-- The following RECOMMENDED packages have been found:

 * X11 , Open source implementation of the X Window System , <http://www.x.org/>
   Enables X11 backend
 * XCB , X protocol C-language Binding , <http://xcb.freedesktop.org/>
   Enables Xwayland and X11 backend
 * Dbus , Message bus system , <http://www.freedesktop.org/wiki/Software/dbus/>
   Enables logind support
 * Systemd , System and Service Manager , <http://freedesktop.org/wiki/Software/systemd/>
   Enables logind support

-- The following REQUIRED packages have been found:

 * Math , Standard C math library
 * Wayland , Protocol for implementing compositors , <http://wayland.freedesktop.org/>
 * Pixman , Low-level software library for pixel manipulation , <http://pixman.org/>
 * XKBCommon , Library to handle keyboard descriptions , <http://xkbcommon.org/>
 * Udev , Device manager for the Linux kernel , <https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html>
 * LibInput , Library to handle input devices , <http://freedesktop.org/wiki/Software/libinput/>
 * GLESv2 , The Standard for Embedded Accelerated 3D Graphics , <https://www.khronos.org/opengles/>
   Enables OpenGL renderer
 * EGL , Native Platform Interface , <http://www.khronos.org/egl/>
   Enables EGL context
 * DRM , Kernel module that gives direct hardware access to DRI clients , <http://dri.freedesktop.org/>
   Enables DRM backend
 * GBM , Generic buffer manager , <http://www.mesa3d.org/>
   Enables DRM backend

-- The following features have been disabled:

 * Tests , Compile tests
 * Static , Compile as static library

-- The following OPTIONAL packages have not been found:

 * Valgrind
 * Doxygen
   Enables documentation
 * WaylandProtocols

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
XCB_LIBRARIES_xcb-image (ADVANCED)
    linked by target "wlc-tests" in directory /home/omv/wlc/BUILD/wlc-0.0.2/src
    linked by target "wlc" in directory /home/omv/wlc/BUILD/wlc-0.0.2/src

-- Configuring incomplete, errors occurred!
See also "/home/omv/wlc/BUILD/wlc-0.0.2/build/CMakeFiles/CMakeOutput.log".
See also "/home/omv/wlc/BUILD/wlc-0.0.2/build/CMakeFiles/CMakeError.log".
/home/omv/wlc/BUILD/wlc-0.0.2/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8: error: undefined reference to 'pthread_create'
clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/cmTC_caa70.dir/build.make:97: recipe for target 'cmTC_caa70' failed
gmake[1]: *** [cmTC_caa70] Error 1
gmake[1]: Leaving directory '/home/omv/wlc/BUILD/wlc-0.0.2/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_caa70/fast' failed
gmake: *** [cmTC_caa70/fast] Error 2

File /home/omv/wlc/BUILD/wlc-0.0.2/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
ddevault commented 8 years ago

The first one appears to be due to something wrong with your system, either XCB is missing or your distro has packaged it poorly. The second error is more interesting, though after some googling I'm guessing it's the same story.

Cloudef commented 8 years ago

xcb-image is not found on your system, second can be ignored it's just that cmake is confusing and puts non fatal errors in the logs.

fedya commented 8 years ago

Yeah, i installed xcb-image and issue gone.