[PATCH] D75060: [test][go]Use -stdlib=libc++ to build GO binding test if LLVM is built with libc++

Xing Xue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 09:08:08 PST 2020


xingxue created this revision.
xingxue added reviewers: jasonliu, serge-sans-paille, teemperor, pcc, echristo.
xingxue added a project: LLVM.
Herald added a reviewer: EricWF.
Herald added subscribers: llvm-commits, ldionne.

The recent change in `go.test` causes the `GO` binding test to fail if `libc++` is used to build `LLVM`. When `LLVM` is built against `libc++`, `LLVM` libraries, including those used in `GO` binding test have dependencies on `libc++` and `C++` `STL` signatures in these libraries are corresponding to `libc++` implementation. Therefore, `-stdlib=libc++` is required on the `C++` compiler command for building `GO` binding test that links with these `LLVM` libraries. Fixed by using `--cxxflags` as part of the `CGO_CXXFLAGS` and `CGO_LDFLAGS` configuration. `--cxxflags` has `-srdlib=libc++` if `libc++` is used to build `LLVM`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75060

Files:
  llvm/test/Bindings/Go/go.test


Index: llvm/test/Bindings/Go/go.test
===================================================================
--- llvm/test/Bindings/Go/go.test
+++ llvm/test/Bindings/Go/go.test
@@ -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: CGO_CPPFLAGS="`llvm-config --cppflags`" CGO_CXXFLAGS="`llvm-config --cxxflags`" CGO_LDFLAGS="`llvm-config --cxxflags --ldflags --libs --system-libs all`" go test llvm
 
 ; REQUIRES: shell
 ; UNSUPPORTED: asan, ubsan, msan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75060.246225.patch
Type: text/x-patch
Size: 567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200224/2d806941/attachment.bin>


More information about the llvm-commits mailing list