diff options
author | Pavel Labath <labath@google.com> | 2016-03-02 17:58:27 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-03-02 17:58:27 +0000 |
commit | 435a0e2e73a6a79ecf2d9737410814780c0c6a9b (patch) | |
tree | 3aff5725d8d4171f7ba838db41e3829c123a17c4 | |
parent | 475056006c3814688aef730813ada4d21524aa1e (diff) | |
download | windows-x86-435a0e2e73a6a79ecf2d9737410814780c0c6a9b.tar.gz |
Reapply "Prebuilts built with MSVC2015"
This reverts commit 475056006c3814688aef730813ada4d21524aa1e.
Change-Id: Ie0e0e288f88c09ad8ea3f27b5c9da513165cc5cf
-rwxr-xr-x | Debug/libglog.dll | bin | 227328 -> 241664 bytes | |||
-rwxr-xr-x | Debug/libglog.exp | bin | 32030 -> 33184 bytes | |||
-rwxr-xr-x | Debug/libglog.ilk | bin | 927972 -> 941220 bytes | |||
-rwxr-xr-x | Debug/libglog.lib | bin | 50698 -> 52586 bytes | |||
-rwxr-xr-x | Debug/libglog.pdb | bin | 1404928 -> 1519616 bytes | |||
-rwxr-xr-x | Debug/libglog_static.lib | bin | 1533894 -> 1394124 bytes | |||
-rwxr-xr-x | Debug/libglog_static.pdb | bin | 0 -> 602112 bytes | |||
-rwxr-xr-x | Debug/logging_unittest.exe | bin | 333312 -> 352256 bytes | |||
-rwxr-xr-x | Debug/logging_unittest.ilk | bin | 1118052 -> 1167964 bytes | |||
-rwxr-xr-x | Debug/logging_unittest.pdb | bin | 1798144 -> 1986560 bytes | |||
-rwxr-xr-x | Debug/logging_unittest_static.exe | bin | 412160 -> 431616 bytes | |||
-rwxr-xr-x | Debug/logging_unittest_static.ilk | bin | 1368540 -> 1371728 bytes | |||
-rwxr-xr-x | Debug/logging_unittest_static.pdb | bin | 2142208 -> 2306048 bytes | |||
-rwxr-xr-x | Release/libglog.dll | bin | 76800 -> 78336 bytes | |||
-rwxr-xr-x | Release/libglog.exp | bin | 32032 -> 33186 bytes | |||
-rwxr-xr-x | Release/libglog.iobj | bin | 0 -> 924700 bytes | |||
-rwxr-xr-x | Release/libglog.ipdb | bin | 0 -> 238240 bytes | |||
-rwxr-xr-x | Release/libglog.lib | bin | 50698 -> 52586 bytes | |||
-rwxr-xr-x | Release/libglog.pdb | bin | 880640 -> 1126400 bytes | |||
-rwxr-xr-x | Release/libglog_static.lib | bin | 5374554 -> 5020334 bytes | |||
-rwxr-xr-x | Release/logging_unittest.exe | bin | 95232 -> 98304 bytes | |||
-rwxr-xr-x | Release/logging_unittest.iobj | bin | 0 -> 1461432 bytes | |||
-rwxr-xr-x | Release/logging_unittest.ipdb | bin | 0 -> 342176 bytes | |||
-rwxr-xr-x | Release/logging_unittest.pdb | bin | 1019904 -> 1314816 bytes | |||
-rwxr-xr-x | Release/logging_unittest_static.exe | bin | 139264 -> 138752 bytes | |||
-rwxr-xr-x | Release/logging_unittest_static.iobj | bin | 0 -> 1929782 bytes | |||
-rwxr-xr-x | Release/logging_unittest_static.ipdb | bin | 0 -> 448240 bytes | |||
-rwxr-xr-x | Release/logging_unittest_static.pdb | bin | 1200128 -> 1568768 bytes | |||
-rwxr-xr-x | build-common.sh | 114 | ||||
-rwxr-xr-x | build-glog.sh | 7 | ||||
-rw-r--r-- | glog.patches | 36 |
31 files changed, 109 insertions, 48 deletions
diff --git a/Debug/libglog.dll b/Debug/libglog.dll Binary files differindex ff20b7a..838eff2 100755 --- a/Debug/libglog.dll +++ b/Debug/libglog.dll diff --git a/Debug/libglog.exp b/Debug/libglog.exp Binary files differindex 158b995..23eca20 100755 --- a/Debug/libglog.exp +++ b/Debug/libglog.exp diff --git a/Debug/libglog.ilk b/Debug/libglog.ilk Binary files differindex 2a3e82c..032ea0e 100755 --- a/Debug/libglog.ilk +++ b/Debug/libglog.ilk diff --git a/Debug/libglog.lib b/Debug/libglog.lib Binary files differindex da3f5f1..a478437 100755 --- a/Debug/libglog.lib +++ b/Debug/libglog.lib diff --git a/Debug/libglog.pdb b/Debug/libglog.pdb Binary files differindex 5190d31..bbc70d9 100755 --- a/Debug/libglog.pdb +++ b/Debug/libglog.pdb diff --git a/Debug/libglog_static.lib b/Debug/libglog_static.lib Binary files differindex 5409dd5..a235d50 100755 --- a/Debug/libglog_static.lib +++ b/Debug/libglog_static.lib diff --git a/Debug/libglog_static.pdb b/Debug/libglog_static.pdb Binary files differnew file mode 100755 index 0000000..459e88b --- /dev/null +++ b/Debug/libglog_static.pdb diff --git a/Debug/logging_unittest.exe b/Debug/logging_unittest.exe Binary files differindex c9e3f1b..0db5a9d 100755 --- a/Debug/logging_unittest.exe +++ b/Debug/logging_unittest.exe diff --git a/Debug/logging_unittest.ilk b/Debug/logging_unittest.ilk Binary files differindex 96fde5c..b800f70 100755 --- a/Debug/logging_unittest.ilk +++ b/Debug/logging_unittest.ilk diff --git a/Debug/logging_unittest.pdb b/Debug/logging_unittest.pdb Binary files differindex 345d59d..fd7eee5 100755 --- a/Debug/logging_unittest.pdb +++ b/Debug/logging_unittest.pdb diff --git a/Debug/logging_unittest_static.exe b/Debug/logging_unittest_static.exe Binary files differindex fc27067..f8e061e 100755 --- a/Debug/logging_unittest_static.exe +++ b/Debug/logging_unittest_static.exe diff --git a/Debug/logging_unittest_static.ilk b/Debug/logging_unittest_static.ilk Binary files differindex bc4445d..35c4ebd 100755 --- a/Debug/logging_unittest_static.ilk +++ b/Debug/logging_unittest_static.ilk diff --git a/Debug/logging_unittest_static.pdb b/Debug/logging_unittest_static.pdb Binary files differindex 204defb..68ecd73 100755 --- a/Debug/logging_unittest_static.pdb +++ b/Debug/logging_unittest_static.pdb diff --git a/Release/libglog.dll b/Release/libglog.dll Binary files differindex c6f472f..fba2b5b 100755 --- a/Release/libglog.dll +++ b/Release/libglog.dll diff --git a/Release/libglog.exp b/Release/libglog.exp Binary files differindex 8ddad28..da329b6 100755 --- a/Release/libglog.exp +++ b/Release/libglog.exp diff --git a/Release/libglog.iobj b/Release/libglog.iobj Binary files differnew file mode 100755 index 0000000..e61f338 --- /dev/null +++ b/Release/libglog.iobj diff --git a/Release/libglog.ipdb b/Release/libglog.ipdb Binary files differnew file mode 100755 index 0000000..5f18d6c --- /dev/null +++ b/Release/libglog.ipdb diff --git a/Release/libglog.lib b/Release/libglog.lib Binary files differindex 2b46801..0c04494 100755 --- a/Release/libglog.lib +++ b/Release/libglog.lib diff --git a/Release/libglog.pdb b/Release/libglog.pdb Binary files differindex 3614f69..67a77a3 100755 --- a/Release/libglog.pdb +++ b/Release/libglog.pdb diff --git a/Release/libglog_static.lib b/Release/libglog_static.lib Binary files differindex 3d06fc9..8fec134 100755 --- a/Release/libglog_static.lib +++ b/Release/libglog_static.lib diff --git a/Release/logging_unittest.exe b/Release/logging_unittest.exe Binary files differindex 56f00bc..fd57b8b 100755 --- a/Release/logging_unittest.exe +++ b/Release/logging_unittest.exe diff --git a/Release/logging_unittest.iobj b/Release/logging_unittest.iobj Binary files differnew file mode 100755 index 0000000..9a3fbf2 --- /dev/null +++ b/Release/logging_unittest.iobj diff --git a/Release/logging_unittest.ipdb b/Release/logging_unittest.ipdb Binary files differnew file mode 100755 index 0000000..9347a84 --- /dev/null +++ b/Release/logging_unittest.ipdb diff --git a/Release/logging_unittest.pdb b/Release/logging_unittest.pdb Binary files differindex e05ed09..f645d6a 100755 --- a/Release/logging_unittest.pdb +++ b/Release/logging_unittest.pdb diff --git a/Release/logging_unittest_static.exe b/Release/logging_unittest_static.exe Binary files differindex 762055e..1de0efd 100755 --- a/Release/logging_unittest_static.exe +++ b/Release/logging_unittest_static.exe diff --git a/Release/logging_unittest_static.iobj b/Release/logging_unittest_static.iobj Binary files differnew file mode 100755 index 0000000..2a1dbc4 --- /dev/null +++ b/Release/logging_unittest_static.iobj diff --git a/Release/logging_unittest_static.ipdb b/Release/logging_unittest_static.ipdb Binary files differnew file mode 100755 index 0000000..eb00c56 --- /dev/null +++ b/Release/logging_unittest_static.ipdb diff --git a/Release/logging_unittest_static.pdb b/Release/logging_unittest_static.pdb Binary files differindex 74be1c4..916bd0c 100755 --- a/Release/logging_unittest_static.pdb +++ b/Release/logging_unittest_static.pdb diff --git a/build-common.sh b/build-common.sh index 70c3a70..1ab2249 100755 --- a/build-common.sh +++ b/build-common.sh @@ -4,27 +4,69 @@ # inputs # $PROJ - project name # $VER - project version -# $1 - name of this file +# $1 - (temporary) output directory +# $2 - build directory for build artefacts +# $3 - build number # # this file does the following: # # 1) define the following env vars # OS - linux|darwin|windows -# USER - username # CORES - numer of cores (for parallel builds) # PATH (with appropriate compilers) # CFLAGS/CXXFLAGS/LDFLAGS # RD - root directory for source and object files -# INSTALL - install directory/git repo root +# INSTALL - install directory # SCRIPT_FILE - absolute path to the parent build script # SCRIPT_DIR - absolute path to the parent build script's directory # COMMON_FILE - absolute path to this file -# 2) create an empty tmp directory at /tmp/$PROJ-$USER -# 3) checkout the destination git repo to /tmp/prebuilts/$PROJ/$OS-x86/$VER -# 4) cd $RD +# 2) cd $RD +# +# after placing all your build products into $INSTALL you should call finalize_build to produce +# the final build artifact + +# exit on error +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[1]}")" && pwd -P)" +SCRIPT_FILE="$SCRIPT_DIR/$(basename "${BASH_SOURCE[1]}")" +COMMON_FILE="$SCRIPT_DIR/$(basename "${BASH_SOURCE[0]}")" + +# calculate the root directory from the script path +# this script lives three directories down from the root +# external/lldb-utils/prebuilts/build-common.sh +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd -P)" +cd "$ROOT_DIR" + +function die() { + echo "$*" > /dev/stderr + echo "Usage: $0 <out_dir> <dest_dir> <build_number>" > /dev/stderr + exit 1 +} + +(($# > 3)) && die "[$0] Unknown parameter: $4" + +OUT="$1" +DEST="$2" +BNUM="$3" + +[ ! "$OUT" ] && die "## Error: Missing out folder" +[ ! "$DEST" ] && die "## Error: Missing destination folder" +[ ! "$BNUM" ] && die "## Error: Missing build number" + +mkdir -p "$OUT" "$DEST" +OUT="$(cd "$OUT" && pwd -P)" +DEST="$(cd "$DEST" && pwd -P)" + +cat <<END_INFO +## Building $PROJ ## +## Out Dir : $OUT +## Dest Dir : $DEST +## Build Num: $BNUM + +END_INFO UNAME="$(uname)" -SCRATCH=/tmp UPSTREAM=sso://googleplex-android/platform/prebuilts case "$UNAME" in Linux) @@ -38,14 +80,19 @@ Darwin) export CXX=$CC++ export CFLAGS="$CFLAGS -mmacosx-version-min=$OSX_MIN" export CXXFLAGS="$CXXFLAGS -mmacosx-version-min=$OSX_MIN -stdlib=libc++" + export LDFLAGS="$LDFLAGS -mmacosx-version-min=$OSX_MIN" INSTALL_VER=$VER ;; *_NT-*) - USER=$USERNAME OS='windows' CORES=$NUMBER_OF_PROCESSORS - # VS2013 x64 Native Tools Command Prompt case "$MSVS" in + 2015) + devenv() { + cmd /c "${VS140COMNTOOLS}VsDevCmd.bat" '&' devenv.com "$@" + } + INSTALL_VER=${VER}_${MSVS} + ;; 2013) devenv() { cmd /c "${VS120COMNTOOLS}VsDevCmd.bat" '&' devenv.com "$@" @@ -65,18 +112,9 @@ Darwin) ;; esac -RD=$SCRATCH/$PROJ-$USER +RD=$OUT/$PROJ INSTALL="$RD/install" -# OSX lacks a "realpath" bash command -realpath() { - [[ "$1" == /* ]] && echo "$1" || echo "$PWD/${1#./}" -} - -SCRIPT_FILE=$(realpath "$0") -SCRIPT_DIR="$(dirname "$SCRIPT_FILE")" -COMMON_FILE="$SCRIPT_DIR/$1" - cd /tmp # windows can't delete if you're in the dir rm -rf $RD mkdir -p $INSTALL @@ -86,44 +124,30 @@ cd $RD # clone prebuilt gcc case "$OS" in linux) - CLANG_DIR=$RD/clang + # can't get prebuilt clang working so we're using host clang-3.5 https://b/22748915 + #CLANG_DIR=$RD/clang + #git clone $UPSTREAM/clang/linux-x86/host/3.6 $CLANG_DIR + #export CC="$CLANG_DIR/bin/clang" + #export CXX="$CC++" + export CC=clang-3.5 + export CXX=clang++-3.5 + GCC_DIR=$RD/gcc - git clone $UPSTREAM/clang/linux-x86/host/3.6 $CLANG_DIR git clone $UPSTREAM/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 $GCC_DIR find "$GCC_DIR" -name x86_64-linux -exec ln -fns {} {}-gnu \; - export CC="$CLANG_DIR/bin/clang" - export CXX="$CC++" FLAGS+=(-fuse-ld=gold) FLAGS+=(--gcc-toolchain="$GCC_DIR") FLAGS+=(--sysroot "$GCC_DIR/sysroot") FLAGS+=(-B"$GCC_DIR/bin/x86_64-linux-") export CFLAGS="$CFLAGS ${FLAGS[*]}" export CXXFLAGS="$CXXFLAGS ${FLAGS[*]}" + export LDFLAGS="$LDFLAGS -m64" ;; esac -commit_and_push() -{ - BRANCH=studio-master-dev - # check into a local git clone - rm -rf $SCRATCH/prebuilts/$PROJ/ - mkdir -p $SCRATCH/prebuilts/$PROJ/ - cd $SCRATCH/prebuilts/$PROJ/ - git clone $UPSTREAM/$PROJ/$OS-x86 -b $BRANCH - GIT_REPO="$SCRATCH/prebuilts/$PROJ/$OS-x86" - cd $GIT_REPO - rm -rf * - mv $INSTALL/* $GIT_REPO - cp $SCRIPT_FILE $GIT_REPO - cp $COMMON_FILE $GIT_REPO - - git add . - git commit -m "Adding binaries for $INSTALL_VER" - - # execute this command to upload - #git push origin HEAD:refs/for/$BRANCH - - rm -rf $RD +function finalize_build() { + cp "$SCRIPT_FILE" "$COMMON_FILE" "$INSTALL" + (cd "$INSTALL" && zip --symlinks -r "$DEST/$PROJ-$BNUM.zip" .) } diff --git a/build-glog.sh b/build-glog.sh index a8802e4..2439ad8 100755 --- a/build-glog.sh +++ b/build-glog.sh @@ -8,9 +8,9 @@ PROJ=libglog VER=0.3.4 -MSVS=2013 +MSVS=2015 -source $(dirname "$0")/build-common.sh build-common.sh +source "$(dirname "${BASH_SOURCE[0]}")/build-common.sh" "$@" BASE=${PROJ#lib}-$VER TGZ=v${VER}.tar.gz @@ -19,6 +19,7 @@ curl -L https://github.com/google/glog/archive/$TGZ -o $TGZ tar xzf $TGZ || cat $TGZ # if this fails, we're probably getting an http error cd $BASE +patch -p3 <"$SCRIPT_DIR/glog.patches" case "$OS" in windows) devenv google-glog.sln /Upgrade @@ -45,4 +46,4 @@ case "$OS" in ;; esac -commit_and_push +finalize_build diff --git a/glog.patches b/glog.patches new file mode 100644 index 0000000..cf6977a --- /dev/null +++ b/glog.patches @@ -0,0 +1,36 @@ +diff -aur OUTa/libglog/glog-0.3.4/src/windows/port.cc OUT/libglog/glog-0.3.4/src/windows/port.cc +--- OUTa/libglog/glog-0.3.4/src/windows/port.cc 2015-03-10 21:02:27.000000000 -0700 ++++ OUT/libglog/glog-0.3.4/src/windows/port.cc 2016-02-04 06:39:15.020941800 -0800 +@@ -36,6 +36,7 @@ + # error You should only be including windows/port.cc in a windows environment! + #endif + ++#if !defined(_MSC_VER) || _MSC_VER < 1900 + #include "config.h" + #include <stdarg.h> // for va_list, va_start, va_end + #include <string.h> // for strstr() +@@ -62,3 +63,4 @@ + va_end(ap); + return r; + } ++#endif +\ No newline at end of file +diff -aur OUTa/libglog/glog-0.3.4/src/windows/port.h OUT/libglog/glog-0.3.4/src/windows/port.h +--- OUTa/libglog/glog-0.3.4/src/windows/port.h 2015-03-10 21:02:27.000000000 -0700 ++++ OUT/libglog/glog-0.3.4/src/windows/port.h 2016-02-04 06:46:29.038741800 -0800 +@@ -107,6 +107,7 @@ + /* Sleep is in ms, on windows */ + #define sleep(secs) Sleep((secs) * 1000) + ++#if _MSC_VER < 1900 + /* We can't just use _vsnprintf and _snprintf as drop-in-replacements, + * because they don't always NUL-terminate. :-( We also can't use the + * name vsnprintf, since windows defines that (but not snprintf (!)). +@@ -117,6 +118,7 @@ + const char *format, va_list ap); + #define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap) + #define va_copy(dst, src) (dst) = (src) ++#endif // _MSC_VER < 1900 + + /* Windows doesn't support specifying the number of buckets as a + * hash_map constructor arg, so we leave this blank. |