mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
compiler: emit non-PIE executables
This fixes a problem on baremetal targets, where PIE doesn't make any sense. Specifically, on ARM, the compiler sometimes inserted GOT pointers for linker-defined globals.
This commit is contained in:
@@ -25,10 +25,11 @@ type TargetSpec struct {
|
||||
// Load a target specification
|
||||
func LoadTarget(target string) (*TargetSpec, error) {
|
||||
spec := &TargetSpec{
|
||||
Triple: target,
|
||||
BuildTags: []string{runtime.GOOS, runtime.GOARCH},
|
||||
Linker: "cc",
|
||||
Objcopy: "objcopy",
|
||||
Triple: target,
|
||||
BuildTags: []string{runtime.GOOS, runtime.GOARCH},
|
||||
Linker: "cc",
|
||||
PreLinkArgs: []string{"-no-pie"}, // WARNING: clang < 5.0 requires -nopie
|
||||
Objcopy: "objcopy",
|
||||
}
|
||||
|
||||
// See whether there is a target specification for this target (e.g.
|
||||
|
||||
Reference in New Issue
Block a user