From 254dc5fdbee675ca7c85f7b76247313b7b356dee Mon Sep 17 00:00:00 2001 From: Carl Shapiro Date: Tue, 8 Oct 2013 10:40:51 -0700 Subject: [PATCH] cmd/go, runtime: express armv5t architecture constraint differently Instead of adding an -march=armv5t flag to the gcc command line, the same effect is obtained with an ".arch armv5t" pseudo op in the assembly file that uses armv5t instructions. R=golang-dev, iant, dave CC=golang-dev https://golang.org/cl/14511044 --- src/cmd/go/build.go | 2 +- src/pkg/runtime/cgo/gcc_arm.S | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index cfbf30d918..2ce968a46d 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -1903,7 +1903,7 @@ func (b *builder) gccArchArgs() []string { case "6": return []string{"-m64"} case "5": - return []string{"-marm", "-march=armv5t"} // not thumb + return []string{"-marm"} // not thumb } return nil } diff --git a/src/pkg/runtime/cgo/gcc_arm.S b/src/pkg/runtime/cgo/gcc_arm.S index cfe899b1d2..17e98d91f6 100644 --- a/src/pkg/runtime/cgo/gcc_arm.S +++ b/src/pkg/runtime/cgo/gcc_arm.S @@ -11,6 +11,13 @@ #define EXT(s) s #endif +/* + * Because the assembler might target an earlier revision of the ISA + * by default, we must explicitly specify the ISA revision to ensure + * BLX is recognized as a valid instruction. + */ +.arch armv5t + /* * void crosscall_arm2(void (*fn)(void), void (*setmg_gcc)(void *m, void *g), void *m, void *g) * -- 2.50.0