You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
7
external/boringssl/util/32-bit-toolchain.cmake
vendored
Normal file
7
external/boringssl/util/32-bit-toolchain.cmake
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -msse2" CACHE STRING "c++ flags")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -msse2" CACHE STRING "c flags")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -m32 -msse2" CACHE STRING "asm flags")
|
||||
319
external/boringssl/util/all_tests.go
vendored
Normal file
319
external/boringssl/util/all_tests.go
vendored
Normal file
@@ -0,0 +1,319 @@
|
||||
/* Copyright (c) 2015, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
// TODO(davidben): Link tests with the malloc shim and port -malloc-test to this runner.
|
||||
|
||||
var (
|
||||
useValgrind = flag.Bool("valgrind", false, "If true, run code under valgrind")
|
||||
useCallgrind = flag.Bool("callgrind", false, "If true, run code under valgrind to generate callgrind traces.")
|
||||
useGDB = flag.Bool("gdb", false, "If true, run BoringSSL code under gdb")
|
||||
buildDir = flag.String("build-dir", "build", "The build directory to run the tests from.")
|
||||
numWorkers = flag.Int("num-workers", 1, "Runs the given number of workers when testing.")
|
||||
jsonOutput = flag.String("json-output", "", "The file to output JSON results to.")
|
||||
mallocTest = flag.Int64("malloc-test", -1, "If non-negative, run each test with each malloc in turn failing from the given number onwards.")
|
||||
mallocTestDebug = flag.Bool("malloc-test-debug", false, "If true, ask each test to abort rather than fail a malloc. This can be used with a specific value for --malloc-test to identity the malloc failing that is causing problems.")
|
||||
)
|
||||
|
||||
type test []string
|
||||
|
||||
type result struct {
|
||||
Test test
|
||||
Passed bool
|
||||
Error error
|
||||
}
|
||||
|
||||
// testOutput is a representation of Chromium's JSON test result format. See
|
||||
// https://www.chromium.org/developers/the-json-test-results-format
|
||||
type testOutput struct {
|
||||
Version int `json:"version"`
|
||||
Interrupted bool `json:"interrupted"`
|
||||
PathDelimiter string `json:"path_delimiter"`
|
||||
SecondsSinceEpoch float64 `json:"seconds_since_epoch"`
|
||||
NumFailuresByType map[string]int `json:"num_failures_by_type"`
|
||||
Tests map[string]testResult `json:"tests"`
|
||||
}
|
||||
|
||||
type testResult struct {
|
||||
Actual string `json:"actual"`
|
||||
Expected string `json:"expected"`
|
||||
IsUnexpected bool `json:"is_unexpected"`
|
||||
}
|
||||
|
||||
func newTestOutput() *testOutput {
|
||||
return &testOutput{
|
||||
Version: 3,
|
||||
PathDelimiter: ".",
|
||||
SecondsSinceEpoch: float64(time.Now().UnixNano()) / float64(time.Second/time.Nanosecond),
|
||||
NumFailuresByType: make(map[string]int),
|
||||
Tests: make(map[string]testResult),
|
||||
}
|
||||
}
|
||||
|
||||
func (t *testOutput) addResult(name, result string) {
|
||||
if _, found := t.Tests[name]; found {
|
||||
panic(name)
|
||||
}
|
||||
t.Tests[name] = testResult{
|
||||
Actual: result,
|
||||
Expected: "PASS",
|
||||
IsUnexpected: result != "PASS",
|
||||
}
|
||||
t.NumFailuresByType[result]++
|
||||
}
|
||||
|
||||
func (t *testOutput) writeTo(name string) error {
|
||||
file, err := os.Create(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
out, err := json.MarshalIndent(t, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = file.Write(out)
|
||||
return err
|
||||
}
|
||||
|
||||
func valgrindOf(dbAttach bool, path string, args ...string) *exec.Cmd {
|
||||
valgrindArgs := []string{"--error-exitcode=99", "--track-origins=yes", "--leak-check=full"}
|
||||
if dbAttach {
|
||||
valgrindArgs = append(valgrindArgs, "--db-attach=yes", "--db-command=xterm -e gdb -nw %f %p")
|
||||
}
|
||||
valgrindArgs = append(valgrindArgs, path)
|
||||
valgrindArgs = append(valgrindArgs, args...)
|
||||
|
||||
return exec.Command("valgrind", valgrindArgs...)
|
||||
}
|
||||
|
||||
func callgrindOf(path string, args ...string) *exec.Cmd {
|
||||
valgrindArgs := []string{"-q", "--tool=callgrind", "--dump-instr=yes", "--collect-jumps=yes", "--callgrind-out-file=" + *buildDir + "/callgrind/callgrind.out.%p"}
|
||||
valgrindArgs = append(valgrindArgs, path)
|
||||
valgrindArgs = append(valgrindArgs, args...)
|
||||
|
||||
return exec.Command("valgrind", valgrindArgs...)
|
||||
}
|
||||
|
||||
func gdbOf(path string, args ...string) *exec.Cmd {
|
||||
xtermArgs := []string{"-e", "gdb", "--args"}
|
||||
xtermArgs = append(xtermArgs, path)
|
||||
xtermArgs = append(xtermArgs, args...)
|
||||
|
||||
return exec.Command("xterm", xtermArgs...)
|
||||
}
|
||||
|
||||
type moreMallocsError struct{}
|
||||
|
||||
func (moreMallocsError) Error() string {
|
||||
return "child process did not exhaust all allocation calls"
|
||||
}
|
||||
|
||||
var errMoreMallocs = moreMallocsError{}
|
||||
|
||||
func runTestOnce(test test, mallocNumToFail int64) (passed bool, err error) {
|
||||
prog := path.Join(*buildDir, test[0])
|
||||
args := test[1:]
|
||||
var cmd *exec.Cmd
|
||||
if *useValgrind {
|
||||
cmd = valgrindOf(false, prog, args...)
|
||||
} else if *useCallgrind {
|
||||
cmd = callgrindOf(prog, args...)
|
||||
} else if *useGDB {
|
||||
cmd = gdbOf(prog, args...)
|
||||
} else {
|
||||
cmd = exec.Command(prog, args...)
|
||||
}
|
||||
var stdoutBuf bytes.Buffer
|
||||
var stderrBuf bytes.Buffer
|
||||
cmd.Stdout = &stdoutBuf
|
||||
cmd.Stderr = &stderrBuf
|
||||
if mallocNumToFail >= 0 {
|
||||
cmd.Env = os.Environ()
|
||||
cmd.Env = append(cmd.Env, "MALLOC_NUMBER_TO_FAIL="+strconv.FormatInt(mallocNumToFail, 10))
|
||||
if *mallocTestDebug {
|
||||
cmd.Env = append(cmd.Env, "MALLOC_ABORT_ON_FAIL=1")
|
||||
}
|
||||
cmd.Env = append(cmd.Env, "_MALLOC_CHECK=1")
|
||||
}
|
||||
|
||||
if err := cmd.Start(); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if err := cmd.Wait(); err != nil {
|
||||
if exitError, ok := err.(*exec.ExitError); ok {
|
||||
if exitError.Sys().(syscall.WaitStatus).ExitStatus() == 88 {
|
||||
return false, errMoreMallocs
|
||||
}
|
||||
}
|
||||
fmt.Print(string(stderrBuf.Bytes()))
|
||||
return false, err
|
||||
}
|
||||
fmt.Print(string(stderrBuf.Bytes()))
|
||||
|
||||
// Account for Windows line-endings.
|
||||
stdout := bytes.Replace(stdoutBuf.Bytes(), []byte("\r\n"), []byte("\n"), -1)
|
||||
|
||||
if bytes.HasSuffix(stdout, []byte("PASS\n")) &&
|
||||
(len(stdout) == 5 || stdout[len(stdout)-6] == '\n') {
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func runTest(test test) (bool, error) {
|
||||
if *mallocTest < 0 {
|
||||
return runTestOnce(test, -1)
|
||||
}
|
||||
|
||||
for mallocNumToFail := int64(*mallocTest); ; mallocNumToFail++ {
|
||||
if passed, err := runTestOnce(test, mallocNumToFail); err != errMoreMallocs {
|
||||
if err != nil {
|
||||
err = fmt.Errorf("at malloc %d: %s", mallocNumToFail, err)
|
||||
}
|
||||
return passed, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// shortTestName returns the short name of a test. Except for evp_test, it
|
||||
// assumes that any argument which ends in .txt is a path to a data file and not
|
||||
// relevant to the test's uniqueness.
|
||||
func shortTestName(test test) string {
|
||||
var args []string
|
||||
for _, arg := range test {
|
||||
if test[0] == "crypto/evp/evp_test" || !strings.HasSuffix(arg, ".txt") {
|
||||
args = append(args, arg)
|
||||
}
|
||||
}
|
||||
return strings.Join(args, " ")
|
||||
}
|
||||
|
||||
// setWorkingDirectory walks up directories as needed until the current working
|
||||
// directory is the top of a BoringSSL checkout.
|
||||
func setWorkingDirectory() {
|
||||
for i := 0; i < 64; i++ {
|
||||
if _, err := os.Stat("BUILDING.md"); err == nil {
|
||||
return
|
||||
}
|
||||
os.Chdir("..")
|
||||
}
|
||||
|
||||
panic("Couldn't find BUILDING.md in a parent directory!")
|
||||
}
|
||||
|
||||
func parseTestConfig(filename string) ([]test, error) {
|
||||
in, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer in.Close()
|
||||
|
||||
decoder := json.NewDecoder(in)
|
||||
var result []test
|
||||
if err := decoder.Decode(&result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func worker(tests <-chan test, results chan<- result, done *sync.WaitGroup) {
|
||||
defer done.Done()
|
||||
for test := range tests {
|
||||
passed, err := runTest(test)
|
||||
results <- result{test, passed, err}
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
setWorkingDirectory()
|
||||
|
||||
testCases, err := parseTestConfig("util/all_tests.json")
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to parse input: %s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
tests := make(chan test, *numWorkers)
|
||||
results := make(chan result, *numWorkers)
|
||||
|
||||
for i := 0; i < *numWorkers; i++ {
|
||||
wg.Add(1)
|
||||
go worker(tests, results, &wg)
|
||||
}
|
||||
|
||||
go func() {
|
||||
for _, test := range testCases {
|
||||
tests <- test
|
||||
}
|
||||
close(tests)
|
||||
|
||||
wg.Wait()
|
||||
close(results)
|
||||
}()
|
||||
|
||||
testOutput := newTestOutput()
|
||||
var failed []test
|
||||
for testResult := range results {
|
||||
test := testResult.Test
|
||||
|
||||
fmt.Printf("%s\n", strings.Join([]string(test), " "))
|
||||
name := shortTestName(test)
|
||||
if testResult.Error != nil {
|
||||
fmt.Printf("%s failed to complete: %s\n", test[0], testResult.Error)
|
||||
failed = append(failed, test)
|
||||
testOutput.addResult(name, "CRASHED")
|
||||
} else if !testResult.Passed {
|
||||
fmt.Printf("%s failed to print PASS on the last line.\n", test[0])
|
||||
failed = append(failed, test)
|
||||
testOutput.addResult(name, "FAIL")
|
||||
} else {
|
||||
testOutput.addResult(name, "PASS")
|
||||
}
|
||||
}
|
||||
|
||||
if *jsonOutput != "" {
|
||||
if err := testOutput.writeTo(*jsonOutput); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
if len(failed) > 0 {
|
||||
fmt.Printf("\n%d of %d tests failed:\n", len(failed), len(testCases))
|
||||
for _, test := range failed {
|
||||
fmt.Printf("\t%s\n", strings.Join([]string(test), " "))
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Printf("\nAll tests passed!\n")
|
||||
}
|
||||
70
external/boringssl/util/all_tests.json
vendored
Normal file
70
external/boringssl/util/all_tests.json
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
[
|
||||
["crypto/aes/aes_test"],
|
||||
["crypto/asn1/asn1_test"],
|
||||
["crypto/base64/base64_test"],
|
||||
["crypto/bio/bio_test"],
|
||||
["crypto/bn/bn_test"],
|
||||
["crypto/bytestring/bytestring_test"],
|
||||
["crypto/chacha/chacha_test"],
|
||||
["crypto/cipher/aead_test", "aes-128-gcm", "crypto/cipher/test/aes_128_gcm_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-128-key-wrap", "crypto/cipher/test/aes_128_key_wrap_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-256-gcm", "crypto/cipher/test/aes_256_gcm_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-256-key-wrap", "crypto/cipher/test/aes_256_key_wrap_tests.txt"],
|
||||
["crypto/cipher/aead_test", "chacha20-poly1305", "crypto/cipher/test/chacha20_poly1305_tests.txt"],
|
||||
["crypto/cipher/aead_test", "chacha20-poly1305-old", "crypto/cipher/test/chacha20_poly1305_old_tests.txt"],
|
||||
["crypto/cipher/aead_test", "rc4-md5-tls", "crypto/cipher/test/rc4_md5_tls_tests.txt"],
|
||||
["crypto/cipher/aead_test", "rc4-sha1-tls", "crypto/cipher/test/rc4_sha1_tls_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-128-cbc-sha1-tls", "crypto/cipher/test/aes_128_cbc_sha1_tls_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-128-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/aes_128_cbc_sha1_tls_implicit_iv_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-128-cbc-sha256-tls", "crypto/cipher/test/aes_128_cbc_sha256_tls_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-256-cbc-sha1-tls", "crypto/cipher/test/aes_256_cbc_sha1_tls_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-256-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/aes_256_cbc_sha1_tls_implicit_iv_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-256-cbc-sha256-tls", "crypto/cipher/test/aes_256_cbc_sha256_tls_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-256-cbc-sha384-tls", "crypto/cipher/test/aes_256_cbc_sha384_tls_tests.txt"],
|
||||
["crypto/cipher/aead_test", "des-ede3-cbc-sha1-tls", "crypto/cipher/test/des_ede3_cbc_sha1_tls_tests.txt"],
|
||||
["crypto/cipher/aead_test", "des-ede3-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/des_ede3_cbc_sha1_tls_implicit_iv_tests.txt"],
|
||||
["crypto/cipher/aead_test", "rc4-md5-ssl3", "crypto/cipher/test/rc4_md5_ssl3_tests.txt"],
|
||||
["crypto/cipher/aead_test", "rc4-sha1-ssl3", "crypto/cipher/test/rc4_sha1_ssl3_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-128-cbc-sha1-ssl3", "crypto/cipher/test/aes_128_cbc_sha1_ssl3_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-256-cbc-sha1-ssl3", "crypto/cipher/test/aes_256_cbc_sha1_ssl3_tests.txt"],
|
||||
["crypto/cipher/aead_test", "des-ede3-cbc-sha1-ssl3", "crypto/cipher/test/des_ede3_cbc_sha1_ssl3_tests.txt"],
|
||||
["crypto/cipher/aead_test", "aes-128-ctr-hmac-sha256", "crypto/cipher/test/aes_128_ctr_hmac_sha256.txt"],
|
||||
["crypto/cipher/aead_test", "aes-256-ctr-hmac-sha256", "crypto/cipher/test/aes_256_ctr_hmac_sha256.txt"],
|
||||
["crypto/cipher/cipher_test", "crypto/cipher/test/cipher_tests.txt"],
|
||||
["crypto/cmac/cmac_test"],
|
||||
["crypto/constant_time_test"],
|
||||
["crypto/curve25519/ed25519_test", "crypto/curve25519/ed25519_tests.txt"],
|
||||
["crypto/curve25519/x25519_test"],
|
||||
["crypto/curve25519/spake25519_test"],
|
||||
["crypto/dh/dh_test"],
|
||||
["crypto/digest/digest_test"],
|
||||
["crypto/dsa/dsa_test"],
|
||||
["crypto/ec/ec_test"],
|
||||
["crypto/ec/example_mul"],
|
||||
["crypto/ecdsa/ecdsa_test"],
|
||||
["crypto/err/err_test"],
|
||||
["crypto/evp/evp_extra_test"],
|
||||
["crypto/evp/evp_test", "crypto/evp/evp_tests.txt"],
|
||||
["crypto/evp/pbkdf_test"],
|
||||
["crypto/hkdf/hkdf_test"],
|
||||
["crypto/hmac/hmac_test", "crypto/hmac/hmac_tests.txt"],
|
||||
["crypto/lhash/lhash_test"],
|
||||
["crypto/modes/gcm_test"],
|
||||
["crypto/newhope/newhope_test"],
|
||||
["crypto/newhope/newhope_statistical_test"],
|
||||
["crypto/newhope/newhope_vectors_test", "crypto/newhope/newhope_tests.txt"],
|
||||
["crypto/obj/obj_test"],
|
||||
["crypto/pkcs8/pkcs12_test"],
|
||||
["crypto/pkcs8/pkcs8_test"],
|
||||
["crypto/poly1305/poly1305_test", "crypto/poly1305/poly1305_tests.txt"],
|
||||
["crypto/refcount_test"],
|
||||
["crypto/rsa/rsa_test"],
|
||||
["crypto/thread_test"],
|
||||
["crypto/x509/pkcs7_test"],
|
||||
["crypto/x509/x509_test"],
|
||||
["crypto/x509v3/tab_test"],
|
||||
["crypto/x509v3/v3name_test"],
|
||||
["decrepit/ripemd/ripemd_test"],
|
||||
["ssl/pqueue/pqueue_test"],
|
||||
["ssl/ssl_test"]
|
||||
]
|
||||
4
external/boringssl/util/android-cmake/.gitattributes
vendored
Normal file
4
external/boringssl/util/android-cmake/.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
.git* text export-ignore
|
||||
|
||||
* text=auto
|
||||
* whitespace=!indent,tab-in-indent,trail,space
|
||||
41
external/boringssl/util/android-cmake/.gitignore
vendored
Normal file
41
external/boringssl/util/android-cmake/.gitignore
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
.DS_Store
|
||||
._*
|
||||
*.user
|
||||
|
||||
# backup files
|
||||
*~
|
||||
*.orig
|
||||
*.bak
|
||||
|
||||
# built application files
|
||||
*.apk
|
||||
*.ap_
|
||||
|
||||
# files for the dex VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# generated files
|
||||
bin/
|
||||
gen/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Eclipse project files
|
||||
.classpath
|
||||
.project
|
||||
.metadata
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
# vim files
|
||||
.*.sw[a-z]
|
||||
*.un~
|
||||
Session.vim
|
||||
.netrwhist
|
||||
|
||||
# SublimeText project files
|
||||
*.sublime-workspace
|
||||
96
external/boringssl/util/android-cmake/AndroidNdkGdb.cmake
vendored
Normal file
96
external/boringssl/util/android-cmake/AndroidNdkGdb.cmake
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
# Copyright (c) 2014, Pavel Rojtberg
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from this
|
||||
# software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Usage:
|
||||
# 1. place AndroidNdkGdb.cmake somewhere inside ${CMAKE_MODULE_PATH}
|
||||
# 2. inside your project add
|
||||
#
|
||||
# include(AndroidNdkGdb)
|
||||
# android_ndk_gdb_enable()
|
||||
# # for each target
|
||||
# add_library(MyLibrary ...)
|
||||
# android_ndk_gdb_debuggable(MyLibrary)
|
||||
|
||||
|
||||
# add gdbserver and general gdb configuration to project
|
||||
# also create a mininal NDK skeleton so ndk-gdb finds the paths
|
||||
#
|
||||
# the optional parameter defines the path to the android project.
|
||||
# uses PROJECT_SOURCE_DIR by default.
|
||||
macro(android_ndk_gdb_enable)
|
||||
if(ANDROID)
|
||||
# create custom target that depends on the real target so it gets executed afterwards
|
||||
add_custom_target(NDK_GDB ALL)
|
||||
|
||||
if(${ARGC})
|
||||
set(ANDROID_PROJECT_DIR ${ARGV0})
|
||||
else()
|
||||
set(ANDROID_PROJECT_DIR ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
set(NDK_GDB_SOLIB_PATH ${ANDROID_PROJECT_DIR}/obj/local/${ANDROID_NDK_ABI_NAME}/)
|
||||
file(MAKE_DIRECTORY ${NDK_GDB_SOLIB_PATH})
|
||||
|
||||
# 1. generate essential Android Makefiles
|
||||
file(MAKE_DIRECTORY ${ANDROID_PROJECT_DIR}/jni)
|
||||
if(NOT EXISTS ${ANDROID_PROJECT_DIR}/jni/Android.mk)
|
||||
file(WRITE ${ANDROID_PROJECT_DIR}/jni/Android.mk "APP_ABI := ${ANDROID_NDK_ABI_NAME}\n")
|
||||
endif()
|
||||
if(NOT EXISTS ${ANDROID_PROJECT_DIR}/jni/Application.mk)
|
||||
file(WRITE ${ANDROID_PROJECT_DIR}/jni/Application.mk "APP_ABI := ${ANDROID_NDK_ABI_NAME}\n")
|
||||
endif()
|
||||
|
||||
# 2. generate gdb.setup
|
||||
get_directory_property(PROJECT_INCLUDES DIRECTORY ${PROJECT_SOURCE_DIR} INCLUDE_DIRECTORIES)
|
||||
string(REGEX REPLACE ";" " " PROJECT_INCLUDES "${PROJECT_INCLUDES}")
|
||||
file(WRITE ${LIBRARY_OUTPUT_PATH}/gdb.setup "set solib-search-path ${NDK_GDB_SOLIB_PATH}\n")
|
||||
file(APPEND ${LIBRARY_OUTPUT_PATH}/gdb.setup "directory ${PROJECT_INCLUDES}\n")
|
||||
|
||||
# 3. copy gdbserver executable
|
||||
file(COPY ${ANDROID_NDK}/prebuilt/android-${ANDROID_ARCH_NAME}/gdbserver/gdbserver DESTINATION ${LIBRARY_OUTPUT_PATH})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# register a target for remote debugging
|
||||
# copies the debug version to NDK_GDB_SOLIB_PATH then strips symbols of original
|
||||
macro(android_ndk_gdb_debuggable TARGET_NAME)
|
||||
if(ANDROID)
|
||||
get_property(TARGET_LOCATION TARGET ${TARGET_NAME} PROPERTY LOCATION)
|
||||
|
||||
# create custom target that depends on the real target so it gets executed afterwards
|
||||
add_dependencies(NDK_GDB ${TARGET_NAME})
|
||||
|
||||
# 4. copy lib to obj
|
||||
add_custom_command(TARGET NDK_GDB POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TARGET_LOCATION} ${NDK_GDB_SOLIB_PATH})
|
||||
|
||||
# 5. strip symbols
|
||||
add_custom_command(TARGET NDK_GDB POST_BUILD COMMAND ${CMAKE_STRIP} ${TARGET_LOCATION})
|
||||
endif()
|
||||
endmacro()
|
||||
58
external/boringssl/util/android-cmake/AndroidNdkModules.cmake
vendored
Normal file
58
external/boringssl/util/android-cmake/AndroidNdkModules.cmake
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# Copyright (c) 2014, Pavel Rojtberg
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from this
|
||||
# software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
macro(android_ndk_import_module_cpufeatures)
|
||||
if(ANDROID)
|
||||
include_directories(${ANDROID_NDK}/sources/android/cpufeatures)
|
||||
add_library(cpufeatures ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
|
||||
target_link_libraries(cpufeatures dl)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(android_ndk_import_module_native_app_glue)
|
||||
if(ANDROID)
|
||||
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
||||
add_library(native_app_glue ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
|
||||
target_link_libraries(native_app_glue log)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(android_ndk_import_module_ndk_helper)
|
||||
if(ANDROID)
|
||||
android_ndk_import_module_cpufeatures()
|
||||
android_ndk_import_module_native_app_glue()
|
||||
|
||||
include_directories(${ANDROID_NDK}/sources/android/ndk_helper)
|
||||
file(GLOB _NDK_HELPER_SRCS ${ANDROID_NDK}/sources/android/ndk_helper/*.cpp ${ANDROID_NDK}/sources/android/ndk_helper/gl3stub.c)
|
||||
add_library(ndk_helper ${_NDK_HELPER_SRCS})
|
||||
target_link_libraries(ndk_helper log android EGL GLESv2 cpufeatures native_app_glue)
|
||||
|
||||
unset(_NDK_HELPER_SRCS)
|
||||
endif()
|
||||
endmacro()
|
||||
240
external/boringssl/util/android-cmake/README.md
vendored
Normal file
240
external/boringssl/util/android-cmake/README.md
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
# android-cmake
|
||||
|
||||
CMake is great, and so is Android. This is a collection of CMake scripts that may be useful to the Android NDK community. It is based on experience from porting OpenCV library to Android: http://opencv.org/platforms/android.html
|
||||
|
||||
Main goal is to share these scripts so that devs that use CMake as their build system may easily compile native code for Android.
|
||||
|
||||
## TL;DR
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=android.toolchain.cmake \
|
||||
-DANDROID_NDK=<ndk_path> \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DANDROID_ABI="armeabi-v7a with NEON" \
|
||||
<source_path>
|
||||
cmake --build .
|
||||
|
||||
One-liner:
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=android.toolchain.cmake -DANDROID_NDK=<ndk_path> -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="armeabi-v7a with NEON" <source_path> && cmake --build .
|
||||
|
||||
_android-cmake_ will search for your NDK install in the following order:
|
||||
|
||||
1. Value of `ANDROID_NDK` CMake variable;
|
||||
1. Value of `ANDROID_NDK` environment variable;
|
||||
1. Search under paths from `ANDROID_NDK_SEARCH_PATHS` CMake variable;
|
||||
1. Search platform specific locations (home folder, Windows "Program Files", etc).
|
||||
|
||||
So if you have installed the NDK as `~/android-ndk-r10d` then _android-cmake_ will locate it automatically.
|
||||
|
||||
## Getting started
|
||||
|
||||
To build a cmake-based C/C++ project for Android you need:
|
||||
|
||||
* Android NDK (>= r5) http://developer.android.com/tools/sdk/ndk/index.html
|
||||
* CMake (>= v2.6.3, >= v2.8.9 recommended) http://www.cmake.org/download
|
||||
|
||||
The _android-cmake_ is also capable to build with NDK from AOSP or Linaro Android source tree, but you may be required to manually specify path to `libm` binary to link with.
|
||||
|
||||
## Difference from traditional CMake
|
||||
|
||||
Folowing the _ndk-build_ the _android-cmake_ supports **only two build targets**:
|
||||
|
||||
* `-DCMAKE_BUILD_TYPE=Release`
|
||||
* `-DCMAKE_BUILD_TYPE=Debug`
|
||||
|
||||
So don't even try other targets that can be found in CMake documentation and don't forget to explicitly specify `Release` or `Debug` because CMake builds without a build configuration by default.
|
||||
|
||||
## Difference from _ndk-build_
|
||||
|
||||
* Latest GCC available in NDK is used as the default compiler;
|
||||
* `Release` builds with `-O3` instead of `-Os`;
|
||||
* `Release` builds without debug info (without `-g`) (because _ndk-build_ always creates a stripped version but cmake delays this for `install/strip` target);
|
||||
* `-fsigned-char` is added to compiler flags to make `char` signed by default as it is on x86/x86_64;
|
||||
* GCC's stack protector is not used neither in `Debug` nor `Release` configurations;
|
||||
* No builds for multiple platforms (e.g. building for both arm and x86 require to run cmake twice with different parameters);
|
||||
* No file level Neon via `.neon` suffix;
|
||||
|
||||
The following features of _ndk-build_ are not supported by the _android-cmake_ yet:
|
||||
|
||||
* `armeabi-v7a-hard` ABI
|
||||
* `libc++_static`/`libc++_shared` STL runtime
|
||||
|
||||
## Basic options
|
||||
|
||||
Similarly to the NDK build system _android-cmake_ allows to select between several compiler toolchains and target platforms. Most of the options can be set either as cmake arguments: `-D<NAME>=<VALUE>` or as environment variables:
|
||||
|
||||
* **ANDROID_NDK** - path to the Android NDK. If not set then _android-cmake_ will search for the most recent version of supported NDK in commonly used locations;
|
||||
* **ANDROID_ABI** - specifies the target Application Binary Interface (ABI). This option nearly matches to the APP_ABI variable used by ndk-build tool from Android NDK. If not specified then set to `armeabi-v7a`. Possible target names are:
|
||||
* `armeabi` - ARMv5TE based CPU with software floating point operations;
|
||||
* **`armeabi-v7a`** - ARMv7 based devices with hardware FPU instructions (VFPv3_D16);
|
||||
* `armeabi-v7a with NEON` - same as armeabi-v7a, but sets NEON as floating-point unit;
|
||||
* `armeabi-v7a with VFPV3` - same as armeabi-v7a, but sets VFPv3_D32 as floating-point unit;
|
||||
* `armeabi-v6 with VFP` - tuned for ARMv6 processors having VFP;
|
||||
* `x86` - IA-32 instruction set
|
||||
* `mips` - MIPS32 instruction set
|
||||
* `arm64-v8a` - ARMv8 AArch64 instruction set - only for NDK r10 and newer
|
||||
* `x86_64` - Intel64 instruction set (r1) - only for NDK r10 and newer
|
||||
* `mips64` - MIPS64 instruction set (r6) - only for NDK r10 and newer
|
||||
* **ANDROID_NATIVE_API_LEVEL** - level of android API to build for. Can be set either to full name (example: `android-8`) or a numeric value (example: `17`). The default API level depends on the target ABI:
|
||||
* `android-8` for ARM;
|
||||
* `android-9` for x86 and MIPS;
|
||||
* `android-21` for 64-bit ABIs.
|
||||
|
||||
Building for `android-L` is possible only when it is explicitly selected.
|
||||
* **ANDROID_TOOLCHAIN_NAME** - the name of compiler toolchain to be used. This option allows to select between different GCC and Clang versions. The list of possible values depends on the NDK version and will be printed by toolchain file if an invalid value is set. By default _android-cmake_ selects the most recent version of GCC which can build for specified `ANDROID_ABI`.
|
||||
|
||||
Example values are:
|
||||
* `aarch64-linux-android-4.9`
|
||||
* `aarch64-linux-android-clang3.5`
|
||||
* `arm-linux-androideabi-4.8`
|
||||
* `arm-linux-androideabi-4.9`
|
||||
* `arm-linux-androideabi-clang3.5`
|
||||
* `mips64el-linux-android-4.9`
|
||||
* `mipsel-linux-android-4.8`
|
||||
* `x86-4.9`
|
||||
* `x86_64-4.9`
|
||||
* etc.
|
||||
* **ANDROID_STL** - the name of C++ runtime to use. The default is `gnustl_static`.
|
||||
* `none` - do not configure the runtime.
|
||||
* `system` - use the default minimal system C++ runtime library.
|
||||
* Implies `-fno-rtti -fno-exceptions`.
|
||||
* `system_re` - use the default minimal system C++ runtime library.
|
||||
* Implies `-frtti -fexceptions`.
|
||||
* `gabi++_static` - use the GAbi++ runtime as a static library.
|
||||
* Implies `-frtti -fno-exceptions`.
|
||||
* Available for NDK r7 and newer.
|
||||
* `gabi++_shared` - use the GAbi++ runtime as a shared library.
|
||||
* Implies `-frtti -fno-exceptions`.
|
||||
* Available for NDK r7 and newer.
|
||||
* `stlport_static` - use the STLport runtime as a static library.
|
||||
* Implies `-fno-rtti -fno-exceptions` for NDK before r7.
|
||||
* Implies `-frtti -fno-exceptions` for NDK r7 and newer.
|
||||
* `stlport_shared` - use the STLport runtime as a shared library.
|
||||
* Implies `-fno-rtti -fno-exceptions` for NDK before r7.
|
||||
* Implies `-frtti -fno-exceptions` for NDK r7 and newer.
|
||||
* **`gnustl_static`** - use the GNU STL as a static library.
|
||||
* Implies `-frtti -fexceptions`.
|
||||
* `gnustl_shared` - use the GNU STL as a shared library.
|
||||
* Implies `-frtti -fno-exceptions`.
|
||||
* Available for NDK r7b and newer.
|
||||
* Silently degrades to `gnustl_static` if not available.
|
||||
* **NDK_CCACHE** - path to `ccache` executable. If not set then initialized from `NDK_CCACHE` environment variable.
|
||||
|
||||
## Advanced _android-cmake_ options
|
||||
|
||||
Normally _android-cmake_ users are not supposed to touch these variables but they might be useful to workaround some build issues:
|
||||
|
||||
* **ANDROID_FORCE_ARM_BUILD** = `OFF` - generate 32-bit ARM instructions instead of Thumb. Applicable only for arm ABIs and is forced to be `ON` for `armeabi-v6 with VFP`;
|
||||
* **ANDROID_NO_UNDEFINED** = `ON` - show all undefined symbols as linker errors;
|
||||
* **ANDROID_SO_UNDEFINED** = `OFF` - allow undefined symbols in shared libraries;
|
||||
* actually it is turned `ON` by default for NDK older than `r7`
|
||||
* **ANDROID_STL_FORCE_FEATURES** = `ON` - automatically configure rtti and exceptions support based on C++ runtime;
|
||||
* **ANDROID_NDK_LAYOUT** = `RELEASE` - inner layout of Android NDK, should be detected automatically. Possible values are:
|
||||
* `RELEASE` - public releases from Google;
|
||||
* `LINARO` - NDK from Linaro project;
|
||||
* `ANDROID` - NDK from AOSP.
|
||||
* **ANDROID_FUNCTION_LEVEL_LINKING** = `ON` - enables saparate putting each function and data items into separate sections and enable garbage collection of unused input sections at link time (`-fdata-sections -ffunction-sections -Wl,--gc-sections`);
|
||||
* **ANDROID_GOLD_LINKER** = `ON` - use gold linker with GCC 4.6 for NDK r8b and newer (only for ARM and x86);
|
||||
* **ANDROID_NOEXECSTACK** = `ON` - enables or disables stack execution protection code (`-Wl,-z,noexecstack`);
|
||||
* **ANDROID_RELRO** = `ON` - Enables RELRO - a memory corruption mitigation technique (`-Wl,-z,relro -Wl,-z,now`);
|
||||
* **ANDROID_LIBM_PATH** - path to `libm.so` (set to something like `$(TOP)/out/target/product/<product_name>/obj/lib/libm.so`) to workaround unresolved `sincos`.
|
||||
|
||||
## Fine-tuning `CMakeLists.txt` for _android-cmake_
|
||||
|
||||
### Recognizing Android build
|
||||
|
||||
_android-cmake_ defines `ANDROID` CMake variable which can be used to add Android-specific stuff:
|
||||
|
||||
if (ANDROID)
|
||||
message(STATUS "Hello from Android build!")
|
||||
endif()
|
||||
|
||||
The recommended way to identify ARM/MIPS/x86 architecture is examining `CMAKE_SYSTEM_PROCESSOR` which is set to the appropriate value:
|
||||
|
||||
* `armv5te` - for `armeabi` ABI
|
||||
* `armv6` - for `armeabi-v6 with VFP` ABI
|
||||
* `armv7-a` - for `armeabi-v7a`, `armeabi-v7a with VFPV3` and `armeabi-v7a with NEON` ABIs
|
||||
* `aarch64` - for `arm64-v8a` ABI
|
||||
* `i686` - for `x86` ABI
|
||||
* `x86_64` - for `x86_64` ABI
|
||||
* `mips` - for `mips` ABI
|
||||
* `mips64` - for `mips64` ABI
|
||||
|
||||
Other variables that are set by _android-cmake_ and can be used for the fine-grained build configuration are:
|
||||
|
||||
* `NEON` - set if target ABI supports Neon;
|
||||
* `ANDROID_NATIVE_API_LEVEL` - native Android API level we are building for (note: Java part of Andoid application can be built for another API level)
|
||||
* `ANDROID_NDK_RELEASE` - version of the Android NDK
|
||||
* `ANDROID_NDK_HOST_SYSTEM_NAME` - "windows", "linux-x86" or "darwin-x86" depending on the host platform
|
||||
* `ANDROID_RTTI` - set if rtti is enabled by the runtime
|
||||
* `ANDROID_EXCEPTIONS` - set if exceptions are enabled by the runtime
|
||||
|
||||
### Finding packages
|
||||
|
||||
When crosscompiling CMake `find_*` commands are normally expected to find libraries and packages belonging to the same build target. So _android-cmake_ configures CMake to search in Android-specific paths only and ignore your host system locations. So
|
||||
|
||||
find_package(ZLIB)
|
||||
|
||||
will surely find libz.so within the Android NDK.
|
||||
|
||||
However sometimes you need to locate a host package even when cross-compiling. For example you can be searching for your documentation generator. The _android-cmake_ recommends you to use `find_host_package` and `find_host_program` macro defined in the `android.toolchain.cmake`:
|
||||
|
||||
find_host_package(Doxygen)
|
||||
find_host_program(PDFLATEX pdflatex)
|
||||
|
||||
However this will break regular builds so instead of wrapping package search into platform-specific logic you can copy the following snippet into your project (put it after your top-level `project()` command):
|
||||
|
||||
# Search packages for host system instead of packages for target system
|
||||
# in case of cross compilation these macro should be defined by toolchain file
|
||||
if(NOT COMMAND find_host_package)
|
||||
macro(find_host_package)
|
||||
find_package(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
if(NOT COMMAND find_host_program)
|
||||
macro(find_host_program)
|
||||
find_program(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
### Compiler flags recycling
|
||||
|
||||
Make sure to do the following in your scripts:
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}")
|
||||
|
||||
The flags will be prepopulated with critical flags, so don't loose them. Also be aware that _android-cmake_ also sets configuration-specific compiler and linker flags.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Building on Windows
|
||||
|
||||
First of all `cygwin` builds are **NOT supported** and will not be supported by _android-cmake_. To build natively on Windows you need a port of make but I recommend http://martine.github.io/ninja/ instead.
|
||||
|
||||
To build with Ninja you need:
|
||||
|
||||
* Ensure you are using CMake newer than 2.8.9;
|
||||
* Download the latest Ninja from https://github.com/martine/ninja/releases;
|
||||
* Put the `ninja.exe` into your PATH (or add path to `ninja.exe` to your PATH environment variable);
|
||||
* Pass `-GNinja` to `cmake` alongside with other arguments (or choose Ninja generator in `cmake-gui`).
|
||||
* Enjoy the fast native multithreaded build :)
|
||||
|
||||
But if you still want to stick to old make then:
|
||||
|
||||
* Get a Windows port of GNU Make:
|
||||
* Android NDK r7 (and newer) already has `make.exe` on board;
|
||||
* `mingw-make` should work as fine;
|
||||
* Download some other port. For example, this one: http://gnuwin32.sourceforge.net/packages/make.htm.
|
||||
* Add path to your `make.exe` to system PATH or always use full path;
|
||||
* Pass `-G"MinGW Makefiles"` and `-DCMAKE_MAKE_PROGRAM="<full/path/to/>make.exe"`
|
||||
* It must be `MinGW Makefiles` and not `Unix Makefiles` even if your `make.exe` is not a MinGW's make.
|
||||
* Run `make.exe` or `cmake --build .` for single-threaded build.
|
||||
|
||||
### Projects with assembler files
|
||||
|
||||
The _android-cmake_ should correctly handle projects with assembler sources (`*.s` or `*.S`). But if you still facing problems with assembler then try to upgrade your CMake to version newer than 2.8.5
|
||||
|
||||
## Copying
|
||||
|
||||
_android-cmake_ is distributed under the terms of [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
|
||||
1693
external/boringssl/util/android-cmake/android.toolchain.cmake
vendored
Normal file
1693
external/boringssl/util/android-cmake/android.toolchain.cmake
vendored
Normal file
File diff suppressed because it is too large
Load Diff
211
external/boringssl/util/android-cmake/ndk_links.md
vendored
Normal file
211
external/boringssl/util/android-cmake/ndk_links.md
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
|
||||
============== r1 ============== (dead links)
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-1.5_r1-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-1.5_r1-darwin-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-1.5_r1-linux-x86.zip
|
||||
|
||||
============== r2 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-1.6_r1-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-1.6_r1-darwin-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-1.6_r1-linux-x86.zip
|
||||
|
||||
============== r3 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r3-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r3-darwin-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r3-linux-x86.zip
|
||||
|
||||
============== r4 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r4-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r4-darwin-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r4-linux-x86.zip
|
||||
|
||||
============== r4b ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r4b-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r4b-darwin-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r4b-linux-x86.zip
|
||||
|
||||
============== r5 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5-linux-x86.tar.bz2
|
||||
|
||||
============== r5b ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5b-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5b-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5b-linux-x86.tar.bz2
|
||||
|
||||
============== r5c ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5c-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5c-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r5c-linux-x86.tar.bz2
|
||||
|
||||
============== r6 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r6-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r6-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r6-linux-x86.tar.bz2
|
||||
|
||||
============== r6b ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r6b-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r6b-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r6b-linux-x86.tar.bz2
|
||||
|
||||
============== r7 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7-linux-x86.tar.bz2
|
||||
|
||||
============== r7b ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7b-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7b-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7b-linux-x86.tar.bz2
|
||||
|
||||
============== r7c ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7c-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7c-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r7c-linux-x86.tar.bz2
|
||||
|
||||
============== r8 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8-linux-x86.tar.bz2
|
||||
|
||||
============== r8b ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8b-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8b-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8b-linux-x86.tar.bz2
|
||||
|
||||
============== r8c ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8c-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8c-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2
|
||||
|
||||
============== r8d ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8d-windows.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8d-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8d-linux-x86.tar.bz2
|
||||
|
||||
============== r8e ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8e-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8e-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8e-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8e-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2
|
||||
|
||||
============== r9 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-windows-x86-legacy-toolchains.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-windows-x86_64-legacy-toolchains.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-darwin-x86-legacy-toolchains.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-darwin-x86_64-legacy-toolchains.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-linux-x86-legacy-toolchains.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64-legacy-toolchains.tar.bz2
|
||||
|
||||
============== r9b ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-windows-x86-legacy-toolchains.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-windows-x86_64-legacy-toolchains.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-darwin-x86-legacy-toolchains.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-darwin-x86_64-legacy-toolchains.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-linux-x86-legacy-toolchains.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-linux-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9b-linux-x86_64-legacy-toolchains.tar.bz2
|
||||
|
||||
============== r9c ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9c-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9c-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9c-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9c-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9c-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9c-linux-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9c-cxx-stl-libs-with-debugging-info.zip
|
||||
|
||||
============== r9d ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9d-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9d-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r9d-cxx-stl-libs-with-debug-info.zip
|
||||
|
||||
============== r10 ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10-linux-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10-linux-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10-cxx-stl-libs-with-debug-info.zip
|
||||
|
||||
============== r10b ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10b-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10b-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10b-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10b-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10b-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk32-r10b-linux-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10b-windows-x86.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10b-windows-x86_64.zip
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10b-darwin-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10b-darwin-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10b-linux-x86.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk64-r10b-linux-x86_64.tar.bz2
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10b-cxx-stl-libs-with-debug-info.zip
|
||||
|
||||
============== r10c ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10c-windows-x86.exe
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10c-windows-x86_64.exe
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10c-darwin-x86.bin
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10c-darwin-x86_64.bin
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10c-linux-x86.bin
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10c-linux-x86_64.bin
|
||||
|
||||
============== r10d ==============
|
||||
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10d-windows-x86.exe
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10d-windows-x86_64.exe
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10d-darwin-x86.bin
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10d-darwin-x86_64.bin
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86.bin
|
||||
* http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin
|
||||
141
external/boringssl/util/bot/DEPS
vendored
Normal file
141
external/boringssl/util/bot/DEPS
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
# Copyright (c) 2015, Google Inc.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
vars = {
|
||||
'chromium_git': 'https://chromium.googlesource.com',
|
||||
}
|
||||
|
||||
deps = {
|
||||
'boringssl/util/bot/gyp':
|
||||
Var('chromium_git') + '/external/gyp.git' + '@' + '4cf07e8d616739f6484e46c9359b2a35196b2585',
|
||||
}
|
||||
|
||||
deps_os = {
|
||||
'android': {
|
||||
'boringssl/util/bot/android_tools':
|
||||
Var('chromium_git') + '/android_tools.git' + '@' + '5b5f2f60b78198eaef25d442ac60f823142a8a6e',
|
||||
},
|
||||
}
|
||||
|
||||
hooks = [
|
||||
{
|
||||
'name': 'cmake_linux64',
|
||||
'pattern': '.',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--platform=linux*',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-tools',
|
||||
'-s', 'boringssl/util/bot/cmake-linux64.tar.gz.sha1',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'cmake_mac',
|
||||
'pattern': '.',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--platform=darwin',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-tools',
|
||||
'-s', 'boringssl/util/bot/cmake-mac.tar.gz.sha1',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'cmake_win32',
|
||||
'pattern': '.',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--platform=win32',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-tools',
|
||||
'-s', 'boringssl/util/bot/cmake-win32.zip.sha1',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'perl_win32',
|
||||
'pattern': '.',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--platform=win32',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-tools',
|
||||
'-s', 'boringssl/util/bot/perl-win32.zip.sha1',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'yasm_win32',
|
||||
'pattern': '.',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--platform=win32',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-tools',
|
||||
'-s', 'boringssl/util/bot/yasm-win32.exe.sha1',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'win_toolchain',
|
||||
'pattern': '.',
|
||||
'action': [ 'python',
|
||||
'boringssl/util/bot/vs_toolchain.py',
|
||||
'update',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'clang',
|
||||
'pattern': '.',
|
||||
'action': [ 'python',
|
||||
'boringssl/util/bot/update_clang.py',
|
||||
],
|
||||
},
|
||||
# TODO(davidben): Only extract archives when they've changed. Extracting perl
|
||||
# on Windows is a significant part of the cycle time.
|
||||
{
|
||||
'name': 'cmake_linux64_extract',
|
||||
'pattern': '.',
|
||||
'action': [ 'python',
|
||||
'boringssl/util/bot/extract.py',
|
||||
'boringssl/util/bot/cmake-linux64.tar.gz',
|
||||
'boringssl/util/bot/cmake-linux64/',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'cmake_mac_extract',
|
||||
'pattern': '.',
|
||||
'action': [ 'python',
|
||||
'boringssl/util/bot/extract.py',
|
||||
'boringssl/util/bot/cmake-mac.tar.gz',
|
||||
'boringssl/util/bot/cmake-mac/',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'cmake_win32_extract',
|
||||
'pattern': '.',
|
||||
'action': [ 'python',
|
||||
'boringssl/util/bot/extract.py',
|
||||
'boringssl/util/bot/cmake-win32.zip',
|
||||
'boringssl/util/bot/cmake-win32/',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'perl_win32_extract',
|
||||
'pattern': '.',
|
||||
'action': [ 'python',
|
||||
'boringssl/util/bot/extract.py',
|
||||
'--no-prefix',
|
||||
'boringssl/util/bot/perl-win32.zip',
|
||||
'boringssl/util/bot/perl-win32/',
|
||||
],
|
||||
},
|
||||
]
|
||||
3
external/boringssl/util/bot/README
vendored
Normal file
3
external/boringssl/util/bot/README
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
This directory contains tools for setting up a hermetic toolchain on the
|
||||
continuous integration bots. It is in the repository for convenience and can be
|
||||
ignored in development.
|
||||
47
external/boringssl/util/bot/UPDATING
vendored
Normal file
47
external/boringssl/util/bot/UPDATING
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
This directory consumes tools from other repositories for use on the
|
||||
bots. To update to newer revisions, follow these instructions:
|
||||
|
||||
DEPS: Set all revisions to those used in Chromium, found at
|
||||
https://chromium.googlesource.com/chromium/src/+/master/DEPS (Search for the
|
||||
corresponding repository name.)
|
||||
|
||||
go/bootstrap.py: Set TOOLSET_VERSION to the latest release of Go, found at
|
||||
https://golang.org/dl/.
|
||||
|
||||
update_clang.py: Set CLANG_REVISION and CLANG_SUB_REVISION to the values used in
|
||||
Chromium, found at
|
||||
https://chromium.googlesource.com/chromium/src/+/master/tools/clang/scripts/update.py
|
||||
|
||||
vs_toolchain.py: Set the hash in TOOLCHAIN_HASH to the toolchain
|
||||
used in Chromium, found at _GetDesiredVsToolchainHashes
|
||||
https://chromium.googlesource.com/chromium/src/+/master/build/vs_toolchain.py
|
||||
This may require taking other updates to that file. If updating MSVS
|
||||
version, also update TOOLCHAIN_VERSION accordingly.
|
||||
|
||||
The .sha1 files correspond to files downloaded from Google Cloud Storage. To
|
||||
update, place the updated files in their intended location and run:
|
||||
|
||||
upload_to_google_storage.py -b chromium-tools FILE
|
||||
|
||||
cmake-linux64.tar.gz: Download the latest CMake source tarball, found at
|
||||
https://cmake.org/download/. Build it with:
|
||||
|
||||
./bootstrap --prefix=$PWD/cmake-linux64 && make && make install
|
||||
tar -czf cmake-linux64.tar.gz cmake-linux64/
|
||||
|
||||
cmake-mac.tar.gz: Follow the same instructions as above on a Mac, but replace
|
||||
cmake-linux64 with cmake-mac.
|
||||
|
||||
cmake-win32.zip: Update to the latest prebuilt release of CMake, found at
|
||||
https://cmake.org/download/. Use the file labeled "Windows ZIP". The
|
||||
download will be named cmake-VERSION-win32-x86.zip.
|
||||
|
||||
perl-win32.zip: Update to the latest 32-bit prebuilt "PortableZip" edition of
|
||||
Strawberry Perl, found at http://strawberryperl.com/releases.html. The
|
||||
download will be named strawberry-perl-VERSION-32bit-portable.zip.
|
||||
|
||||
yasm-win32.exe: Update to the appropriate release of Yasm. Use the same version
|
||||
as Chromium, found at
|
||||
https://chromium.googlesource.com/chromium/src/+/master/third_party/yasm/README.chromium
|
||||
Use the release at http://yasm.tortall.net/Download.html labeled
|
||||
"Win32 .exe". The download will be named yasm-VERSION-win32.exe.
|
||||
1
external/boringssl/util/bot/cmake-linux64.tar.gz.sha1
vendored
Normal file
1
external/boringssl/util/bot/cmake-linux64.tar.gz.sha1
vendored
Normal file
@@ -0,0 +1 @@
|
||||
6ea4ad07a4bab113ea74c45fafb14b8d0b0feab5
|
||||
1
external/boringssl/util/bot/cmake-mac.tar.gz.sha1
vendored
Normal file
1
external/boringssl/util/bot/cmake-mac.tar.gz.sha1
vendored
Normal file
@@ -0,0 +1 @@
|
||||
f3166dab96234c9516ece56dc2851bf4c8e70fe8
|
||||
1
external/boringssl/util/bot/cmake-win32.zip.sha1
vendored
Normal file
1
external/boringssl/util/bot/cmake-win32.zip.sha1
vendored
Normal file
@@ -0,0 +1 @@
|
||||
ed4e1939d246374b0bae724a1a4200fd60e7efe8
|
||||
139
external/boringssl/util/bot/extract.py
vendored
Normal file
139
external/boringssl/util/bot/extract.py
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
# Copyright (c) 2015, Google Inc.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
"""Extracts archives."""
|
||||
|
||||
|
||||
import optparse
|
||||
import os
|
||||
import os.path
|
||||
import tarfile
|
||||
import shutil
|
||||
import sys
|
||||
import zipfile
|
||||
|
||||
|
||||
def CheckedJoin(output, path):
|
||||
"""
|
||||
CheckedJoin returns os.path.join(output, path). It does sanity checks to
|
||||
ensure the resulting path is under output, but shouldn't be used on untrusted
|
||||
input.
|
||||
"""
|
||||
path = os.path.normpath(path)
|
||||
if os.path.isabs(path) or path.startswith('.'):
|
||||
raise ValueError(path)
|
||||
return os.path.join(output, path)
|
||||
|
||||
|
||||
def IterateZip(path):
|
||||
"""
|
||||
IterateZip opens the zip file at path and returns a generator of
|
||||
(filename, mode, fileobj) tuples for each file in it.
|
||||
"""
|
||||
with zipfile.ZipFile(path, 'r') as zip_file:
|
||||
for info in zip_file.infolist():
|
||||
if info.filename.endswith('/'):
|
||||
continue
|
||||
yield (info.filename, None, zip_file.open(info))
|
||||
|
||||
|
||||
def IterateTar(path):
|
||||
"""
|
||||
IterateTar opens the tar.gz file at path and returns a generator of
|
||||
(filename, mode, fileobj) tuples for each file in it.
|
||||
"""
|
||||
with tarfile.open(path, 'r:gz') as tar_file:
|
||||
for info in tar_file:
|
||||
if info.isdir():
|
||||
continue
|
||||
if not info.isfile():
|
||||
raise ValueError('Unknown entry type "%s"' % (info.name, ))
|
||||
yield (info.name, info.mode, tar_file.extractfile(info))
|
||||
|
||||
|
||||
def main(args):
|
||||
parser = optparse.OptionParser(usage='Usage: %prog ARCHIVE OUTPUT')
|
||||
parser.add_option('--no-prefix', dest='no_prefix', action='store_true',
|
||||
help='Do not remove a prefix from paths in the archive.')
|
||||
options, args = parser.parse_args(args)
|
||||
|
||||
if len(args) != 2:
|
||||
parser.print_help()
|
||||
return 1
|
||||
|
||||
archive, output = args
|
||||
|
||||
if not os.path.exists(archive):
|
||||
# Skip archives that weren't downloaded.
|
||||
return 0
|
||||
|
||||
if archive.endswith('.zip'):
|
||||
entries = IterateZip(archive)
|
||||
elif archive.endswith('.tar.gz'):
|
||||
entries = IterateTar(archive)
|
||||
else:
|
||||
raise ValueError(archive)
|
||||
|
||||
try:
|
||||
if os.path.exists(output):
|
||||
print "Removing %s" % (output, )
|
||||
shutil.rmtree(output)
|
||||
|
||||
print "Extracting %s to %s" % (archive, output)
|
||||
prefix = None
|
||||
num_extracted = 0
|
||||
for path, mode, inp in entries:
|
||||
# Even on Windows, zip files must always use forward slashes.
|
||||
if '\\' in path or path.startswith('/'):
|
||||
raise ValueError(path)
|
||||
|
||||
if not options.no_prefix:
|
||||
new_prefix, rest = path.split('/', 1)
|
||||
|
||||
# Ensure the archive is consistent.
|
||||
if prefix is None:
|
||||
prefix = new_prefix
|
||||
if prefix != new_prefix:
|
||||
raise ValueError((prefix, new_prefix))
|
||||
else:
|
||||
rest = path
|
||||
|
||||
# Extract the file into the output directory.
|
||||
fixed_path = CheckedJoin(output, rest)
|
||||
if not os.path.isdir(os.path.dirname(fixed_path)):
|
||||
os.makedirs(os.path.dirname(fixed_path))
|
||||
with open(fixed_path, 'wb') as out:
|
||||
shutil.copyfileobj(inp, out)
|
||||
|
||||
# Fix up permissions if needbe.
|
||||
# TODO(davidben): To be extra tidy, this should only track the execute bit
|
||||
# as in git.
|
||||
if mode is not None:
|
||||
os.chmod(fixed_path, mode)
|
||||
|
||||
# Print every 100 files, so bots do not time out on large archives.
|
||||
num_extracted += 1
|
||||
if num_extracted % 100 == 0:
|
||||
print "Extracted %d files..." % (num_extracted,)
|
||||
finally:
|
||||
entries.close()
|
||||
|
||||
if num_extracted % 100 == 0:
|
||||
print "Done. Extracted %d files." % (num_extracted,)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
296
external/boringssl/util/bot/go/bootstrap.py
vendored
Executable file
296
external/boringssl/util/bot/go/bootstrap.py
vendored
Executable file
@@ -0,0 +1,296 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Modified from go/bootstrap.py in Chromium infrastructure's repository to patch
|
||||
# out everything but the core toolchain.
|
||||
#
|
||||
# https://chromium.googlesource.com/infra/infra/
|
||||
|
||||
"""Prepares a local hermetic Go installation.
|
||||
|
||||
- Downloads and unpacks the Go toolset in ../golang.
|
||||
"""
|
||||
|
||||
import contextlib
|
||||
import logging
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
import tempfile
|
||||
import urllib
|
||||
import zipfile
|
||||
|
||||
# TODO(vadimsh): Migrate to new golang.org/x/ paths once Golang moves to
|
||||
# git completely.
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# /path/to/util/bot
|
||||
ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
# Where to install Go toolset to. GOROOT would be <TOOLSET_ROOT>/go.
|
||||
TOOLSET_ROOT = os.path.join(os.path.dirname(ROOT), 'golang')
|
||||
|
||||
# Default workspace with infra go code.
|
||||
WORKSPACE = os.path.join(ROOT, 'go')
|
||||
|
||||
# Platform depended suffix for executable files.
|
||||
EXE_SFX = '.exe' if sys.platform == 'win32' else ''
|
||||
|
||||
# Pinned version of Go toolset to download.
|
||||
TOOLSET_VERSION = 'go1.6.2'
|
||||
|
||||
# Platform dependent portion of a download URL. See http://golang.org/dl/.
|
||||
TOOLSET_VARIANTS = {
|
||||
('darwin', 'x86-64'): 'darwin-amd64.tar.gz',
|
||||
('linux2', 'x86-32'): 'linux-386.tar.gz',
|
||||
('linux2', 'x86-64'): 'linux-amd64.tar.gz',
|
||||
('win32', 'x86-32'): 'windows-386.zip',
|
||||
('win32', 'x86-64'): 'windows-amd64.zip',
|
||||
}
|
||||
|
||||
# Download URL root.
|
||||
DOWNLOAD_URL_PREFIX = 'https://storage.googleapis.com/golang'
|
||||
|
||||
|
||||
class Failure(Exception):
|
||||
"""Bootstrap failed."""
|
||||
|
||||
|
||||
def get_toolset_url():
|
||||
"""URL of a platform specific Go toolset archive."""
|
||||
# TODO(vadimsh): Support toolset for cross-compilation.
|
||||
arch = {
|
||||
'amd64': 'x86-64',
|
||||
'x86_64': 'x86-64',
|
||||
'i386': 'x86-32',
|
||||
'x86': 'x86-32',
|
||||
}.get(platform.machine().lower())
|
||||
variant = TOOLSET_VARIANTS.get((sys.platform, arch))
|
||||
if not variant:
|
||||
# TODO(vadimsh): Compile go lang from source.
|
||||
raise Failure('Unrecognized platform')
|
||||
return '%s/%s.%s' % (DOWNLOAD_URL_PREFIX, TOOLSET_VERSION, variant)
|
||||
|
||||
|
||||
def read_file(path):
|
||||
"""Returns contents of a given file or None if not readable."""
|
||||
assert isinstance(path, (list, tuple))
|
||||
try:
|
||||
with open(os.path.join(*path), 'r') as f:
|
||||
return f.read()
|
||||
except IOError:
|
||||
return None
|
||||
|
||||
|
||||
def write_file(path, data):
|
||||
"""Writes |data| to a file."""
|
||||
assert isinstance(path, (list, tuple))
|
||||
with open(os.path.join(*path), 'w') as f:
|
||||
f.write(data)
|
||||
|
||||
|
||||
def remove_directory(path):
|
||||
"""Recursively removes a directory."""
|
||||
assert isinstance(path, (list, tuple))
|
||||
p = os.path.join(*path)
|
||||
if not os.path.exists(p):
|
||||
return
|
||||
LOGGER.info('Removing %s', p)
|
||||
# Crutch to remove read-only file (.git/* in particular) on Windows.
|
||||
def onerror(func, path, _exc_info):
|
||||
if not os.access(path, os.W_OK):
|
||||
os.chmod(path, stat.S_IWUSR)
|
||||
func(path)
|
||||
else:
|
||||
raise
|
||||
shutil.rmtree(p, onerror=onerror if sys.platform == 'win32' else None)
|
||||
|
||||
|
||||
def install_toolset(toolset_root, url):
|
||||
"""Downloads and installs Go toolset.
|
||||
|
||||
GOROOT would be <toolset_root>/go/.
|
||||
"""
|
||||
if not os.path.exists(toolset_root):
|
||||
os.makedirs(toolset_root)
|
||||
pkg_path = os.path.join(toolset_root, url[url.rfind('/')+1:])
|
||||
|
||||
LOGGER.info('Downloading %s...', url)
|
||||
download_file(url, pkg_path)
|
||||
|
||||
LOGGER.info('Extracting...')
|
||||
if pkg_path.endswith('.zip'):
|
||||
with zipfile.ZipFile(pkg_path, 'r') as f:
|
||||
f.extractall(toolset_root)
|
||||
elif pkg_path.endswith('.tar.gz'):
|
||||
with tarfile.open(pkg_path, 'r:gz') as f:
|
||||
f.extractall(toolset_root)
|
||||
else:
|
||||
raise Failure('Unrecognized archive format')
|
||||
|
||||
LOGGER.info('Validating...')
|
||||
if not check_hello_world(toolset_root):
|
||||
raise Failure('Something is not right, test program doesn\'t work')
|
||||
|
||||
|
||||
def download_file(url, path):
|
||||
"""Fetches |url| to |path|."""
|
||||
last_progress = [0]
|
||||
def report(a, b, c):
|
||||
progress = int(a * b * 100.0 / c)
|
||||
if progress != last_progress[0]:
|
||||
print >> sys.stderr, 'Downloading... %d%%' % progress
|
||||
last_progress[0] = progress
|
||||
# TODO(vadimsh): Use something less crippled, something that validates SSL.
|
||||
urllib.urlretrieve(url, path, reporthook=report)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def temp_dir(path):
|
||||
"""Creates a temporary directory, then deletes it."""
|
||||
tmp = tempfile.mkdtemp(dir=path)
|
||||
try:
|
||||
yield tmp
|
||||
finally:
|
||||
remove_directory([tmp])
|
||||
|
||||
|
||||
def check_hello_world(toolset_root):
|
||||
"""Compiles and runs 'hello world' program to verify that toolset works."""
|
||||
with temp_dir(toolset_root) as tmp:
|
||||
path = os.path.join(tmp, 'hello.go')
|
||||
write_file([path], r"""
|
||||
package main
|
||||
func main() { println("hello, world\n") }
|
||||
""")
|
||||
out = subprocess.check_output(
|
||||
[get_go_exe(toolset_root), 'run', path],
|
||||
env=get_go_environ(toolset_root, tmp),
|
||||
stderr=subprocess.STDOUT)
|
||||
if out.strip() != 'hello, world':
|
||||
LOGGER.error('Failed to run sample program:\n%s', out)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def ensure_toolset_installed(toolset_root):
|
||||
"""Installs or updates Go toolset if necessary.
|
||||
|
||||
Returns True if new toolset was installed.
|
||||
"""
|
||||
installed = read_file([toolset_root, 'INSTALLED_TOOLSET'])
|
||||
available = get_toolset_url()
|
||||
if installed == available:
|
||||
LOGGER.debug('Go toolset is up-to-date: %s', TOOLSET_VERSION)
|
||||
return False
|
||||
|
||||
LOGGER.info('Installing Go toolset.')
|
||||
LOGGER.info(' Old toolset is %s', installed)
|
||||
LOGGER.info(' New toolset is %s', available)
|
||||
remove_directory([toolset_root])
|
||||
install_toolset(toolset_root, available)
|
||||
LOGGER.info('Go toolset installed: %s', TOOLSET_VERSION)
|
||||
write_file([toolset_root, 'INSTALLED_TOOLSET'], available)
|
||||
return True
|
||||
|
||||
|
||||
def get_go_environ(
|
||||
toolset_root,
|
||||
workspace=None):
|
||||
"""Returns a copy of os.environ with added GO* environment variables.
|
||||
|
||||
Overrides GOROOT, GOPATH and GOBIN. Keeps everything else. Idempotent.
|
||||
|
||||
Args:
|
||||
toolset_root: GOROOT would be <toolset_root>/go.
|
||||
workspace: main workspace directory or None if compiling in GOROOT.
|
||||
"""
|
||||
env = os.environ.copy()
|
||||
env['GOROOT'] = os.path.join(toolset_root, 'go')
|
||||
if workspace:
|
||||
env['GOBIN'] = os.path.join(workspace, 'bin')
|
||||
else:
|
||||
env.pop('GOBIN', None)
|
||||
|
||||
all_go_paths = []
|
||||
if workspace:
|
||||
all_go_paths.append(workspace)
|
||||
env['GOPATH'] = os.pathsep.join(all_go_paths)
|
||||
|
||||
# New PATH entries.
|
||||
paths_to_add = [
|
||||
os.path.join(env['GOROOT'], 'bin'),
|
||||
env.get('GOBIN'),
|
||||
]
|
||||
|
||||
# Make sure not to add duplicates entries to PATH over and over again when
|
||||
# get_go_environ is invoked multiple times.
|
||||
path = env['PATH'].split(os.pathsep)
|
||||
paths_to_add = [p for p in paths_to_add if p and p not in path]
|
||||
env['PATH'] = os.pathsep.join(paths_to_add + path)
|
||||
|
||||
return env
|
||||
|
||||
|
||||
def get_go_exe(toolset_root):
|
||||
"""Returns path to go executable."""
|
||||
return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX)
|
||||
|
||||
|
||||
def bootstrap(logging_level):
|
||||
"""Installs all dependencies in default locations.
|
||||
|
||||
Supposed to be called at the beginning of some script (it modifies logger).
|
||||
|
||||
Args:
|
||||
logging_level: logging level of bootstrap process.
|
||||
"""
|
||||
logging.basicConfig()
|
||||
LOGGER.setLevel(logging_level)
|
||||
ensure_toolset_installed(TOOLSET_ROOT)
|
||||
|
||||
|
||||
def prepare_go_environ():
|
||||
"""Returns dict with environment variables to set to use Go toolset.
|
||||
|
||||
Installs or updates the toolset if necessary.
|
||||
"""
|
||||
bootstrap(logging.INFO)
|
||||
return get_go_environ(TOOLSET_ROOT, WORKSPACE)
|
||||
|
||||
|
||||
def find_executable(name, workspaces):
|
||||
"""Returns full path to an executable in some bin/ (in GOROOT or GOBIN)."""
|
||||
basename = name
|
||||
if EXE_SFX and basename.endswith(EXE_SFX):
|
||||
basename = basename[:-len(EXE_SFX)]
|
||||
roots = [os.path.join(TOOLSET_ROOT, 'go', 'bin')]
|
||||
for path in workspaces:
|
||||
roots.extend([
|
||||
os.path.join(path, 'bin'),
|
||||
])
|
||||
for root in roots:
|
||||
full_path = os.path.join(root, basename + EXE_SFX)
|
||||
if os.path.exists(full_path):
|
||||
return full_path
|
||||
return name
|
||||
|
||||
|
||||
def main(args):
|
||||
if args:
|
||||
print >> sys.stderr, sys.modules[__name__].__doc__,
|
||||
return 2
|
||||
bootstrap(logging.DEBUG)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
49
external/boringssl/util/bot/go/env.py
vendored
Executable file
49
external/boringssl/util/bot/go/env.py
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Modified from go/env.py in Chromium infrastructure's repository to patch out
|
||||
# everything but the core toolchain.
|
||||
#
|
||||
# https://chromium.googlesource.com/infra/infra/
|
||||
|
||||
"""Can be used to point environment variable to hermetic Go toolset.
|
||||
|
||||
Usage (on linux and mac):
|
||||
$ eval `./env.py`
|
||||
$ go version
|
||||
|
||||
Or it can be used to wrap a command:
|
||||
|
||||
$ ./env.py go version
|
||||
"""
|
||||
|
||||
assert __name__ == '__main__'
|
||||
|
||||
import imp
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Do not want to mess with sys.path, load the module directly.
|
||||
bootstrap = imp.load_source(
|
||||
'bootstrap', os.path.join(os.path.dirname(__file__), 'bootstrap.py'))
|
||||
|
||||
old = os.environ.copy()
|
||||
new = bootstrap.prepare_go_environ()
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
for key, value in sorted(new.iteritems()):
|
||||
if old.get(key) != value:
|
||||
print 'export %s="%s"' % (key, value)
|
||||
else:
|
||||
exe = sys.argv[1]
|
||||
if exe == 'python':
|
||||
exe = sys.executable
|
||||
else:
|
||||
# Help Windows to find the executable in new PATH, do it only when
|
||||
# executable is referenced by name (and not by path).
|
||||
if os.sep not in exe:
|
||||
exe = bootstrap.find_executable(exe, [bootstrap.WORKSPACE])
|
||||
sys.exit(subprocess.call([exe] + sys.argv[2:], env=new))
|
||||
1
external/boringssl/util/bot/perl-win32.zip.sha1
vendored
Normal file
1
external/boringssl/util/bot/perl-win32.zip.sha1
vendored
Normal file
@@ -0,0 +1 @@
|
||||
3db2b4964d56f6e23cc48ced40a6cee05419a0af
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user