Skip to content

Commit

Permalink
Remove the no-JIT build mode as well as anything specific to LLVM/clang.
Browse files Browse the repository at this point in the history
All we need now is a C++17 compiler.
  • Loading branch information
rsmmr committed Jan 14, 2021
1 parent 5011f56 commit bff62a3
Show file tree
Hide file tree
Showing 41 changed files with 108 additions and 542 deletions.
32 changes: 1 addition & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,24 +161,13 @@ require_version("Bison" BISON_FOUND BISON_VERSION "${bison_minimum_version}" tru
find_package(GoldLinker)
find_package(Threads)

find_package(ClangJIT)
find_package(Zeek)

if ( NOT CLANG_JIT_FOUND )
set(HILTI_HAVE_JIT no)
endif ()

if ( NOT HILTI_HAVE_JIT )
set(ZEEK_HAVE_JIT no)
set(HILTI_HAVE_JIT no)
endif ()

if ( ZEEK_FOUND )
set(HAVE_ZEEK yes)
else ()
set(HAVE_ZEEK no)
set(BUILD_ZEEK_PLUGIN no)
set(ZEEK_HAVE_JIT no)
endif ()

option(BUILD_TOOLCHAIN "Build the spicy compiler toolchain" ON)
Expand All @@ -187,7 +176,6 @@ if ( BUILD_TOOLCHAIN )
set(HAVE_TOOLCHAIN yes)
else ()
set(HAVE_TOOLCHAIN no)
set(ZEEK_HAVE_JIT no)
endif ()

if ( BUILD_ZEEK_PLUGIN )
Expand Down Expand Up @@ -221,11 +209,6 @@ string(STRIP "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}" cxxflags)
add_custom_target(check COMMAND ctest --output-on-failure -C $<CONFIG> DEPENDS tests)
add_custom_target(tests DEPENDS hilti-tests spicy-tests)

if ( NOT CLANG_RESOURCE_DIR )
# Just for display.
set(CLANG_RESOURCE_DIR "n/a")
endif ()

execute_process(COMMAND ${PROJECT_SOURCE_DIR}/scripts/autogen-version
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand All @@ -247,32 +230,19 @@ message(
"\nBuilding toolchain: ${HAVE_TOOLCHAIN}"
"\nBuilding Zeek plugin: ${HAVE_ZEEK_PLUGIN}"
"\n"
"\nJIT enabled: ${HILTI_HAVE_JIT}"
"\nZeek JIT enabled: ${ZEEK_HAVE_JIT}"
"\nZeek plugin install: ${ZEEK_INSTALL_PLUGIN}"
"\n"
"\nUse ccache: ${USE_CCACHE}"
"\nUse gold linker: ${GOLD_FOUND}"
"\nUse sanitizers: ${HILTI_HAVE_SANITIZER}"
"\nUse backtrace: ${HILTI_HAVE_BACKTRACE}"
"\n"
"\nClang/LLVM found: ${CLANG_JIT_FOUND}"
"\nClang version: ${CLANG_VERSION}"
"\nLLVM version: ${LLVM_VERSION}"
"\nLLVM prefix: ${LLVM_ROOT}"
"\nClang prefix: ${CLANG_ROOT}"
"\nClang executable: ${CLANG_EXECUTABLE}"
"\nClang resource dir: ${CLANG_RESOURCE_DIR}"
"\nC sys include dirs: ${C_SYSTEM_INCLUDE_DIRS}"
"\nC++ sys include dirs: ${CXX_SYSTEM_INCLUDE_DIRS}"
"\nClang gcc tolchain: ${CLANG_GCC_INSTALLATION}"
"\nWarnings are errors: ${USE_WERROR}"
"\nPrecompile headers: ${HILTI_DEV_PRECOMPILE_HEADERS}"
"\n"
"\nZeek found: ${HAVE_ZEEK}"
"\nZeek version: ${ZEEK_VERSION} (${ZEEK_VERSION_NUMBER})"
"\nZeek debug build: ${ZEEK_DEBUG_BUILD}"
"\nZeek root dir: ${ZEEK_PREFIX}"
"\nZeek plugin install: ${ZEEK_INSTALL_PLUGIN}"
"\n"
"\nBison version: ${BISON_VERSION}"
"\nCMake version: ${CMAKE_VERSION}"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ code that exposes an API to host applications for instantiating
parsers, feeding them input, and retrieving their results. At runtime,
parsing proceeds fully incrementally—and potentially highly
concurrently—on input streams of arbitrary size. Compilation of Spicy
parsers takes place either just-in-time at startup (through
Clang/LLVM), or ahead-of-time either by creating pre-compiled shared
parsers takes place either just-in-time at startup (through a C++
compiler), or ahead-of-time either by creating pre-compiled shared
libraries or simply by giving you C++ code that you can link into your
application.

Expand Down
177 changes: 0 additions & 177 deletions cmake/FindClangJIT.cmake

This file was deleted.

18 changes: 0 additions & 18 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ cmake_build_toolchain="yes"
cmake_build_type="RelWithDebInfo"
cmake_build_zeek_plugin="yes"
cmake_c_compiler=""
cmake_clang_resource_dir=""
cmake_clang_root=""
cmake_cxx_compiler=""
cmake_flex_root=""
cmake_generator=""
cmake_hilti_have_jit="yes"
cmake_install_prefix="/usr/local"
cmake_llvm_root=""
cmake_use_ccache="no"
cmake_use_gold="yes"
cmake_use_precompiled_headers="yes"
Expand Down Expand Up @@ -61,8 +58,6 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--build-toolchain={yes,no} Build the Spicy compiler toolchain [default: ${cmake_build_toolchain}]
--build-type=TYPE Set build type (Debug,Release,RelWithDebInfo) [default: ${cmake_build_type}]
--build-zeek-plugin={yes,no} Build the the Spicy plugin for Zeek [default: ${cmake_build_zeek_plugin}]
--disable-jit Do not compile in support for JIT compilation
--disable-jit-for-zeek Do not compile support for JIT compilation into Zeek plugin
--disable-gold On Linux, do not try to use the gold linker
--disable-precompiled-headers Disable use of precompiled headers for developer tests
--disable-zeek-plugin-install Do not copy Zeek plugin into Zeek plugin path on install
Expand All @@ -73,12 +68,9 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--generator=<generator> CMake generator to use (see cmake --help)
--prefix=PATH Installation prefix [default: ${cmake_install_prefix}]
--with-bison=<prefix> Set prefix of Bison installation
--with-clang-root=<prefix> Set prefix of Clang installation
--with-c-compiler=<path> Set C compiler to use
--with-cxx-compiler=<path> Set C++ compiler to use
--with-flex=<prefix> Set prefix of Flex installation
--with-clang-resource-dir=<path> Set resource directory to use with clang during JIT
--with-llvm-root=<prefix> Set prefix of LLVM installation
--with-zeek=PATH Path to Zeek installation [default: ${cmake_zeek_root_dir}]
--display-cmake Don't create build configuration, just output final CMake invocation
Expand Down Expand Up @@ -133,7 +125,6 @@ while [ $# -ne 0 ]; do
--enable-werror) cmake_use_werror="yes";;
--generator=*) cmake_generator="${optarg}";;
--prefix=*) cmake_install_prefix="${optarg}";;
--with-clang-root=*) cmake_clang_root="${optarg}";;
--with-c-compiler=*) cmake_c_compiler="${optarg}";;
--with-cxx-compiler=*)
cmake_cxx_compiler="${optarg}"
Expand All @@ -144,15 +135,11 @@ while [ $# -ne 0 ]; do
fi
;;

--with-clang-resource-dir=*) cmake_clang_resource_dir="${optarg}";;
--with-flex=*) cmake_flex_root="${optarg}";;
--with-bison=*) cmake_bison_root="${optarg}";;
--with-llvm-root=*) cmake_llvm_root="${optarg}";;
--with-zeek=*) cmake_zeek_root_dir="${optarg}";;
--without-bison=*) cmake_bison_root="";;
--without-clang-root=*) cmake_clang_root=""; cmake_hilti_have_jit="no";;
--without-flex=*) cmake_flex_root="";;
--without-llvm-root=*) cmake_llvm_root=""; cmake_hilti_have_jit="no";;
--without-zeek) cmake_zeek_root_dir="";;

