ref: 990e08a754e3a4c1bd7c44a3862a167aebda63af
parent: 4cd2696347b1273dfc97c6733b7f01d9ccc81732
author: Ori Bernstein <ori@eigenstate.org>
date: Wed May 9 15:52:28 EDT 2018
Fix our tags when bootstrapping.
--- a/genbootstrap.sh
+++ b/genbootstrap.sh
@@ -18,6 +18,22 @@
cp obj/mbld/mbld xmbld
./xmbld -o '' clean
+tags(){
+ case `uname` in
+ *Linux*) echo -Tposixy -Tlinux;;
+ *Darwin*) echo -Tposixy -Tdarwin;;
+ *FreeBSD*) echo -Tposixy -Tfreebsd;;
+ *NetBSD*) echo -Tposixy -Tnetbsd;;
+ *OpenBSD*) echo -Tposixy -Topenbsd:6.2;;
+ *Plan9*) echo -Tplan9;;
+ esac
+ case `uname -m` in
+ *amd64*) echo -Tx64 ;;
+ *x86_64*) echo -Tx64 ;;
+ esac
+}
+
+
bootscript=mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh
echo '#!/bin/sh' > $bootscript
echo '# This script is generated by genbootstrap.sh' >> $bootscript
@@ -27,7 +43,7 @@
echo 'set -x' >> $bootscript
# mbld needs to be run without an output dir so we dont
# run into mkdir issues.
-./xmbld -o '' -j1 -Bnone mbld:mbld | \
+./xmbld -o '' -j1 -Bnone mbld:mbld `tags` | \
grep '^ ' | \
sed "s:`pwd`:\$pwd:g" | \
tee -a $bootscript
--- a/mbld/syssel.myr
+++ b/mbld/syssel.myr
@@ -208,6 +208,15 @@
std.slfree(data)
}
-const tag = {b, tag
- std.htput(b.tags, std.sldup(tag), (-1, -1, -1))
+const tag = {b, t
+ var v
+ match std.strfind(t, ":")
+ | `std.None:
+ std.htput(b.tags, std.sldup(t), (-1, -1, -1))
+ | `std.Some idx:
+ v = parseversion(t[idx+1:])
+ std.put("version: {} : {}\n", t[:idx], v)
+ std.htput(b.tags, std.sldup(t[:idx]), v)
+ ;;
+
}
--- a/mk/bootstrap/bootstrap+OpenBSD-amd64.sh
+++ b/mk/bootstrap/bootstrap+OpenBSD-amd64.sh
@@ -4,15 +4,15 @@
pwd=`pwd`
set -x
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr
- as -g -o mbld/cpufeatures.o mbld/cpufeatures+posixy-x64.s
- as -g -o lib/thread/exit.o lib/thread/exit+openbsd-x64.s
- as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s
- as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s
+ as -o mbld/cpufeatures.o mbld/cpufeatures+posixy-x64.s
+ as -o lib/thread/exit.o lib/thread/exit+openbsd-x64.s
+ as -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s
+ as -o lib/std/getbp.o lib/std/getbp+posixy-x64.s
$pwd/6/6m -I lib/sys lib/std/option.myr
$pwd/6/6m -I lib/sys lib/std/traits.myr
- as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s
+ as -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s
$pwd/6/6m -I lib/sys lib/std/fltbits.myr
- as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s
+ as -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s
$pwd/6/6m -I lib/sys lib/std/endian.myr
$pwd/6/6m -I lib/sys lib/std/extremum.myr
$pwd/6/6m -I lib/sys lib/std/sjlj+x64.myr
@@ -19,12 +19,12 @@
$pwd/6/6m -I lib/sys lib/std/swap.myr
$pwd/6/6m -I lib/sys lib/std/slfill.myr
$pwd/6/6m -I lib/sys lib/std/result.myr
- as -g -o lib/sys/syscall.o lib/sys/syscall+openbsd-x64.s
+ as -o lib/sys/syscall.o lib/sys/syscall+openbsd-x64.s
$pwd/6/6m lib/sys/ifreq+openbsd.myr
$pwd/6/6m lib/sys/systypes.myr
- as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s
+ as -o lib/sys/util.o lib/sys/util+posixy-x64.s
$pwd/6/6m lib/sys/syserrno+openbsd.myr
- $pwd/6/6m lib/sys/sys+openbsd:6.1-x64.myr
+ $pwd/6/6m lib/sys/sys+openbsd:6.2-x64.myr
ar -rcs lib/sys/libsys.a lib/sys/sys.o lib/sys/syserrno.o lib/sys/util.o lib/sys/systypes.o lib/sys/ifreq.o lib/sys/syscall.o
$pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/syserrno.use lib/sys/systypes.use lib/sys/ifreq.use
$pwd/6/6m -I lib/sys lib/std/errno.myr
@@ -123,7 +123,7 @@
$pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu+openbsd.myr
$pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr
$pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr
- $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex+openbsd:6.2.myr
$pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr
ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/atomic.o lib/thread/atomic-impl.o lib/thread/hookstd.o lib/thread/common.o lib/thread/ncpu.o lib/thread/exit.o lib/thread/spawn.o
$pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/atomic.use lib/thread/hookstd.use lib/thread/common.use lib/thread/ncpu.use lib/thread/spawn.use
@@ -142,5 +142,5 @@
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr
- ld -nopie --gc-sections -o mbld/mbld $pwd/rt/_myrrt.o mbld/deps.o mbld/main.o mbld/util.o mbld/cpufeatures.o mbld/libs.o mbld/syssel.o mbld/config.o mbld/opts.o mbld/subtest.o mbld/types.o mbld/test.o mbld/install.o mbld/parse.o mbld/build.o -Llib/thread -lthread -Llib/bio -lbio -Llib/regex -lregex -Llib/std -lstd -Llib/sys -lsys
+ ld -nopie -o mbld/mbld $pwd/rt/_myrrt.o mbld/deps.o mbld/main.o mbld/util.o mbld/cpufeatures.o mbld/libs.o mbld/syssel.o mbld/config.o mbld/opts.o mbld/subtest.o mbld/types.o mbld/test.o mbld/install.o mbld/parse.o mbld/build.o -Llib/thread -lthread -Llib/bio -lbio -Llib/regex -lregex -Llib/std -lstd -Llib/sys -lsys
true