Commit 5a2cf114 authored by Kirill Smelkov's avatar Kirill Smelkov

tracing/runtime: Fix build for Go1.12

This continues b46436bd (tracing/runtime: Try to add support for Go1.12):

Move `+build ...` constraint in assembly files to the top, as suggested
by Russ Cox:

	https://github.com/golang/go/issues/31410#issuecomment-482599134

Then go stops complaining about it.

The build constraint had no effect previously, but it was not caught
because getg is used only on race builds and I was testing on amd64
only, which is practically almost the only ISA supported by race
detector as of Go1.11 .
parent b46436bd
#include "textflag.h"
// +build 386 // +build 386
#include "textflag.h"
// func getg() *g // func getg() *g
TEXT ·getg(SB),NOSPLIT,$0-8 TEXT ·getg(SB),NOSPLIT,$0-8
MOVL (TLS), AX MOVL (TLS), AX
......
#include "textflag.h"
// +build amd64 amd64p // +build amd64 amd64p
#include "textflag.h"
// func getg() *g // func getg() *g
TEXT ·getg(SB),NOSPLIT,$0-8 TEXT ·getg(SB),NOSPLIT,$0-8
MOVQ (TLS), R14 MOVQ (TLS), R14
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment