Index: Makefile.config.in =================================================================== --- Makefile.config.in +++ Makefile.config.in @@ -39,8 +39,13 @@ # # We also disable all warnings, as these should be fixed upstream. There is # no value in reporting them here. +# +# ISL with activated small integer optimization use C99 extern inline +# semantics. In order to work, we need to enable C99 mode (instead the default +# -std=gnu89 in case of gcc) POLLY_CFLAGS := -fvisibility=hidden POLLY_CFLAGS += -w +POLLY_CFLAGS += -std=gnu99 CUDALIB_FOUND := @cuda_found@ Index: cmake/polly_macros.cmake =================================================================== --- cmake/polly_macros.cmake +++ cmake/polly_macros.cmake @@ -71,3 +71,13 @@ LINK_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress") endif() endmacro(add_polly_loadable_module) + +# # Use C99-compatible compile mode for all C source files of a target. +function(target_enable_c99 _target) + if(CMAKE_VERSION VERSION_GREATER "3.1") + set_target_properties("${_target}" PROPERTIES C_STANDARD 99) + elseif(CMAKE_COMPILER_IS_GNUCC) + get_target_property(_sources "${_target}" SOURCES) + set_source_files_properties(${_sources} COMPILE_FLAGS "-std=gnu99") + endif() +endfunction() Index: lib/CMakeLists.txt =================================================================== --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -189,6 +189,9 @@ ${ISL_FILES} ) +# ISL requires at least C99 to compile. gcc < 5.0 use -std=gnu89 as default. +target_enable_c99(Polly) + if (BUILD_SHARED_LIBS) target_link_libraries(Polly LLVMSupport