about summary refs log tree commit diff
path: root/src/etc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-21 09:20:48 +0000
committerbors <bors@rust-lang.org>2015-02-21 09:20:48 +0000
commit2b01a37ec38db9301239f0c0abcf3c695055b0ff (patch)
treea8fbf2329325d51716f163780d5e932989d04e06 /src/etc
parent522d09dfecbeca1595f25ac58c6d0178bbd21d7d (diff)
parent551304015bac6f8424fcc6827855d3c61fe167c9 (diff)
downloadrust-2b01a37ec38db9301239f0c0abcf3c695055b0ff.tar.gz
rust-2b01a37ec38db9301239f0c0abcf3c695055b0ff.zip
Auto merge of #21959 - dhuseby:bitrig-support, r=brson
This patch adds the necessary pieces to support rust on Bitrig https://bitrig.org
Diffstat (limited to 'src/etc')
-rwxr-xr-xsrc/etc/local_stage0.sh2
-rw-r--r--src/etc/mklldeps.py11
-rw-r--r--src/etc/snapshot.py4
3 files changed, 14 insertions, 3 deletions
diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
index b506aff94e7..ca59b1c7d34 100755
--- a/src/etc/local_stage0.sh
+++ b/src/etc/local_stage0.sh
@@ -18,7 +18,7 @@ LIB_PREFIX=lib
 
 OS=`uname -s`
 case $OS in
-    ("Linux"|"FreeBSD"|"DragonFly"|"OpenBSD")
+    ("Linux"|"FreeBSD"|"DragonFly"|"Bitrig"|"OpenBSD")
     BIN_SUF=
     LIB_SUF=.so
     ;;
diff --git a/src/etc/mklldeps.py b/src/etc/mklldeps.py
index a4234159cb8..e5e8c9f11bd 100644
--- a/src/etc/mklldeps.py
+++ b/src/etc/mklldeps.py
@@ -57,7 +57,16 @@ else:
 args.extend(components)
 out = run(args)
 for lib in out.strip().replace("\n", ' ').split(' '):
-    lib = lib.strip()[2:] # chop of the leading '-l'
+    if len(lib) == 0:
+        continue
+    # in some cases we get extra spaces in between libs so ignore those
+    if len(lib) == 1 and lib == ' ':
+        continue
+    # not all libs strictly follow -lfoo, on Bitrig, there is -pthread
+    if lib[0:2] == '-l':
+        lib = lib.strip()[2:]
+    elif lib[0] == '-':
+        lib = lib.strip()[1:]
     f.write("#[link(name = \"" + lib + "\"")
     # LLVM libraries are all static libraries
     if 'LLVM' in lib:
diff --git a/src/etc/snapshot.py b/src/etc/snapshot.py
index 264af5f9854..0349ccf9b66 100644
--- a/src/etc/snapshot.py
+++ b/src/etc/snapshot.py
@@ -46,13 +46,13 @@ snapshot_files = {
         "winnt": ["bin/rustc.exe"],
         "freebsd": ["bin/rustc"],
         "dragonfly": ["bin/rustc"],
+        "bitrig": ["bin/rustc"],
         "openbsd": ["bin/rustc"],
         }
 
 winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll", "libstdc++-6.dll"]
 winnt_runtime_deps_64 = ["libgcc_s_seh-1.dll", "libstdc++-6.dll"]
 
-
 def parse_line(n, line):
     global snapshotfile
 
@@ -101,6 +101,8 @@ def get_kernel(triple):
         return "freebsd"
     if os_name == "dragonfly":
         return "dragonfly"
+    if os_name == "bitrig":
+        return "bitrig"
     if os_name == "openbsd":
         return "openbsd"
     return "linux"