summaryrefslogtreecommitdiffstats
path: root/taskcluster/scripts/misc/build-minidump-stackwalk.sh
blob: 277faa37ff07b723bdf8c52349b450c223c0d231 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -x -e -v

# This script is for building minidump_stackwalk

COMPRESS_EXT=xz

cd $GECKO_PATH

if [ -n "$TOOLTOOL_MANIFEST" ]; then
  . taskcluster/scripts/misc/tooltool-download.sh
fi

export MOZ_OBJDIR=obj-minidump

echo ac_add_options --enable-project=tools/crashreporter > .mozconfig

MINIDUMP_STACKWALK=minidump_stackwalk

case "$1" in
macosx64)
    TOOLCHAINS="cctools rustc clang"
    echo ac_add_options --target=x86_64-apple-darwin >> .mozconfig
    echo ac_add_options --with-macos-sdk=$MOZ_FETCHES_DIR/MacOSX10.12.sdk >> .mozconfig
    ;;
mingw32)
    TOOLCHAINS="binutils rustc clang"
    echo ac_add_options --target=i686-w64-mingw32 >> .mozconfig
    echo export CC=i686-w64-mingw32-clang >> .mozconfig
    echo export HOST_CC=clang >> .mozconfig
    MINIDUMP_STACKWALK=minidump_stackwalk.exe
    ;;
*)
    TOOLCHAINS="binutils rustc clang"
    ;;
esac

for t in $TOOLCHAINS; do
    PATH="$MOZ_FETCHES_DIR/$t/bin:$PATH"
done

./mach build -v

mkdir minidump_stackwalk
cp $MOZ_OBJDIR/dist/bin/$MINIDUMP_STACKWALK minidump_stackwalk/

tar -acf minidump_stackwalk.tar.$COMPRESS_EXT minidump_stackwalk/
mkdir -p $UPLOAD_DIR
cp minidump_stackwalk.tar.$COMPRESS_EXT $UPLOAD_DIR