]> Cypherpunks repositories - gostls13.git/commitdiff
5l: fix softfloat nits
authorRuss Cox <rsc@golang.org>
Thu, 9 Jun 2011 22:38:25 +0000 (18:38 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 9 Jun 2011 22:38:25 +0000 (18:38 -0400)
Need to load math.a so that sqrtGoC is available.
Also was missing prototype.

R=ken2
CC=golang-dev
https://golang.org/cl/4517148

src/cmd/ld/lib.c
src/pkg/runtime/arm/softfloat.c

index 208a84f1d2f38e53d50d493a20ab1b35de7e304c..04ee790a4e008e2e7382cf58575db88a7c5a222a 100644 (file)
@@ -235,24 +235,34 @@ addlibpath(char *srcref, char *objref, char *file, char *pkg)
 }
 
 void
-loadlib(void)
+loadinternal(char *name)
 {
        char pname[1024];
        int i, found;
 
        found = 0;
        for(i=0; i<nlibdir; i++) {
-               snprint(pname, sizeof pname, "%s/runtime.a", libdir[i]);
+               snprint(pname, sizeof pname, "%s/%s.a", libdir[i], name);
                if(debug['v'])
-                       Bprint(&bso, "searching for runtime.a in %s\n", pname);
+                       Bprint(&bso, "searching for %s.a in %s\n", name, pname);
                if(access(pname, AEXIST) >= 0) {
-                       addlibpath("internal", "internal", pname, "runtime");
+                       addlibpath("internal", "internal", pname, name);
                        found = 1;
                        break;
                }
        }
        if(!found)
-               Bprint(&bso, "warning: unable to find runtime.a\n");
+               Bprint(&bso, "warning: unable to find %s.a\n", name);
+}
+
+void
+loadlib(void)
+{
+       int i;
+
+       loadinternal("runtime");
+       if(thechar == '5')
+               loadinternal("math");
 
        for(i=0; i<libraryp; i++) {
                if(debug['v'])
index c5da888743d2363d529978f7724c1f179d88e5ae..0a071dada16852710a6edd21d8124d556c7b6da7 100644 (file)
@@ -15,6 +15,7 @@
 #define FLAGS_V (1 << 28)
 
 void   runtime·abort(void);
+void   math·sqrtGoC(uint64, uint64*);
 
 static uint32  trace = 0;