Browse Source

Remove versioned build json files

Build tool falls back to unversioned file if versioned json file doesn't exist.  Can still specify a versioned one if needed.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>
Graham MacDonald 5 months ago
parent
commit
135360ea16

+ 0 - 7
amd64/clang-3.4.json

@@ -1,7 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-		]
-	}
-]

+ 0 - 7
amd64/clang-3.5.json

@@ -1,7 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-		]
-	}
-]

+ 0 - 7
amd64/clang-3.6.json

@@ -1,7 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-		]
-	}
-]

+ 0 - 7
amd64/clang-3.7.json

@@ -1,7 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-		]
-	}
-]

+ 0 - 7
amd64/clang-3.8.json

@@ -1,7 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-		]
-	}
-]

+ 0 - 7
amd64/clang-3.9.json

@@ -1,7 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-		]
-	}
-]

+ 0 - 7
amd64/clang-4.0.json

@@ -1,7 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-		]
-	}
-]

+ 0 - 7
amd64/clang-6.0.json

@@ -1,7 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-		]
-	}
-]

+ 0 - 10
amd64/gcc-4.8.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 10
amd64/gcc-5.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 10
amd64/gcc-6.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 10
amd64/gcc-7.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 10
amd64/gcc-8.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 21
sys/src/9/amd64/FIX.sed

@@ -1,21 +0,0 @@
-#!/bin/sh
-#sed -i 's/nil/NULL/g' $1
-
-# stuff I'm not smart enough to do with spatch
-
-# spatch can't do this yet -- we've talked to them.
-sed -i 's/struct ipifc\*,/struct ipifc *unused_ipifc,/' $1
-sed -i 's/(struct ipifc\*)/(struct ipifc *unused_ipifc)/' $1
-sed -i 's/ *uint8_t,/ uint8_t unused_uint8_t,/' $1
-sed -i 's/ *uint8_t\*,/ uint8_t *unused_uint8_p_t,/' $1
-sed -i 's/ *uint8_t)/ uint8_t unused_uint8_t)/' $1
-sed -i 's/ *uint8_t\*,/ uint8_t *unused_uint8_p_t,/' $1
-sed -i 's/ *void\*,/ void *unused_voidp,/' $1
-sed -i 's/ *uint8_t)/ uint8_t unused_uint8_t)/' $1
-sed -i 's/ *uint8_t\*)/ uint8_t *unused_uint8_p_t)/' $1
-sed -i 's/ *void\*)/ void *unused_voidp)/' $1
-sed -i 's/ *char\*\([,)]\)/ char *unused_char_p_t\1/' $1
-sed -i 's/ *char\*\*\([,)]\)/ char **unused_char_pp_t\1/' $1
-sed -i 's/ *int,/ int unused_int,/' $1
-sed -i '/USED(.*);/d' $1
-

+ 0 - 8
sys/src/9/amd64/clang-3.4.json

@@ -1,8 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-mno-implicit-float"
-		]
-	}
-]

+ 0 - 8
sys/src/9/amd64/clang-3.5.json

@@ -1,8 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-mno-implicit-float"
-		]
-	}
-]

+ 0 - 8
sys/src/9/amd64/clang-3.6.json

@@ -1,8 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-mno-implicit-float"
-		]
-	}
-]

+ 0 - 8
sys/src/9/amd64/clang-3.7.json

@@ -1,8 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-mno-implicit-float"
-		]
-	}
-]

+ 0 - 8
sys/src/9/amd64/clang-3.8.json

@@ -1,8 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-mno-implicit-float"
-		]
-	}
-]

+ 0 - 8
sys/src/9/amd64/clang-3.9.json

@@ -1,8 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-mno-implicit-float"
-		]
-	}
-]

+ 0 - 8
sys/src/9/amd64/clang-4.0.json

@@ -1,8 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-mno-implicit-float"
-		]
-	}
-]

+ 0 - 8
sys/src/9/amd64/clang-6.0.json

@@ -1,8 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-mno-implicit-float"
-		]
-	}
-]

+ 0 - 10
sys/src/9/amd64/gcc-4.8.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 10
sys/src/9/amd64/gcc-5.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 10
sys/src/9/amd64/gcc-6.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 10
sys/src/9/amd64/gcc-7.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 0 - 10
sys/src/9/amd64/gcc-8.json

@@ -1,10 +0,0 @@
-[
-	{
-		"Name": "buildflags",
-		"Cflags": [
-			"-fno-pie",
-			"-fvar-tracking",
-			"-fvar-tracking-assignments"
-		]
-	}
-]

+ 21 - 3
util/src/harvey/cmd/build/build.go

@@ -206,11 +206,29 @@ func adjust(s []string) []string {
 
 // return the given absolute path as an absolute path rooted at the harvey tree.
 func fromRoot(p string) string {
-	p = os.ExpandEnv(p)
+	expandedPath := os.ExpandEnv(p)
 	if path.IsAbs(p) {
-		return path.Join(harvey, p)
+		expandedPath = path.Join(harvey, expandedPath)
+	}
+
+	// Travis has versioned CCs of the form clang-X.Y.  We don't want to have
+	// a file for each version of the compilers, so check if the versioned
+	// file exists first.  If it doesn't, fall back to the unversioned file.
+	expandedCc := os.Getenv("CC")
+	expandedCcTokens := strings.Split(expandedCc, "-")
+	fallbackCc := expandedCcTokens[0]
+	if strings.Contains(expandedPath, "$CC") && len(expandedCcTokens) > 1 {
+		if _, err := os.Stat(expandedPath); err != nil {
+			if os.IsNotExist(err) {
+				oldCc := os.Getenv("CC")
+				os.Setenv("CC", fallbackCc)
+				expandedPath = fromRoot(p)
+				os.Setenv("CC", oldCc)
+			}
+		}
 	}
-	return p
+
+	return expandedPath
 }
 
 func include(f string, targ string, b *build) {