From 2985bce3210e29b97ded42fe1c436427289fc407 Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 4 Mar 2019 14:11:23 +0000 Subject: [PATCH 1/2] OS-7604 -faggressive-loop-optimizations should be off everywhere Reviewed by: Robert Mustacchi Approved by: Jerry Jelinek --- Makefile.joyent | 7 +++++++ build.sh | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Makefile.joyent b/Makefile.joyent index 7987844..d1cfc26 100644 --- a/Makefile.joyent +++ b/Makefile.joyent @@ -20,6 +20,8 @@ # THE SOFTWARE. # +include $(PWD)/../../../build.env + PROTO_AREA = $(PWD)/../../../proto KERNEL_SOURCE = $(PWD)/../../illumos MDB_SOURCE = $(KERNEL_SOURCE)/usr/src/cmd/mdb @@ -52,6 +54,11 @@ ALWAYS_CFLAGS = \ -Werror \ -fno-inline-functions +# Skip dubious optimizations in later GCCs +ifneq ($(PRIMARY_COMPILER_VER),4) +ALWAYS_CFLAGS += -fno-aggressive-loop-optimizations +endif + USER_CFLAGS = \ -finline \ -gdwarf-2 \ diff --git a/build.sh b/build.sh index 3c54238..0e199f7 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018, Joyent, Inc. +# Copyright (c) 2019, Joyent, Inc. # for dir in seabios vgabios kvm/test; do @@ -13,31 +13,40 @@ PNGINC="${PNGDIR}/proto/usr/local/include" PNGLIB="${PNGDIR}/proto/usr/local/lib" PREFIX="${PREFIX:-/smartdc}" +. $(pwd)/../../../build.env + +# +# Skip dangerous GCC options (not that any specific problems are known of here). +# +if [[ "$PRIMARY_COMPILER_VER" -gt 4 ]]; then + XCFLAGS=-fno-aggressive-loop-optimizations +fi + if [[ ! -d ${PNGDIR} ]]; then - (curl -k https://download.joyent.com/pub/kvm-cmd/libpng-1.5.4.tar.gz | \ - gtar -zxf -) - if [[ $? != "0" || ! -d ${PNGDIR} ]]; then - echo "Failed to get libpng." - rm -rf ${PNGDIR} - exit 1 - fi + (curl -k https://download.joyent.com/pub/kvm-cmd/libpng-1.5.4.tar.gz | \ + gtar -zxf -) + if [[ $? != "0" || ! -d ${PNGDIR} ]]; then + echo "Failed to get libpng." + rm -rf ${PNGDIR} + exit 1 + fi fi if [[ ! -e ${PNGLIB}/libpng.a ]]; then - (cd ${PNGDIR} && \ - CC="${CC:-${DESTDIR}/usr/bin/gcc}" \ - LDFLAGS="-m64 -L${DESTDIR}/usr/lib/amd64 -L${DESTDIR}/lib/amd64" \ - CPPFLAGS="-isystem ${DESTDIR}/usr/include" \ - CFLAGS="-m64" ./configure --disable-shared && \ - make && \ - mkdir -p ${PNGDIR}/proto && \ - make DESTDIR=${PNGDIR}/proto install) + (cd ${PNGDIR} && \ + CC="${CC:-${DESTDIR}/usr/bin/gcc}" \ + LDFLAGS="-m64 -L${DESTDIR}/usr/lib/amd64 -L${DESTDIR}/lib/amd64" \ + CPPFLAGS="-isystem ${DESTDIR}/usr/include" \ + CFLAGS="-m64 $XCFLAGS" ./configure --disable-shared && \ + make && \ + mkdir -p ${PNGDIR}/proto && \ + make DESTDIR=${PNGDIR}/proto install) fi echo "==> Running configure" KVM_DIR="${KVM_DIR:-$(cd `pwd`/../kvm; pwd)}" CC="${CC:-${DESTDIR}/usr/bin/gcc}" -XCFLAGS="-fno-builtin -I${PNGINC} -isystem ${DESTDIR}/usr/include -msave-args" +XCFLAGS+=" -fno-builtin -I${PNGINC} -isystem ${DESTDIR}/usr/include -msave-args" XLDFLAGS="-nodefaultlibs -L${PNGLIB} -L${DESTDIR}/usr/lib/amd64 -L${DESTDIR}/lib/amd64" XLDFLAGS="${XLDFLAGS} -Wl,-zfatal-warnings -Wl,-zassert-deflib" XLDFLAGS="${XLDFLAGS} -lz -lm -lc" From 7318242978b07784a7d7ae535a7b02bdead5478b Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Wed, 27 Mar 2019 08:37:21 +0000 Subject: [PATCH 2/2] Download pre-requisites from OmniOS mirror --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 0e199f7..577e810 100755 --- a/build.sh +++ b/build.sh @@ -23,7 +23,7 @@ if [[ "$PRIMARY_COMPILER_VER" -gt 4 ]]; then fi if [[ ! -d ${PNGDIR} ]]; then - (curl -k https://download.joyent.com/pub/kvm-cmd/libpng-1.5.4.tar.gz | \ + (curl -k https://mirrors.omniosce.org/libpng/libpng-1.5.4.tar.gz | \ gtar -zxf -) if [[ $? != "0" || ! -d ${PNGDIR} ]]; then echo "Failed to get libpng."