mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Revert "Remove hard-coded paths in Interpreters/Compiler.cpp"
This reverts commit 3a97fbd0e7
.
This commit is contained in:
parent
f630e4b0a6
commit
996eafada9
1
.gitignore
vendored
1
.gitignore
vendored
@ -187,7 +187,6 @@ debian/files
|
||||
dbms/src/Server/data/*
|
||||
dbms/src/Server/metadata/*
|
||||
dbms/src/Server/status
|
||||
dbms/src/Interpreters/CompilerIncludes.h
|
||||
config-9001.xml
|
||||
|
||||
*-preprocessed.xml
|
||||
|
@ -79,13 +79,6 @@ if (USE_STATIC_LIBRARIES)
|
||||
list(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
endif ()
|
||||
|
||||
# Don't skip the full RPATH for the build tree to get working binaries
|
||||
# without running `make install`.
|
||||
set (CMAKE_SKIP_BUILD_RPATH OFF)
|
||||
|
||||
# The RPATH to be used when installing
|
||||
set (CMAKE_INSTALL_RPATH "")
|
||||
|
||||
if (CMAKE_LIBRARY_ARCHITECTURE MATCHES "amd64.*|x86_64.*|AMD64.*")
|
||||
option (USE_INTERNAL_MEMCPY "Use internal implementation of 'memcpy' function instead of provided by libc. Only for x86_64." ON)
|
||||
|
||||
|
@ -88,9 +88,6 @@ list (APPEND dbms_headers
|
||||
list (APPEND dbms_sources src/TableFunctions/TableFunctionFactory.cpp)
|
||||
list (APPEND dbms_headers src/TableFunctions/ITableFunction.h src/TableFunctions/TableFunctionFactory.h)
|
||||
|
||||
if (USE_EMBEDDED_COMPILER)
|
||||
list (APPEND dbms_headers ${CMAKE_CURRENT_SOURCE_DIR}/src/Interpreters/CompilerIncludes.h)
|
||||
endif ()
|
||||
|
||||
list(REMOVE_ITEM clickhouse_common_io_sources
|
||||
src/Common/StringUtils.cpp)
|
||||
|
@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Generates the list of -isystem includes from gcc or clang compiler
|
||||
# Usage: ./gen-includes.sh [COMPILER]
|
||||
#
|
||||
|
||||
# Set local to C to capture GCC's "search starts here" text in English
|
||||
export LANG=C
|
||||
export LC_ALL=C
|
||||
export LC_MESSAGES=C
|
||||
CC=$1 || cc
|
||||
if test -z "$CC"; then CC=cc; fi
|
||||
|
||||
echo "" | $CC -x c++ -E -Wp,-v - 2>&1|
|
||||
sed -n '/#include <...> search starts here:/,/End of search list./p' |
|
||||
sed -e '1d;$d' -e 's/^[ \t ]*/" -isystem /;s/$/"/'
|
@ -5,21 +5,12 @@ else ()
|
||||
set (PATH_SHARE "/usr/share" CACHE STRING "")
|
||||
endif ()
|
||||
|
||||
if (USE_EMBEDDED_COMPILER)
|
||||
# Generate CompilerIncludes.h which contains all
|
||||
# `-isystem` includes for bundled clickhouse-clang
|
||||
add_custom_command(OUTPUT CompilerIncludes.h
|
||||
COMMAND ${PROJECT_SOURCE_DIR}/dbms/scripts/gen-compiler-includes.sh
|
||||
${PROJECT_BINARY_DIR}/dbms/src/Server/clickhouse-clang
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/CompilerIncludes.h
|
||||
DEPENDS clickhouse-clang)
|
||||
endif ()
|
||||
|
||||
set (INTERNAL_COMPILER_EXECUTABLE "clickhouse-clang" CACHE STRING "")
|
||||
set (INTERNAL_LINKER_EXECUTABLE "clickhouse-lld" CACHE STRING "")
|
||||
set (INTERNAL_COMPILER_NO_WARNING OFF CACHE INTERNAL "")
|
||||
set (INTERNAL_COMPILER_HEADERS "${PATH_SHARE}/clickhouse/headers" CACHE STRING "")
|
||||
set (INTERNAL_COMPILER_HEADERS_ROOT "${INTERNAL_COMPILER_HEADERS}" CACHE STRING "")
|
||||
set (INTERNAL_COMPILER_CUSTOM_ROOT ON CACHE INTERNAL "")
|
||||
|
||||
set (INTERNAL_COMPILER_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} ${CXX_FLAGS_INTERNAL_COMPILER} -x c++ -march=native -fPIC -fvisibility=hidden -fno-implement-inlines -nostdinc -nostdinc++ -Wno-unused-command-line-argument -Bprefix=${PATH_SHARE}/clickhouse -isysroot=${INTERNAL_COMPILER_HEADERS_ROOT}" CACHE STRING "")
|
||||
string(REPLACE "-no-pie" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS})
|
||||
|
@ -222,10 +222,23 @@ void Compiler::compile(
|
||||
INTERNAL_COMPILER_EXECUTABLE
|
||||
" " INTERNAL_COMPILER_FLAGS
|
||||
|
||||
#if USE_EMBEDDED_COMPILER
|
||||
/// Contains `echo "" | clickhouse-clang -x c++ -E -Wp,-v -`
|
||||
#include "CompilerIncludes.h"
|
||||
#endif /* USE_EMBEDDED_COMPILER */
|
||||
|
||||
#if INTERNAL_COMPILER_CUSTOM_ROOT
|
||||
/// To get correct order merge this results carefully:
|
||||
/// echo | clang -x c++ -E -Wp,-v -
|
||||
/// echo | g++ -x c++ -E -Wp,-v -
|
||||
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/include/c++/*"
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/include/" CMAKE_LIBRARY_ARCHITECTURE "/c++/*"
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/include/c++/*/backward"
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/include/clang/*/include" /// if compiler is clang (from package)
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/local/lib/clang/*/include" /// if clang installed manually
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/lib/gcc/" CMAKE_LIBRARY_ARCHITECTURE "/*/include-fixed"
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/lib/gcc/" CMAKE_LIBRARY_ARCHITECTURE "/*/include"
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/local/include" /// if something installed manually
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/include/" CMAKE_LIBRARY_ARCHITECTURE
|
||||
" -isystem " INTERNAL_COMPILER_HEADERS_ROOT "/usr/include"
|
||||
#endif
|
||||
" -I " INTERNAL_COMPILER_HEADERS "/dbms/src/"
|
||||
" -I " INTERNAL_COMPILER_HEADERS "/contrib/libcityhash/include/"
|
||||
" -I " INTERNAL_COMPILER_HEADERS "/contrib/libpcg-random/include/"
|
||||
|
@ -1,12 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#cmakedefine CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_LIBRARY_ARCHITECTURE@"
|
||||
#if !defined(CMAKE_LIBRARY_ARCHITECTURE)
|
||||
#define CMAKE_LIBRARY_ARCHITECTURE ""
|
||||
#endif
|
||||
#cmakedefine PATH_SHARE "@PATH_SHARE@"
|
||||
#cmakedefine INTERNAL_COMPILER_FLAGS "@INTERNAL_COMPILER_FLAGS@"
|
||||
#cmakedefine INTERNAL_COMPILER_EXECUTABLE "@INTERNAL_COMPILER_EXECUTABLE@"
|
||||
#cmakedefine INTERNAL_LINKER_EXECUTABLE "@INTERNAL_LINKER_EXECUTABLE@"
|
||||
#cmakedefine INTERNAL_COMPILER_HEADERS "@INTERNAL_COMPILER_HEADERS@"
|
||||
#cmakedefine INTERNAL_COMPILER_HEADERS_ROOT "@INTERNAL_COMPILER_HEADERS_ROOT@"
|
||||
#cmakedefine01 USE_EMBEDDED_COMPILER
|
||||
#cmakedefine01 INTERNAL_COMPILER_CUSTOM_ROOT
|
||||
#cmakedefine INTERNAL_DOUBLE_CONVERSION_INCLUDE_DIR "@INTERNAL_DOUBLE_CONVERSION_INCLUDE_DIR@"
|
||||
#cmakedefine INTERNAL_Poco_Foundation_INCLUDE_DIR "@INTERNAL_Poco_Foundation_INCLUDE_DIR@"
|
||||
#cmakedefine INTERNAL_Poco_Util_INCLUDE_DIR "@INTERNAL_Poco_Util_INCLUDE_DIR@"
|
||||
|
@ -46,10 +46,6 @@ target_link_libraries (clickhouse-format-lib clickhouse_common_io ${Boost_PROGRA
|
||||
if (USE_EMBEDDED_COMPILER)
|
||||
link_directories (${LLVM_LIBRARY_DIRS})
|
||||
add_subdirectory ("Compiler-${LLVM_VERSION}")
|
||||
# Link clickhouse-clang binary even if CLICKHOUSE_SPLIT_BINARY is OFF
|
||||
# in order to get system include paths for Interpreters/Compiler.cpp
|
||||
add_executable (clickhouse-clang clickhouse-clang.cpp)
|
||||
target_link_libraries (clickhouse-clang clickhouse-compiler-lib)
|
||||
endif ()
|
||||
|
||||
if (CLICKHOUSE_SPLIT_BINARY)
|
||||
@ -74,7 +70,8 @@ if (CLICKHOUSE_SPLIT_BINARY)
|
||||
set (CLICKHOUSE_ALL_TARGETS clickhouse-server clickhouse-client clickhouse-local clickhouse-benchmark clickhouse-performance-test clickhouse-extract-from-config clickhouse-format)
|
||||
|
||||
if (USE_EMBEDDED_COMPILER)
|
||||
# clickhouse-clang is linked above
|
||||
add_executable (clickhouse-clang clickhouse-clang.cpp)
|
||||
target_link_libraries (clickhouse-clang clickhouse-compiler-lib)
|
||||
add_executable (clickhouse-lld clickhouse-lld.cpp)
|
||||
target_link_libraries (clickhouse-lld clickhouse-compiler-lib)
|
||||
install (TARGETS clickhouse-clang clickhouse-lld RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
|
||||
|
Loading…
Reference in New Issue
Block a user