diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -520,7 +520,6 @@ option(LLVM_BUILD_TESTS "Build LLVM unit tests. If OFF, just generate build targets." OFF) option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON) -option(LLVM_INCLUDE_GO_TESTS "Include the Go bindings tests in test build targets." ON) option(LLVM_BUILD_BENCHMARKS "Add LLVM benchmark targets to the list of default targets. If OFF, benchmarks still could be built using Benchmarks target." OFF) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -541,24 +541,6 @@ message(STATUS "Doxygen disabled.") endif() -set(LLVM_BINDINGS "") -find_program(GO_EXECUTABLE NAMES go DOC "go executable") -if(WIN32 OR NOT LLVM_ENABLE_BINDINGS) - message(STATUS "Go bindings disabled.") -else() - if(GO_EXECUTABLE STREQUAL "GO_EXECUTABLE-NOTFOUND") - message(STATUS "Go bindings disabled.") - else() - execute_process(COMMAND ${GO_EXECUTABLE} run ${PROJECT_SOURCE_DIR}/bindings/go/conftest.go - RESULT_VARIABLE GO_CONFTEST) - if(GO_CONFTEST STREQUAL "0") - set(LLVM_BINDINGS "${LLVM_BINDINGS} go") - message(STATUS "Go bindings enabled.") - else() - message(STATUS "Go bindings disabled, need at least Go 1.2.") - endif() - endif() -endif() find_program(GOLD_EXECUTABLE NAMES ${LLVM_DEFAULT_TARGET_TRIPLE}-ld.gold ld.gold ${LLVM_DEFAULT_TARGET_TRIPLE}-ld ld DOC "The gold linker") set(LLVM_BINUTILS_INCDIR "" CACHE PATH @@ -597,6 +579,7 @@ endif() # Keep the version requirements in sync with bindings/ocaml/README.txt. +set(LLVM_BINDINGS "") include(FindOCaml) include(AddOCaml) if(WIN32 OR NOT LLVM_ENABLE_BINDINGS) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -1327,36 +1327,6 @@ target_link_libraries(${benchmark_name} PRIVATE benchmark) endfunction() -function(llvm_add_go_executable binary pkgpath) - cmake_parse_arguments(ARG "ALL" "" "DEPENDS;GOFLAGS" ${ARGN}) - - if(LLVM_BINDINGS MATCHES "go") - # FIXME: This should depend only on the libraries Go needs. - get_property(llvmlibs GLOBAL PROPERTY LLVM_LIBS) - set(binpath ${CMAKE_BINARY_DIR}/bin/${binary}${CMAKE_EXECUTABLE_SUFFIX}) - set(cc "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}") - set(cxx "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}") - set(cppflags "") - get_property(include_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES) - foreach(d ${include_dirs}) - set(cppflags "${cppflags} -I${d}") - endforeach(d) - set(ldflags "${CMAKE_EXE_LINKER_FLAGS}") - add_custom_command(OUTPUT ${binpath} - COMMAND ${CMAKE_BINARY_DIR}/bin/llvm-go "go=${GO_EXECUTABLE}" "cc=${cc}" "cxx=${cxx}" "cppflags=${cppflags}" "ldflags=${ldflags}" "packages=${LLVM_GO_PACKAGES}" - ${ARG_GOFLAGS} build -o ${binpath} ${pkgpath} - DEPENDS llvm-config ${CMAKE_BINARY_DIR}/bin/llvm-go${CMAKE_EXECUTABLE_SUFFIX} - ${llvmlibs} ${ARG_DEPENDS} - COMMENT "Building Go executable ${binary}" - VERBATIM) - if (ARG_ALL) - add_custom_target(${binary} ALL DEPENDS ${binpath}) - else() - add_custom_target(${binary} DEPENDS ${binpath}) - endif() - endif() -endfunction() - # This function canonicalize the CMake variables passed by names # from CMake boolean to 0/1 suitable for passing into Python or C++, # in place. diff --git a/llvm/test/Bindings/Go/go.test b/llvm/test/Bindings/Go/go.test deleted file mode 100644 --- a/llvm/test/Bindings/Go/go.test +++ /dev/null @@ -1,4 +0,0 @@ -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm - -; REQUIRES: shell -; UNSUPPORTED: asan, ubsan, msan diff --git a/llvm/test/Bindings/Go/lit.local.cfg b/llvm/test/Bindings/Go/lit.local.cfg deleted file mode 100644 --- a/llvm/test/Bindings/Go/lit.local.cfg +++ /dev/null @@ -1,60 +0,0 @@ -import os -import pipes -import shlex -import sys - -if not 'go' in config.root.llvm_bindings: - config.unsupported = True - -if not config.root.include_go_tests: - config.unsupported = True - -def find_executable(executable, path=None): - if path is None: - path = os.environ['PATH'] - paths = path.split(os.pathsep) - base, ext = os.path.splitext(executable) - - if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'): - executable = executable + '.exe' - - if not os.path.isfile(executable): - for p in paths: - f = os.path.join(p, executable) - if os.path.isfile(f): - return f - return None - else: - return executable - -# Resolve certain symlinks in the first word of compiler. -# -# This is a Go-specific hack. cgo and other Go tools check $CC and $CXX for the -# substring 'clang' to determine if the compiler is Clang. This won't work if -# $CC is cc and cc is a symlink pointing to clang, as it is on Darwin. -# -# Go tools also have problems with ccache, so we disable it. -def fixup_compiler_path(compiler): - args = shlex.split(compiler) - if args[0].endswith('ccache') or args[0].endswith('gomacc'): - args = args[1:] - - path = find_executable(args[0]) - - try: - if path.endswith('/cc') and os.readlink(path) == 'clang': - args[0] = path[:len(path)-2] + 'clang' - except (AttributeError, OSError): - pass - - try: - if path.endswith('/c++') and os.readlink(path) == 'clang++': - args[0] = path[:len(path)-3] + 'clang++' - except (AttributeError, OSError): - pass - - return ' '.join([pipes.quote(arg) for arg in args]) - -config.environment['CC'] = fixup_compiler_path(config.host_cc) -config.environment['CXX'] = fixup_compiler_path(config.host_cxx) -config.environment['CGO_LDFLAGS'] = config.host_ldflags diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt --- a/llvm/test/CMakeLists.txt +++ b/llvm/test/CMakeLists.txt @@ -7,7 +7,6 @@ LLVM_ENABLE_FFI LLVM_ENABLE_THREADS LLVM_ENABLE_ZLIB - LLVM_INCLUDE_GO_TESTS LLVM_LIBXML2_ENABLED LLVM_LINK_LLVM_DYLIB LLVM_TOOL_LTO_BUILD @@ -122,10 +121,6 @@ set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LLVMgold) endif() -if(TARGET llvm-go) - set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-go) -endif() - if(TARGET LTO) set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO) endif() diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py --- a/llvm/test/lit.cfg.py +++ b/llvm/test/lit.cfg.py @@ -132,7 +132,6 @@ tools = [ ToolSubst('%lli', FindTool('lli'), post='.', extra_args=lli_args), ToolSubst('%llc_dwarf', FindTool('llc'), extra_args=llc_args), - ToolSubst('%go', config.go_executable, unresolved='ignore'), ToolSubst('%gold', config.gold_executable, unresolved='ignore'), ToolSubst('%ld64', ld64_cmd, unresolved='ignore'), ToolSubst('%ocamlc', ocamlc_command, unresolved='ignore'), @@ -160,7 +159,6 @@ # The following tools are optional tools.extend([ - ToolSubst('llvm-go', unresolved='ignore'), ToolSubst('llvm-mt', unresolved='ignore'), ToolSubst('Kaleidoscope-Ch3', unresolved='ignore'), ToolSubst('Kaleidoscope-Ch4', unresolved='ignore'), diff --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in --- a/llvm/test/lit.site.cfg.py.in +++ b/llvm/test/lit.site.cfg.py.in @@ -19,8 +19,6 @@ config.have_ocamlopt = @HAVE_OCAMLOPT@ config.have_ocaml_ounit = @HAVE_OCAML_OUNIT@ config.ocaml_flags = "@OCAMLFLAGS@" -config.include_go_tests = @LLVM_INCLUDE_GO_TESTS@ -config.go_executable = "@GO_EXECUTABLE@" config.enable_shared = @ENABLE_SHARED@ config.enable_assertions = @ENABLE_ASSERTIONS@ config.targets_to_build = "@TARGETS_TO_BUILD@"