aboutsummaryrefslogtreecommitdiffhomepage
path: root/compileopts/target.go
diff options
context:
space:
mode:
Diffstat (limited to 'compileopts/target.go')
-rw-r--r--compileopts/target.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/compileopts/target.go b/compileopts/target.go
index a84896c9b..df3b5d3ff 100644
--- a/compileopts/target.go
+++ b/compileopts/target.go
@@ -177,7 +177,10 @@ func LoadTarget(target string) (*TargetSpec, error) {
if llvmarch == "" {
llvmarch = goarch
}
- target = llvmarch + "--" + llvmos
+ // Target triples (which actually have four components, but are called
+ // triples for historical reasons) have the form:
+ // arch-vendor-os-environment
+ target = llvmarch + "-unknown-" + llvmos
if goarch == "arm" {
target += "-gnueabihf"
}
@@ -207,14 +210,6 @@ func LoadTarget(target string) (*TargetSpec, error) {
if len(tripleSplit) < 3 {
return nil, errors.New("expected a full LLVM target or a custom target in -target flag")
}
- if tripleSplit[0] == "arm" {
- // LLVM and Clang have a different idea of what "arm" means, so
- // upgrade to a slightly more modern ARM. In fact, when you pass
- // --target=arm--linux-gnueabihf to Clang, it will convert that
- // internally to armv7-unknown-linux-gnueabihf. Changing the
- // architecture to armv7 will keep things consistent.
- tripleSplit[0] = "armv7"
- }
goos := tripleSplit[2]
if strings.HasPrefix(goos, "darwin") {
goos = "darwin"
@@ -250,7 +245,6 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
Scheduler: "tasks",
Linker: "cc",
DefaultStackSize: 1024 * 64, // 64kB
- CFlags: []string{"--target=" + triple},
GDB: []string{"gdb"},
PortReset: "false",
}