--display-cmake) display_cmake=1;;
Expand All @@ -168,17 +155,12 @@ append_cache_entry BISON_ROOT PATH "${cmake_bison_root}"
append_cache_entry BUILD_SHARED_LIBS BOOL "${cmake_build_shared_libs}"
append_cache_entry BUILD_TOOLCHAIN BOOL "${cmake_build_toolchain}"
append_cache_entry BUILD_ZEEK_PLUGIN BOOL "${cmake_build_zeek_plugin}"
append_cache_entry CLANG_ROOT PATH "${cmake_clang_root}"
append_cache_entry CMAKE_BUILD_TYPE STRING "${cmake_build_type}"
append_cache_entry CMAKE_C_COMPILER PATH "${cmake_c_compiler}"
append_cache_entry CMAKE_CXX_COMPILER PATH "${cmake_cxx_compiler}"
append_cache_entry CLANG_RESOURCE_DIR PATH "${cmake_clang_resource_dir}"
append_cache_entry CMAKE_INSTALL_PREFIX PATH "${cmake_install_prefix}"
append_cache_entry FLEX_ROOT PATH "${cmake_flex_root}"
append_cache_entry HILTI_HAVE_JIT BOOL "${cmake_hilti_have_jit}"
append_cache_entry ZEEK_HAVE_JIT BOOL "${cmake_zeek_have_jit}"
append_cache_entry ZEEK_INSTALL_PLUGIN BOOL "${cmake_zeek_install_plugin}"
append_cache_entry LLVM_ROOT PATH "${cmake_llvm_root}"
append_cache_entry USE_CCACHE BOOL "${cmake_use_ccache}"
append_cache_entry USE_GOLD BOOL "${cmake_use_gold}"
append_cache_entry USE_SANITIZERS STRING "${cmake_use_sanitizers}"
Expand Down
1 change: 0 additions & 1 deletion hilti/runtime/include/3rdparty/libaco

