Skip to contentSkip to conversation

userspace: Fix DEBUG=1 build

PATCH In review Ondrej Mosnacek 2 participants 5 messages Feb 6, 2020 – Feb 10, 2020 SELinux security module

lore
Share & tools
lore
#0 lore raw

cover userspace: Fix DEBUG=1 build

...and add it to the Travis CI matrix.

Passed Travis: https://travis-ci.org/WOnder93/selinux/builds/646830495
Failed new test without the fix: https://travis-ci.org/WOnder93/selinux/builds/646833909

Ondrej Mosnacek (2):
libsemanage: preserve parent Makefile's flags in debug mode
Travis-CI: test that DEBUG build works

 .travis.yml              | 3 +++
 libsemanage/src/Makefile | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/2 libsemanage: preserve parent Makefile's flags in debug mode

Do not override CFLAGS and LDFLAGS in libsemange Makefile under DEBUG=1, to make it possible to build the whole tree using the root Makefile with DEBUG=1.

---
 libsemanage/src/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
libsemanage/src/Makefile +2 -2
index 8a9570c7..f6780dc6 100644
@@ -22,8 +22,8 @@ RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')
 DEFAULT_SEMANAGE_CONF_LOCATION=/etc/selinux/semanage.conf
 
 ifeq ($(DEBUG),1)
-	export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror
-	export LDFLAGS = -g
+	export CFLAGS ?= -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror
+	export LDFLAGS ?= -g
 endif
 
 LEX = flex
Signature · 1 line
2.24.1
#2 lore raw

PATCH 2/2 Travis-CI: test that DEBUG build works

In reply to Ondrej Mosnacek
---
 .travis.yml | 3 +++
 1 file changed, 3 insertions(+)
.travis.yml +3 -0
index e9f86baa..918958ac 100644
@@ -13,6 +13,7 @@ env:
     # Test the last version of Python and Ruby together, with some linkers
     - PYVER=python3.7 RUBYLIBVER=2.6
     - PYVER=python3.7 RUBYLIBVER=2.6 TEST_FLAGS_OVERRIDE=1
+    - PYVER=python3.7 RUBYLIBVER=2.6 TEST_DEBUG=1
     - PYVER=python3.7 RUBYLIBVER=2.6 LINKER=gold
     - PYVER=python3.7 RUBYLIBVER=2.6 LINKER=bfd
 
@@ -116,6 +117,8 @@ before_script:
 
   # If TEST_FLAGS_OVERRIDE is defined, test that overriding CFLAGS, LDFLAGS and other variables works fine
   - if [ -n "$TEST_FLAGS_OVERRIDE" ]; then EXPLICIT_MAKE_VARS="CFLAGS=-I$DESTDIR/usr/include LDFLAGS=-L$DESTDIR/usr/lib LDLIBS= CPPFLAGS=" ; fi
+  # If TEST_DEBUG is defined, test that debug build works fine
+  - if [ -n "$TEST_DEBUG" ]; then EXPLICIT_MAKE_VARS="$EXPLICIT_MAKE_VARS DEBUG=1" ; fi
 
 script:
   # Start by installing everything into $DESTDIR
Signature · 1 line
2.24.1
Acked-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] Travis-CI: test that DEBUG build works

Quoted 1 line · Ondrej Mosnacek
Quoted 26 lines
---
  .travis.yml | 3 +++
  1 file changed, 3 insertions(+)
.travis.yml +3 -0
index e9f86baa..918958ac 100644
@@ -13,6 +13,7 @@ env:
      # Test the last version of Python and Ruby together, with some linkers
      - PYVER=python3.7 RUBYLIBVER=2.6
      - PYVER=python3.7 RUBYLIBVER=2.6 TEST_FLAGS_OVERRIDE=1
+    - PYVER=python3.7 RUBYLIBVER=2.6 TEST_DEBUG=1
      - PYVER=python3.7 RUBYLIBVER=2.6 LINKER=gold
      - PYVER=python3.7 RUBYLIBVER=2.6 LINKER=bfd
 
@@ -116,6 +117,8 @@ before_script:
 
    # If TEST_FLAGS_OVERRIDE is defined, test that overriding CFLAGS, LDFLAGS and other variables works fine
    - if [ -n "$TEST_FLAGS_OVERRIDE" ]; then EXPLICIT_MAKE_VARS="CFLAGS=-I$DESTDIR/usr/include LDFLAGS=-L$DESTDIR/usr/lib LDLIBS= CPPFLAGS=" ; fi
+  # If TEST_DEBUG is defined, test that debug build works fine
+  - if [ -n "$TEST_DEBUG" ]; then EXPLICIT_MAKE_VARS="$EXPLICIT_MAKE_VARS DEBUG=1" ; fi
 
  script:
    # Start by installing everything into $DESTDIR