diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-08-18 04:40:42 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-08-18 04:40:42 +0000 |
commit | c32bd276c68f5089b7e8ee58a8bc85c9bd543455 (patch) | |
tree | 4c2d75f13fdcf566821f79ee14f2bce76066f9a0 /libgo | |
parent | 091f25d75233c4ad11fdd1027351c25bdf0f2d0e (diff) | |
download | gcc-c32bd276c68f5089b7e8ee58a8bc85c9bd543455.zip gcc-c32bd276c68f5089b7e8ee58a8bc85c9bd543455.tar.gz gcc-c32bd276c68f5089b7e8ee58a8bc85c9bd543455.tar.bz2 |
cmd/go: pass -funwind-tables when compiling C code
Using -funwind-tables is necessary to permit Go code to correctly
throw a panic through C code. This hasn't been necessary in the past
as -funwind-tables is the default on x86. However, it is not the
default for PPC AIX.
Reviewed-on: https://go-review.googlesource.com/56650
From-SVN: r251179
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/cmd/go/build.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/build.go b/libgo/go/cmd/go/build.go index 9623b9c..a62bc86 100644 --- a/libgo/go/cmd/go/build.go +++ b/libgo/go/cmd/go/build.go @@ -3268,6 +3268,12 @@ func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string { a = append(a, "-fno-common") } + // gccgo uses the language-independent exception mechanism to + // handle panics, so it always needs unwind tables. + if _, ok := buildToolchain.(gccgoToolchain); ok { + a = append(a, "-funwind-tables") + } + return a } |