瀏覽代碼

revert 1b7770e271

Quotes are used on Apple target
variants to flag that we must
not add the _ symbol prefix.
Quentin Carbonneaux 1 年之前
父節點
當前提交
b24af7d3f7
共有 3 個文件被更改,包括 7 次插入3 次删除
  1. 5 1
      amd64/isel.c
  2. 1 1
      arm64/isel.c
  3. 1 1
      rv64/isel.c

+ 5 - 1
amd64/isel.c

@@ -88,7 +88,11 @@ fixarg(Ref *r, int k, Ins *i, Fn *fn)
 		memset(&a, 0, sizeof a);
 		a.offset.type = CAddr;
 		n = stashbits(&fn->con[r0.val].bits, KWIDE(k) ? 8 : 4);
-		sprintf(buf, "%sfp%d", T.asloc, n);
+		/* quote the name so that we do not
+		 * add symbol prefixes on the apple
+		 * target variant
+		 */
+		sprintf(buf, "\"%sfp%d\"", T.asloc, n);
 		a.offset.sym.id = intern(buf);
 		fn->mem[fn->nmem-1] = a;
 	}

+ 1 - 1
arm64/isel.c

@@ -112,7 +112,7 @@ fixarg(Ref *pr, int k, int phi, Fn *fn)
 			n = stashbits(&c->bits, KWIDE(k) ? 8 : 4);
 			vgrow(&fn->con, ++fn->ncon);
 			c = &fn->con[fn->ncon-1];
-			sprintf(buf, "%sfp%d", T.asloc, n);
+			sprintf(buf, "\"%sfp%d\"", T.asloc, n);
 			*c = (Con){.type = CAddr};
 			c->sym.id = intern(buf);
 			r2 = newtmp("isel", Kl, fn);

+ 1 - 1
rv64/isel.c

@@ -44,7 +44,7 @@ fixarg(Ref *r, int k, Ins *i, Fn *fn)
 			n = stashbits(&c->bits, KWIDE(k) ? 8 : 4);
 			vgrow(&fn->con, ++fn->ncon);
 			c = &fn->con[fn->ncon-1];
-			sprintf(buf, "%sfp%d", T.asloc, n);
+			sprintf(buf, "\"%sfp%d\"", T.asloc, n);
 			*c = (Con){.type = CAddr};
 			c->sym.id = intern(buf);
 			emit(Oload, k, r1, CON(c-fn->con), R);