From cbb34022a0408d25791c860e022a580a5d034f51 Mon Sep 17 00:00:00 2001 From: Jens Breitbart Date: Wed, 30 Aug 2017 12:48:57 +0200 Subject: [PATCH] Wshift negative value (#79) + more compiler to travis (#77) - Fixed clang warning `shifting a negative signed value is undefined`. - use more compilers to test HermitCore in Travis --- .travis.yml | 90 +++++++++++++++++++++++++++++++--- arch/x86/include/asm/page.h | 8 +-- arch/x86/loader/include/page.h | 4 +- tools/uhyve.c | 4 +- 4 files changed, 90 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4fee01ba1..d4b0127bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,108 @@ sudo: required dist: trusty +language: c + git: submodules: true -language: c -compiler: - - clang - - gcc + +matrix: + include: + - compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - COMPILERCXX=g++-4.9 + - COMPILERC=gcc-4.9 + - DEPLOY=true + - compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + env: + - COMPILERCXX=g++-5 + - COMPILERC=gcc-5 + - compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - COMPILERCXX=g++-6 + - COMPILERC=gcc-6 + - compiler: clang + env: + - COMPILERC=clang + - COMPILERCXX=clang++ + - CLANGV=3.8.1 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + - compiler: clang + env: + - COMPILERC=clang + - COMPILERCXX=clang++ + - CLANGV=3.9.1 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + - compiler: clang + env: + - COMPILERC=clang + - COMPILERCXX=clang++ + - CLANGV=4.0.1 + - RUNCLANGTIDY=TRUE + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + + before_install: - echo "deb https://dl.bintray.com/rwth-os/hermitcore vivid main" | sudo tee -a /etc/apt/sources.list - travis_retry sudo apt-get -qq update - travis_retry sudo apt-get install -y curl wget qemu-system-x86 nasm texinfo libmpfr-dev libmpc-dev libgmp-dev libisl-dev flex bison packaging-dev rpm - travis_retry sudo apt-get install -y --force-yes binutils-hermit libhermit newlib-hermit pthread-embedded-hermit gcc-hermit - git submodule update --init lwip usr/libomp + # download clang + - mkdir $HOME/clang+llvm + - export PATH=$HOME/clang+llvm/bin:$PATH + - if [ -n "$CLANGV" ]; then wget http://llvm.org/releases/$CLANGV/clang+llvm-$CLANGV-x86_64-linux-gnu-debian8.tar.xz -O $HOME/clang+llvm.tar.xz; fi + - if [ -n "$CLANGV" ]; then tar xf $HOME/clang+llvm.tar.xz -C $HOME/clang+llvm --strip-components 1; fi script: - source cmake/local-cmake.sh - mkdir build - cd build - - cmake .. - - make -j1 package + - cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=true .. + - CC=$COMPILERC CXX=$COMPILERCXX make -j1 package - cd $TRAVIS_BUILD_DIR - ./tests.sh + notifications: slack: hermitcore:UtcfeEXkbpx3WyIDK2Wm2beS deploy: - on: + on: branch: master - condition: "$CC = gcc" + condition: $DEPLOY = true provider: bintray file: .bintray_descriptor.json user: diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h index 1c41dc58e..e273c6f57 100644 --- a/arch/x86/include/asm/page.h +++ b/arch/x86/include/asm/page.h @@ -48,11 +48,11 @@ #define PAGE_SIZE ( 1L << PAGE_BITS) /// Mask the page address without page map flags and XD flag #if 0 -#define PAGE_MASK ((~0L) << PAGE_BITS) -#define PAGE_2M_MASK (~0L) << PAGE_2M_BITS) +#define PAGE_MASK ((~0UL) << PAGE_BITS) +#define PAGE_2M_MASK (~0UL) << PAGE_2M_BITS) #else -#define PAGE_MASK (((~0L) << PAGE_BITS) & ~PG_XD) -#define PAGE_2M_MASK (((~0L) << PAGE_2M_BITS) & ~PG_XD) +#define PAGE_MASK (((~0UL) << PAGE_BITS) & ~PG_XD) +#define PAGE_2M_MASK (((~0UL) << PAGE_2M_BITS) & ~PG_XD) #endif #if 0 diff --git a/arch/x86/loader/include/page.h b/arch/x86/loader/include/page.h index adf46fc72..8e93f7259 100644 --- a/arch/x86/loader/include/page.h +++ b/arch/x86/loader/include/page.h @@ -37,9 +37,9 @@ #define PAGE_SIZE ( 1L << PAGE_BITS) /// Mask the page address without page map flags and XD flag #ifdef CONFIG_X86_32 -#define PAGE_MASK (-1L << PAGE_BITS) +#define PAGE_MASK (~0UL << PAGE_BITS) #elif defined(CONFIG_X86_64) -#define PAGE_MASK ((-1L << PAGE_BITS) & ~PG_XD) +#define PAGE_MASK ((~0UL << PAGE_BITS) & ~PG_XD) #endif #ifdef CONFIG_X86_32 diff --git a/tools/uhyve.c b/tools/uhyve.c index 64298e1bf..3de888634 100644 --- a/tools/uhyve.c +++ b/tools/uhyve.c @@ -100,8 +100,8 @@ #define PAGE_MASK ((~0L) << PAGE_BITS) #define PAGE_2M_MASK (~0L) << PAGE_2M_BITS) #else -#define PAGE_MASK (((~0L) << PAGE_BITS) & ~PG_XD) -#define PAGE_2M_MASK (((~0L) << PAGE_2M_BITS) & ~PG_XD) +#define PAGE_MASK (((~0UL) << PAGE_BITS) & ~PG_XD) +#define PAGE_2M_MASK (((~0UL) << PAGE_2M_BITS) & ~PG_XD) #endif // Page is present