board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / webkitgtk / 0001-fix-gcc6-builds.patch
blob35487ad55a3c1b95c815638202771c84adc4f0a8
1 [CMake] Build failure with GCC 6 (fatal error: stdlib.h: No such file or directory)
3 https://bugs.webkit.org/show_bug.cgi?id=161697
5 Reviewed by Michael Catanzaro.
7 Get the list of system includes from GCC and add it to the CMake
8 list of implicit includes. This way, CMake will filter any of this
9 directories from the list of includes when calling the compiler.
11 This avoids an issue with GCC 6 that causes build failures when
12 including the default include path as a system include (-isystem).
14 Upstream, from: https://trac.webkit.org/changeset/205672
16 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
18 Index: trunk/Source/cmake/OptionsCommon.cmake
19 ===================================================================
20 --- trunk/Source/cmake/OptionsCommon.cmake (revision 204084)
21 +++ trunk/Source/cmake/OptionsCommon.cmake (revision 205672)
22 @@ -36,4 +36,31 @@
23 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
24 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
25 +endif ()
27 +# Ensure that the default include system directories are added to the list of CMake implicit includes.
28 +# This workarounds an issue that happens when using GCC 6 and using system includes (-isystem).
29 +# For more details check: https://bugs.webkit.org/show_bug.cgi?id=161697
30 +macro(DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _compiler _flags _result)
31 + file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n")
32 + separate_arguments(_buildFlags UNIX_COMMAND "${_flags}")
33 + execute_process(COMMAND ${_compiler} ${_buildFlags} -v -E -x ${_lang} -dD dummy
34 + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles OUTPUT_QUIET
35 + ERROR_VARIABLE _gccOutput)
36 + file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
37 + if ("${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list")
38 + set(${_result} ${CMAKE_MATCH_1})
39 + string(REPLACE "\n" " " ${_result} "${${_result}}")
40 + separate_arguments(${_result})
41 + endif ()
42 +endmacro()
44 +if (CMAKE_COMPILER_IS_GNUCC)
45 + DETERMINE_GCC_SYSTEM_INCLUDE_DIRS("c" "${CMAKE_C_COMPILER}" "${CMAKE_C_FLAGS}" SYSTEM_INCLUDE_DIRS)
46 + set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES} ${SYSTEM_INCLUDE_DIRS})
47 +endif ()
49 +if (CMAKE_COMPILER_IS_GNUCXX)
50 + DETERMINE_GCC_SYSTEM_INCLUDE_DIRS("c++" "${CMAKE_CXX_COMPILER}" "${CMAKE_CXX_FLAGS}" SYSTEM_INCLUDE_DIRS)
51 + set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${SYSTEM_INCLUDE_DIRS})
52 endif ()