Source file src/runtime/cgo/cgo_c.go
1 // Copyright 2010 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build !goexperiment.runtimecgopurego || msan || tsan 6 7 package cgo 8 9 /* 10 11 #cgo darwin,!arm64 LDFLAGS: -lpthread 12 #cgo dragonfly LDFLAGS: -lpthread 13 #cgo freebsd LDFLAGS: -lpthread 14 #cgo android LDFLAGS: -llog 15 #cgo !android,linux LDFLAGS: -lpthread 16 #cgo netbsd LDFLAGS: -lpthread 17 #cgo openbsd LDFLAGS: -lpthread 18 #cgo aix LDFLAGS: -Wl,-berok 19 20 // Use -fno-stack-protector to avoid problems locating the 21 // proper support functions. See issues #52919, #54313, #58385. 22 // Use -Wdeclaration-after-statement because some CI builds use it. 23 #cgo CFLAGS: -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement 24 25 // Use -std=gnu90 to maintain portability; 26 // we don't use c90 because that doesn't permit C++ line comments, 27 // which is just too painful. 28 // We don't do it on windows-386 because it causes test failures. 29 #cgo (!windows||!386) CFLAGS: -std=gnu90 30 31 #cgo solaris CPPFLAGS: -D_POSIX_PTHREAD_SEMANTICS 32 33 */ 34 import "C" 35