forked from OSchip/llvm-project
Revert "Rework go bindings so that validation works fine"
And add llvm-go back to the test dependencies.
No longer necessary now that llvm-go has been brought back.
This reverts commit e8f8873da5
.
This commit is contained in:
parent
453d54865a
commit
0414c56940
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh -xe
|
||||
|
||||
gollvmdir=$(dirname "$0")/llvm
|
||||
|
||||
workdir=$gollvmdir/workdir
|
||||
llvmdir=$gollvmdir/../../..
|
||||
llvm_builddir=$workdir/llvm_build
|
||||
|
||||
mkdir -p $llvm_builddir
|
||||
|
||||
cmake_flags="../../../../.. $@"
|
||||
llvm_config="$llvm_builddir/bin/llvm-config"
|
||||
llvm_go="$llvm_builddir/bin/llvm-go"
|
||||
|
||||
if test -n "`which ninja`" ; then
|
||||
# If Ninja is available, we can speed up the build by building only the
|
||||
# required subset of LLVM.
|
||||
(cd $llvm_builddir && cmake -G Ninja $cmake_flags)
|
||||
ninja -C $llvm_builddir llvm-config llvm-go
|
||||
llvm_components="$($llvm_go print-components)"
|
||||
llvm_buildtargets="$($llvm_config --libs $llvm_components | sed -e 's/-l//g')"
|
||||
ninja -C $llvm_builddir $llvm_buildtargets FileCheck
|
||||
else
|
||||
(cd $llvm_builddir && cmake $cmake_flags)
|
||||
make -C $llvm_builddir -j4
|
||||
fi
|
||||
|
||||
$llvm_go print-config > $gollvmdir/llvm_config.go
|
|
@ -14,3 +14,5 @@
|
|||
// +build !byollvm
|
||||
|
||||
package llvm
|
||||
|
||||
var _ run_build_sh
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: CGO_CPPFLAGS="`llvm-config --cppflags`" CGO_CXXFLAGS=-std=c++14 CGO_LDFLAGS="`llvm-config --ldflags --libs --system-libs all`" go test llvm
|
||||
; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
|
||||
|
||||
; REQUIRES: shell
|
||||
; UNSUPPORTED: asan, ubsan, msan
|
||||
|
|
|
@ -57,5 +57,4 @@ def fixup_compiler_path(compiler):
|
|||
|
||||
config.environment['CC'] = fixup_compiler_path(config.host_cc)
|
||||
config.environment['CXX'] = fixup_compiler_path(config.host_cxx)
|
||||
config.environment['LD_LIBRARY_PATH'] = config.llvm_shlib_dir
|
||||
config.environment['GOPATH'] = os.path.join(config.llvm_src_root, 'bindings', 'go')
|
||||
config.environment['CGO_LDFLAGS'] = config.host_ldflags
|
||||
|
|
|
@ -122,6 +122,10 @@ if(TARGET LLVMgold)
|
|||
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()
|
||||
|
|
|
@ -160,7 +160,7 @@ tools.extend([
|
|||
|
||||
# The following tools are optional
|
||||
tools.extend([
|
||||
ToolSubst('go', unresolved='ignore'),
|
||||
ToolSubst('llvm-go', unresolved='ignore'),
|
||||
ToolSubst('llvm-mt', unresolved='ignore'),
|
||||
ToolSubst('Kaleidoscope-Ch3', unresolved='ignore'),
|
||||
ToolSubst('Kaleidoscope-Ch4', unresolved='ignore'),
|
||||
|
|
|
@ -23,7 +23,7 @@ class FindTool(object):
|
|||
|
||||
if self.name == 'llc' and os.environ.get('LLVM_ENABLE_MACHINE_VERIFIER') == '1':
|
||||
command += ' -verify-machineinstrs'
|
||||
elif self.name == 'go':
|
||||
elif self.name == 'llvm-go':
|
||||
exe = getattr(config.config, 'go_executable', None)
|
||||
if exe:
|
||||
command += ' go=' + exe
|
||||
|
|
Loading…
Reference in New Issue