[Replicant] [libsamsung-ipc][PATCH 06/10] scripts: guix.scm: Add Replicant 6 TARGET_ERROR_FLAGS

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Sat Feb 13 13:17:45 UTC 2021


The TARGET_ERROR_FLAGS are available from build/core/config.mk
in Replicant 6.

-Werror=non-virtual-dtor was only added to CLANG because it fails
to be recognized with GCC:
    cc1: error: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’
    is not valid for C [-Werror]

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 scripts/guix.scm | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/scripts/guix.scm b/scripts/guix.scm
index 6a03e31..c6e033a 100644
--- a/scripts/guix.scm
+++ b/scripts/guix.scm
@@ -61,18 +61,25 @@
  (gnu packages python-xyz)
  (gnu packages tls))
 
-(define %strict-cflags
+(define %common-strict-cflags
   (string-append
    " CFLAGS="
    " -W"
    " -Wall"
    " -Werror"
+   " -Werror=address"
+   " -Werror=return-type"
+   " -Werror=sequence-point"
    " -Winit-self"
    " -Wno-unused"
    " -Wpointer-arith"
    " -Wunused"
    " -Wunused-function"))
 
+(define %clang-strict-cflags
+  (string-append
+   "-Werror=non-virtual-dtor"))
+
 (define %commit
   (let* ((port (open-input-pipe
                 "git --no-pager log --oneline HEAD -1 --format='%H'"))
@@ -136,7 +143,7 @@ found in many Samsung smartphones and tablets.")
                (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY")
                (("BUILD_STATIC_EXECUTABLE") "BUILD_HOST_STATIC_EXECUTABLE"))
              #t)))
-       #:make-flags (list ,%strict-cflags)))))
+       #:make-flags (list ,%common-strict-cflags)))))
 
 (define-public libsamsung-ipc-gcc-autotools
   (package
@@ -150,7 +157,7 @@ found in many Samsung smartphones and tablets.")
                                    (substitute* (find-files "tools" ".*\\.py$")
                                                 (("/usr/bin/env python") (which "python3")))
                                    #t)))
-      #:make-flags (list ,%strict-cflags)))))
+      #:make-flags (list ,%common-strict-cflags)))))
 
 (define-public libsamsung-ipc-clang-autotools
   (package
@@ -173,7 +180,7 @@ found in many Samsung smartphones and tablets.")
              (substitute* (find-files "tools" ".*\\.py$")
                (("/usr/bin/env python") (which "python3")))
              #t)))
-     #:make-flags (list ,%strict-cflags)))))
+     #:make-flags (list ,%common-strict-cflags ,%clang-strict-cflags)))))
 
 (define-public libsamsung-ipc-clang-android
   (package
@@ -200,7 +207,7 @@ found in many Samsung smartphones and tablets.")
                     (lambda* (#:key inputs #:allow-other-keys)
                       (setenv "CC" "clang")
                       #t)))
-       #:make-flags (list ,%strict-cflags)))))
+       #:make-flags (list ,%common-strict-cflags ,%clang-strict-cflags)))))
 
 ;; Combinaisons:
 ;; +--------------------------------+----------+----------+--------------+--------------+
-- 
2.30.1



More information about the Replicant mailing list