The recent version of darwin linker ld64 emits an warning about
deprecation of the -no_pie flag. Further, the new darwin linker
ld-prime ignores -no_pie flag and generates a PIE binary anyway.
Switch to building PIE binaries by default.
Updates #54482.
Updates #61229.
Change-Id: I81294dcd07a368a20e1349d56556ee2fdcb8df44
Reviewed-on: https://go-review.googlesource.com/c/go/+/461697
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !windows && !static && (!darwin || (!internal_pie && !arm64))
+//go:build !windows && !static && !(darwin && internal)
#include <stdint.h>
#include <dlfcn.h>
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !windows && !static && (!darwin || (!internal_pie && !arm64))
+//go:build !windows && !static && !(darwin && internal)
-// Excluded in darwin internal linking PIE mode, as dynamic export is not
-// supported.
-// Excluded in internal linking mode on darwin/arm64, as it is always PIE.
+// Excluded in darwin internal linking PIE (which is the default) mode,
+// as dynamic export is not supported.
package cgotest
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build windows || static || (darwin && internal_pie) || (darwin && arm64)
+//go:build windows || static || (darwin && internal)
package cgotest
}
return true
case "darwin":
- return goarch == "arm64"
+ return true
}
return false
}