From b7394b22fd7ba13345b792b2d028461b457efbb4 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Fri, 27 Nov 2015 04:46:46 +0000 Subject: [PATCH] [llgo] Force exporting __morestack from llgoi Summary: Force exporting __morestack from llgoi, so that the symbol is available to the execution engine when linking with libLLVM.so. The engine does not reference __morestack explicitly, so must be provided by the host program. Reviewers: pcc Subscribers: axw, llvm-commits Differential Revision: http://reviews.llvm.org/D12625 llvm-svn: 254188 --- llgo/cmd/llgoi/llgoi.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llgo/cmd/llgoi/llgoi.go b/llgo/cmd/llgoi/llgoi.go index e6e021be233e..401e8f34df27 100644 --- a/llgo/cmd/llgoi/llgoi.go +++ b/llgo/cmd/llgoi/llgoi.go @@ -38,6 +38,12 @@ import ( "llvm.org/llvm/bindings/go/llvm" ) +// /* Force exporting __morestack if it's available, so that it is +// available to the engine when linking with libLLVM.so. */ +// +// void *__morestack __attribute__((weak)); +import "C" + func getInstPrefix() (string, error) { path, err := exec.LookPath(os.Args[0]) if err != nil {