[PATCH] D74540: Rework go bindings so that binding tests work fine
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 13 05:21:41 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe8f8873da5ea: Rework go bindings so that validation works fine (authored by serge-sans-paille).
Changed prior to commit:
https://reviews.llvm.org/D74540?vs=244382&id=244399#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74540/new/
https://reviews.llvm.org/D74540
Files:
llvm/bindings/go/build.sh
llvm/bindings/go/llvm/IRBindings.cpp
llvm/bindings/go/llvm/IRBindings.h
llvm/bindings/go/llvm/InstrumentationBindings.cpp
llvm/bindings/go/llvm/InstrumentationBindings.h
llvm/bindings/go/llvm/SupportBindings.cpp
llvm/bindings/go/llvm/SupportBindings.h
llvm/bindings/go/llvm/analysis.go
llvm/bindings/go/llvm/bitreader.go
llvm/bindings/go/llvm/bitwriter.go
llvm/bindings/go/llvm/dibuilder.go
llvm/bindings/go/llvm/executionengine.go
llvm/bindings/go/llvm/executionengine_test.go
llvm/bindings/go/llvm/ir.go
llvm/bindings/go/llvm/ir_test.go
llvm/bindings/go/llvm/linker.go
llvm/bindings/go/llvm/llvm_config.go.in
llvm/bindings/go/llvm/llvm_dep.go
llvm/bindings/go/llvm/string.go
llvm/bindings/go/llvm/string_test.go
llvm/bindings/go/llvm/support.go
llvm/bindings/go/llvm/target.go
llvm/bindings/go/llvm/transforms_coroutines.go
llvm/bindings/go/llvm/transforms_instrumentation.go
llvm/bindings/go/llvm/transforms_ipo.go
llvm/bindings/go/llvm/transforms_pmbuilder.go
llvm/bindings/go/llvm/transforms_scalar.go
llvm/bindings/go/llvm/version.go
llvm/bindings/go/src/llvm/IRBindings.cpp
llvm/bindings/go/src/llvm/IRBindings.h
llvm/bindings/go/src/llvm/InstrumentationBindings.cpp
llvm/bindings/go/src/llvm/InstrumentationBindings.h
llvm/bindings/go/src/llvm/SupportBindings.cpp
llvm/bindings/go/src/llvm/SupportBindings.h
llvm/bindings/go/src/llvm/analysis.go
llvm/bindings/go/src/llvm/bitreader.go
llvm/bindings/go/src/llvm/bitwriter.go
llvm/bindings/go/src/llvm/dibuilder.go
llvm/bindings/go/src/llvm/executionengine.go
llvm/bindings/go/src/llvm/executionengine_test.go
llvm/bindings/go/src/llvm/ir.go
llvm/bindings/go/src/llvm/ir_test.go
llvm/bindings/go/src/llvm/linker.go
llvm/bindings/go/src/llvm/llvm_config.go.in
llvm/bindings/go/src/llvm/llvm_dep.go
llvm/bindings/go/src/llvm/string.go
llvm/bindings/go/src/llvm/string_test.go
llvm/bindings/go/src/llvm/support.go
llvm/bindings/go/src/llvm/target.go
llvm/bindings/go/src/llvm/transforms_coroutines.go
llvm/bindings/go/src/llvm/transforms_instrumentation.go
llvm/bindings/go/src/llvm/transforms_ipo.go
llvm/bindings/go/src/llvm/transforms_pmbuilder.go
llvm/bindings/go/src/llvm/transforms_scalar.go
llvm/bindings/go/src/llvm/version.go
llvm/test/Bindings/Go/go.test
llvm/test/Bindings/Go/lit.local.cfg
llvm/test/lit.cfg.py
llvm/utils/lit/lit/llvm/subst.py
Index: llvm/utils/lit/lit/llvm/subst.py
===================================================================
--- llvm/utils/lit/lit/llvm/subst.py
+++ llvm/utils/lit/lit/llvm/subst.py
@@ -23,7 +23,7 @@
if self.name == 'llc' and os.environ.get('LLVM_ENABLE_MACHINE_VERIFIER') == '1':
command += ' -verify-machineinstrs'
- elif self.name == 'llvm-go':
+ elif self.name == 'go':
exe = getattr(config.config, 'go_executable', None)
if exe:
command += ' go=' + exe
Index: llvm/test/lit.cfg.py
===================================================================
--- llvm/test/lit.cfg.py
+++ llvm/test/lit.cfg.py
@@ -160,7 +160,7 @@
# The following tools are optional
tools.extend([
- ToolSubst('llvm-go', unresolved='ignore'),
+ ToolSubst('go', unresolved='ignore'),
ToolSubst('llvm-mt', unresolved='ignore'),
ToolSubst('Kaleidoscope-Ch3', unresolved='ignore'),
ToolSubst('Kaleidoscope-Ch4', unresolved='ignore'),
Index: llvm/test/Bindings/Go/lit.local.cfg
===================================================================
--- llvm/test/Bindings/Go/lit.local.cfg
+++ llvm/test/Bindings/Go/lit.local.cfg
@@ -57,4 +57,5 @@
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
+config.environment['LD_LIBRARY_PATH'] = config.llvm_shlib_dir
+config.environment['GOPATH'] = os.path.join(config.llvm_src_root, 'bindings', 'go')
Index: llvm/test/Bindings/Go/go.test
===================================================================
--- llvm/test/Bindings/Go/go.test
+++ llvm/test/Bindings/Go/go.test
@@ -1,4 +1,4 @@
-; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
+; RUN: CGO_CPPFLAGS="`llvm-config --cppflags`" CGO_CXXFLAGS=-std=c++14 CGO_LDFLAGS="`llvm-config --ldflags --libs --system-libs all`" go test llvm
; REQUIRES: shell
; UNSUPPORTED: asan, ubsan, msan
Index: llvm/bindings/go/src/llvm/llvm_dep.go
===================================================================
--- llvm/bindings/go/src/llvm/llvm_dep.go
+++ llvm/bindings/go/src/llvm/llvm_dep.go
@@ -14,5 +14,3 @@
// +build !byollvm
package llvm
-
-var _ run_build_sh
Index: llvm/bindings/go/build.sh
===================================================================
--- llvm/bindings/go/build.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74540.244399.patch
Type: text/x-patch
Size: 3295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200213/28ea48b9/attachment-0001.bin>
More information about the llvm-commits
mailing list