This file was deleted.

1 change: 0 additions & 1 deletion hilti/runtime/include/3rdparty/libtask

This file was deleted.

4 changes: 3 additions & 1 deletion hilti/toolchain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ set_property(TARGET hilti-objects PROPERTY POSITION_INDEPENDENT_CODE ON)
add_dependencies(hilti-objects version)
target_compile_options(hilti-objects PRIVATE "-Wall")
target_compile_options(hilti-objects PRIVATE $<$<CONFIG:Debug>:-O0>)
target_link_libraries(hilti-objects PUBLIC $<$<BOOL:${HILTI_HAVE_JIT}>:clang-jit>)
target_link_libraries(hilti-objects PUBLIC $<IF:$<CONFIG:Debug>,hilti-rt-debug-objects,hilti-rt-objects>)
target_link_libraries(hilti-objects PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})

Expand All @@ -140,7 +139,10 @@ set_target_properties(hilti-objects PROPERTIES NO_SYSTEM_FROM_IMPORTED true)

add_library(hilti)
target_link_libraries(hilti PUBLIC hilti-objects)
<<<<<<< HEAD
target_link_libraries(hilti PUBLIC $<IF:$<CONFIG:Debug>,hilti-rt-debug-objects,hilti-rt-objects>) # doesn't transfer from hilti-objects
=======
>>>>>>> 9e3e3a04... Remove the no-JIT build mode as well as anything specific to LLVM/clang.

# TODO: The generator expression doesn't work for some reason, even though it
# does elswhere. Not sure why?
Expand Down
7 changes: 0 additions & 7 deletions hilti/toolchain/bin/hilti-config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <hilti/autogen/config.h>
#include <hilti/base/util.h>
#include <hilti/compiler/jit.h>

using namespace std;

Expand All @@ -31,7 +30,6 @@ Available options:
--help Print this usage summary
--hiltic Print the full path to the hiltic binary.
--include-dirs Prints the HILTI runtime's C++ include directories
--jit-support Prints 'yes' if compiled with JIT support, 'no' otherwise.
--ldflags Print linker flags when linking code using the HILTI runtime library
--libdirs Print standard HILTI library directories.
--prefix Print path of installation.
Expand Down Expand Up @@ -107,11 +105,6 @@ int main(int argc, char** argv) {
continue;
}

if ( opt == "--jit-support" ) {
result.emplace_back((hilti::configuration().jit_enabled ? "yes" : "no"));
continue;
}

if ( opt == "--toolchain" ) {
#ifdef HAVE_TOOLCHAIN
result.emplace_back("yes");
Expand Down
Loading

0 comments on commit bff62a3

Please sign in to comment.