summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rwxr-xr-xautomation/taskcluster/docker-arm/setup.sh4
-rw-r--r--automation/taskcluster/docker/setup.sh10
-rw-r--r--automation/taskcluster/graph/src/extend.js33
-rwxr-xr-xautomation/taskcluster/scripts/build.sh3
-rwxr-xr-xautomation/taskcluster/scripts/build_gyp.sh3
-rwxr-xr-xautomation/taskcluster/scripts/gen_certs.sh3
-rwxr-xr-xautomation/taskcluster/scripts/run_scan_build.sh6
-rwxr-xr-xautomation/taskcluster/scripts/run_tests.sh3
-rw-r--r--automation/taskcluster/scripts/tools.sh13
-rw-r--r--coreconf/Darwin.mk8
-rw-r--r--coreconf/Linux.mk8
12 files changed, 34 insertions, 66 deletions
diff --git a/Makefile b/Makefile
index 6a2e453ed..32f822cee 100644
--- a/Makefile
+++ b/Makefile
@@ -85,6 +85,12 @@ endif
ifdef NS_USE_GCC
NSPR_CONFIGURE_ENV = CC=gcc CXX=g++
endif
+ifdef CC
+NSPR_CONFIGURE_ENV = CC=$(CC)
+endif
+ifdef CCC
+NSPR_CONFIGURE_ENV += CXX=$(CCC)
+endif
ifdef SANITIZER_CFLAGS
ifdef BUILD_OPT
diff --git a/automation/taskcluster/docker-arm/setup.sh b/automation/taskcluster/docker-arm/setup.sh
index e1b558170..42d66a454 100755
--- a/automation/taskcluster/docker-arm/setup.sh
+++ b/automation/taskcluster/docker-arm/setup.sh
@@ -24,10 +24,6 @@ apt-get install -y --no-install-recommends ${apt_packages[@]}
pip install --upgrade pip
pip install Mercurial
-# Compiler options.
-update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 30
-update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 30
-
locale-gen en_US.UTF-8
dpkg-reconfigure locales
diff --git a/automation/taskcluster/docker/setup.sh b/automation/taskcluster/docker/setup.sh
index d0338b0a1..77caa3bac 100644
--- a/automation/taskcluster/docker/setup.sh
+++ b/automation/taskcluster/docker/setup.sh
@@ -48,16 +48,6 @@ ln -s /usr/include/x86_64-linux-gnu/zconf.h /usr/include
# Install clang-3.9 into /usr/local/.
curl http://llvm.org/releases/3.9.0/clang+llvm-3.9.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz | tar xJv -C /usr/local --strip-components=1
-# Compiler options.
-update-alternatives --install /usr/bin/gcc gcc /usr/local/bin/clang 5
-update-alternatives --install /usr/bin/g++ g++ /usr/local/bin/clang++ 5
-update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
-update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
-update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 20
-update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 20
-update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 30
-update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 30
-
locale-gen en_US.UTF-8
dpkg-reconfigure locales
diff --git a/automation/taskcluster/graph/src/extend.js b/automation/taskcluster/graph/src/extend.js
index ec25ceb93..5caca8fa7 100644
--- a/automation/taskcluster/graph/src/extend.js
+++ b/automation/taskcluster/graph/src/extend.js
@@ -39,6 +39,11 @@ queue.filter(task => {
if (task.symbol == "gcc-5" && task.collection != "asan") {
return false;
}
+
+ // Remove extra builds on gyp builds (TODO: add when it supports CC/CCC).
+ if (task.collection == "gyp") {
+ return false;
+ }
}
if (task.tests == "bogo") {
@@ -125,8 +130,8 @@ export default async function main() {
env: {
NSS_DISABLE_ARENA_FREE_LIST: "1",
NSS_DISABLE_UNLOAD: "1",
- GCC_VERSION: "clang",
- GXX_VERSION: "clang++",
+ CC: "clang",
+ CCC: "clang++",
USE_ASAN: "1",
USE_64: "1"
},
@@ -140,8 +145,8 @@ export default async function main() {
UBSAN_OPTIONS: "print_stacktrace=1",
NSS_DISABLE_ARENA_FREE_LIST: "1",
NSS_DISABLE_UNLOAD: "1",
- GCC_VERSION: "clang",
- GXX_VERSION: "clang++",
+ CC: "clang",
+ CCC: "clang++",
USE_UBSAN: "1",
USE_ASAN: "1",
USE_64: "1"
@@ -222,8 +227,8 @@ async function scheduleLinux(name, base) {
queue.scheduleTask(merge(extra_base, {
name: `${name} w/ clang-3.9`,
env: {
- GCC_VERSION: "clang",
- GXX_VERSION: "clang++"
+ CC: "clang",
+ CCC: "clang++",
},
symbol: "clang-3.9"
}));
@@ -231,8 +236,8 @@ async function scheduleLinux(name, base) {
queue.scheduleTask(merge(extra_base, {
name: `${name} w/ gcc-4.8`,
env: {
- GCC_VERSION: "gcc-4.8",
- GXX_VERSION: "g++-4.8"
+ CC: "gcc-4.8",
+ CCC: "g++-4.8"
},
symbol: "gcc-4.8"
}));
@@ -240,8 +245,8 @@ async function scheduleLinux(name, base) {
queue.scheduleTask(merge(extra_base, {
name: `${name} w/ gcc-5`,
env: {
- GCC_VERSION: "gcc-5",
- GXX_VERSION: "g++-5"
+ CC: "gcc-5",
+ CCC: "g++-5"
},
symbol: "gcc-5"
}));
@@ -249,8 +254,8 @@ async function scheduleLinux(name, base) {
queue.scheduleTask(merge(extra_base, {
name: `${name} w/ gcc-6.1`,
env: {
- GCC_VERSION: "gcc-6",
- GXX_VERSION: "g++-6"
+ CC: "gcc-6",
+ CCC: "g++-6"
},
symbol: "gcc-6.1"
}));
@@ -413,8 +418,8 @@ async function scheduleTools() {
name: "scan-build-3.9",
env: {
USE_64: "1",
- GCC_VERSION: "clang",
- GXX_VERSION: "clang++"
+ CC: "clang",
+ CCC: "clang++",
},
artifacts: {
public: {
diff --git a/automation/taskcluster/scripts/build.sh b/automation/taskcluster/scripts/build.sh
index 34300f348..69968b138 100755
--- a/automation/taskcluster/scripts/build.sh
+++ b/automation/taskcluster/scripts/build.sh
@@ -3,9 +3,6 @@
source $(dirname $0)/tools.sh
if [[ $(id -u) -eq 0 ]]; then
- # Set compiler.
- switch_compilers
-
# Drop privileges by re-running this script.
exec su worker $0
fi
diff --git a/automation/taskcluster/scripts/build_gyp.sh b/automation/taskcluster/scripts/build_gyp.sh
index b2bd57a98..fc3ce0180 100755
--- a/automation/taskcluster/scripts/build_gyp.sh
+++ b/automation/taskcluster/scripts/build_gyp.sh
@@ -3,9 +3,6 @@
source $(dirname $0)/tools.sh
if [[ $(id -u) -eq 0 ]]; then
- # Set compiler.
- switch_compilers
-
# Drop privileges by re-running this script.
exec su worker $0
fi
diff --git a/automation/taskcluster/scripts/gen_certs.sh b/automation/taskcluster/scripts/gen_certs.sh
index 56b690d67..aee100147 100755
--- a/automation/taskcluster/scripts/gen_certs.sh
+++ b/automation/taskcluster/scripts/gen_certs.sh
@@ -5,9 +5,6 @@ set -v -e -x
source $(dirname $0)/tools.sh
if [ $(id -u) = 0 ]; then
- # Set compiler.
- switch_compilers
-
# Stupid Docker.
echo "127.0.0.1 localhost.localdomain" >> /etc/hosts
diff --git a/automation/taskcluster/scripts/run_scan_build.sh b/automation/taskcluster/scripts/run_scan_build.sh
index 0e97a185a..8f19daac0 100755
--- a/automation/taskcluster/scripts/run_scan_build.sh
+++ b/automation/taskcluster/scripts/run_scan_build.sh
@@ -3,10 +3,6 @@
source $(dirname $0)/tools.sh
if [ $(id -u) = 0 ]; then
-
- # Set compiler.
- switch_compilers
-
# Drop privileges by re-running this script.
exec su worker $0 $@
fi
@@ -35,7 +31,7 @@ for i in "${!scan[@]}"; do
done
# run scan-build (only building affected directories)
-scan-build -o /home/worker/artifacts make nss_build_all && cd ..
+scan-build -o /home/worker/artifacts --use-cc=$(CC) --use-c++=$(CCC) make nss_build_all && cd ..
# print errors we found
set +v +x
diff --git a/automation/taskcluster/scripts/run_tests.sh b/automation/taskcluster/scripts/run_tests.sh
index c05b3130e..4c87e7e32 100755
--- a/automation/taskcluster/scripts/run_tests.sh
+++ b/automation/taskcluster/scripts/run_tests.sh
@@ -3,9 +3,6 @@
source $(dirname $0)/tools.sh
if [ $(id -u) = 0 ]; then
- # Set compiler.
- switch_compilers
-
# Stupid Docker.
echo "127.0.0.1 localhost.localdomain" >> /etc/hosts
diff --git a/automation/taskcluster/scripts/tools.sh b/automation/taskcluster/scripts/tools.sh
index 632c909c2..dacfdeb28 100644
--- a/automation/taskcluster/scripts/tools.sh
+++ b/automation/taskcluster/scripts/tools.sh
@@ -2,19 +2,6 @@
set -v -e -x
-switch_compilers() {
- GCC=`which ${GCC_VERSION:-gcc-5}`
- GXX=`which ${GXX_VERSION:-g++-5}`
-
- if [ -e "$GCC" ] && [ -e "$GXX" ]; then
- update-alternatives --set gcc $GCC
- update-alternatives --set g++ $GXX
- else
- echo "Unknown compiler $GCC_VERSION/$GXX_VERSION."
- exit 1
- fi
-}
-
# Usage: hg_clone repo dir [revision=@]
hg_clone() {
repo=$1
diff --git a/coreconf/Darwin.mk b/coreconf/Darwin.mk
index 7bd92fd2c..210784767 100644
--- a/coreconf/Darwin.mk
+++ b/coreconf/Darwin.mk
@@ -3,15 +3,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+CC ?= gcc
+CCC ?= g++
+RANLIB ?= ranlib
+
include $(CORE_DEPTH)/coreconf/UNIX.mk
include $(CORE_DEPTH)/coreconf/Werror.mk
DEFAULT_COMPILER = gcc
-CC = gcc
-CCC = g++
-RANLIB = ranlib
-
ifndef CPU_ARCH
# When cross-compiling, CPU_ARCH should already be defined as the target
# architecture, set to powerpc or i386.
diff --git a/coreconf/Linux.mk b/coreconf/Linux.mk
index 5747c5364..438dab48a 100644
--- a/coreconf/Linux.mk
+++ b/coreconf/Linux.mk
@@ -3,6 +3,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+CC ?= gcc
+CCC ?= g++
+RANLIB ?= ranlib
+
include $(CORE_DEPTH)/coreconf/UNIX.mk
#
@@ -16,10 +20,6 @@ ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
endif
-CC = gcc
-CCC = g++
-RANLIB = ranlib
-
DEFAULT_COMPILER = gcc
ifeq ($(OS_TARGET),Android)