- sudo add-apt-repository ppa:ubuntu-lxc/daily -y
- sudo apt-get update -qq
- sudo apt-get install -qq coccinelle parallel libapparmor-dev libcap-dev libseccomp-dev python3-dev python3-setuptools docbook2x libgnutls-dev libselinux1-dev linux-libc-dev
-script:
- - ./coccinelle/run-coccinelle.sh -i
- - git diff --exit-code
- - export CFLAGS="-Wall -Werror"
- - export LDFLAGS="-pthread -lpthread"
- - ./autogen.sh
- - rm -Rf build
- - mkdir build
- - cd build
- - ../configure --enable-tests --with-distro=unknown
- - make -j4
- - make DESTDIR=$TRAVIS_BUILD_DIR/install install
- - cd ../config/apparmor
- - ./lxc-generate-aa-rules.py container-rules.base > /tmp/output
- - diff /tmp/output container-rules
-
+script: src/tests/travis.sh
notifications:
email:
recipients:
[enable_asan=$enableval], [enable_asan=no])
AM_CONDITIONAL([ENABLE_ASAN], [test "x$enable_asan" = "xyes"])
+# Build with UBSAN commands
+AC_ARG_ENABLE([ubsan],
+ [AS_HELP_STRING([--enable-ubsan], [build with ubsan sanitizer enabled [default=no]])],
+ [enable_asan=$enableval], [enable_ubsan=no])
+AM_CONDITIONAL([ENABLE_UBSAN], [test "x$enable_ubsan" = "xyes"])
+
# Optional test binaries
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],
liblxc_la_CFLAGS = -fPIC \
-DPIC \
$(AM_CFLAGS) \
+ $(LIBLXC_SANITIZER) \
-pthread
if ENABLE_ASAN
liblxc_la_CFLAGS += -fsanitize=address \
-fno-omit-frame-pointer
endif
+if ENABLE_UBSAN
+liblxc_la_CFLAGS += -fsanitize=undefined
+endif
+
liblxc_la_LDFLAGS = -pthread \
-Wl,-no-undefined \
-Wl,-soname,liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) \
--- /dev/null
+#! /bin/bash
+
+set -e
+
+./coccinelle/run-coccinelle.sh -i
+git diff --exit-code
+export CFLAGS="-Wall -Werror"
+export LDFLAGS="-pthread -lpthread"
+./autogen.sh
+rm -Rf build
+mkdir build
+cd build
+if [ "$CC_FOR_BUILD" == "gcc" ]; then
+ ../configure --enable-tests --enable-ubsan --with-distro=unknown
+else
+ ../configure --enable-tests --with-distro=unknown
+fi
+make -j4
+make DESTDIR="$TRAVIS_BUILD_DIR"/install install
+cd ../config/apparmor
+./lxc-generate-aa-rules.py container-rules.base > /tmp/output
+diff /tmp/output container-rules