Skip to content

Commit e8f8873

Browse files
author
serge-sans-paille
committed
Rework go bindings so that validation works fine
Basically change the layout to please `go build` and remove references to `llvm-go`. Update llvm/test/Bindings/Go/ to use the system go compiler Differential Revision: https://reviews.llvm.org/D74540
1 parent 87c7730 commit e8f8873

32 files changed

+5
-34
lines changed

llvm/bindings/go/build.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

llvm/bindings/go/llvm/llvm_dep.go renamed to llvm/bindings/go/src/llvm/llvm_dep.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414
// +build !byollvm
1515

1616
package llvm
17-
18-
var _ run_build_sh
File renamed without changes.
File renamed without changes.

llvm/test/Bindings/Go/go.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
1+
; RUN: CGO_CPPFLAGS="`llvm-config --cppflags`" CGO_CXXFLAGS=-std=c++14 CGO_LDFLAGS="`llvm-config --ldflags --libs --system-libs all`" go test llvm
22

33
; REQUIRES: shell
44
; UNSUPPORTED: asan, ubsan, msan

llvm/test/Bindings/Go/lit.local.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ def fixup_compiler_path(compiler):
5757

5858
config.environment['CC'] = fixup_compiler_path(config.host_cc)
5959
config.environment['CXX'] = fixup_compiler_path(config.host_cxx)
60-
config.environment['CGO_LDFLAGS'] = config.host_ldflags
60+
config.environment['LD_LIBRARY_PATH'] = config.llvm_shlib_dir
61+
config.environment['GOPATH'] = os.path.join(config.llvm_src_root, 'bindings', 'go')

llvm/test/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def get_asan_rtlib():
160160

161161
# The following tools are optional
162162
tools.extend([
163-
ToolSubst('llvm-go', unresolved='ignore'),
163+
ToolSubst('go', unresolved='ignore'),
164164
ToolSubst('llvm-mt', unresolved='ignore'),
165165
ToolSubst('Kaleidoscope-Ch3', unresolved='ignore'),
166166
ToolSubst('Kaleidoscope-Ch4', unresolved='ignore'),

llvm/utils/lit/lit/llvm/subst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def resolve(self, config, dirs):
2323

2424
if self.name == 'llc' and os.environ.get('LLVM_ENABLE_MACHINE_VERIFIER') == '1':
2525
command += ' -verify-machineinstrs'
26-
elif self.name == 'llvm-go':
26+
elif self.name == 'go':
2727
exe = getattr(config.config, 'go_executable', None)
2828
if exe:
2929
command += ' go=' + exe

0 commit comments

Comments
 (0)