Skip to contentSkip to conversation

liboil: Fix build with clang

PATCH New Khem Raj 1 participant 6 messages Feb 13, 2019 Arm STM32

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/6 liboil: Fix build with clang

---
 ...onvert-fldmia-fstmia-instructions-to.patch | 257 ++++++++++++++++++
 .../recipes-support/liboil/liboil_0.3.17.bb   |   3 +-
 2 files changed, 259 insertions(+), 1 deletion(-)
 create mode 100644 meta-multimedia/recipes-support/liboil/liboil-0.3.17/0001-math_vfp_asm.S-Convert-fldmia-fstmia-instructions-to.patch
meta-multimedia/recipes-support/liboil/liboil-0.3.17/0001-math_vfp_asm.S-Convert-fldmia-fstmia-instructions-to.patch new file +257 -0
new file mode 100644
index 0000000000..05903807e0
@@ -0,0 +1,257 @@
+From 02a138f0b247fb08b799f32c49b35912b2921321 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 12 Feb 2019 11:38:46 -0800
+Subject: [PATCH] math_vfp_asm.S: Convert fldmia/fstmia instructions to UAL
+ syntax for clang
+
+This is flagged with clang internal assembler, since it does not allow
+non UAL syntax
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ liboil/arm/math_vfp_asm.S | 94 +++++++++++++++++++--------------------
+ 1 file changed, 47 insertions(+), 47 deletions(-)
+
+diff --git a/liboil/arm/math_vfp_asm.S b/liboil/arm/math_vfp_asm.S
+index ae5c803..3dd14d9 100644
+--- a/liboil/arm/math_vfp_asm.S
++++ b/liboil/arm/math_vfp_asm.S
+@@ -25,7 +25,7 @@
+  */
+ 
+ #if defined(__VFP_FP__) && !defined(__SOFTFP__)
+-/* 
++/*
+ ** compile with -mcpu=arm1136j-s -mfpu=vfp -mfloat-abi=softfp
+ **
+ ** void vfp_add_f32 (float *d, const float *s1, const float *s2, int n);
+@@ -48,10 +48,10 @@
+     ands          ip, r3, #7;               /* ip = n % 8 */                  \
+     beq           vfp_ ## fname ## _unroll; /* if ip == 0 goto prep_loop2 */  \
+   vfp_ ## fname ## _loop1:                                                    \
+-    fldmias       r1!, {s0};                                                  \
+-    fldmias       r2!, {s1};                                                  \
++    vldmia.f32       r1!, {s0};                                                  \
++    vldmia.f32       r2!, {s1};                                                  \
+     ## finst ##s  s2, s0, s1;                                                 \
+-    fstmias       r0!, {s2};                                                  \
++    vstmia.f32       r0!, {s2};                                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop1;                                    \
+   vfp_ ## fname ## _unroll:                 /* unroll by 8 */                 \
+@@ -62,15 +62,15 @@
+     orr           fp, lr, fp, lsl #16;      /* set vector lenght to 8 */      \
+     fmxr          fpscr, fp;                                                  \
+   vfp_ ## fname ## _loop2:                                                    \
+-    fldmias       r1!, {s8, s9, s10, s11, s12, s13, s14, s15};                \
+-    fldmias       r2!, {s16, s17, s18, s19, s20, s21, s22, s23};              \
++    vldmia.f32       r1!, {s8, s9, s10, s11, s12, s13, s14, s15};                \
++    vldmia.f32       r2!, {s16, s17, s18, s19, s20, s21, s22, s23};              \
+     ## finst ##s  s24, s8, s16;                                               \
+-    fstmias       r0!, {s24, s25, s26, s27, s28, s29, s30, s31};              \
++    vstmia.f32       r0!, {s24, s25, s26, s27, s28, s29, s30, s31};              \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop2;                                    \
+     fmxr          fpscr, lr;                /* restore original fpscr */      \
+   vfp_ ## fname ## _end:                                                      \
+-    ldmia         sp!, {fp, pc};        /* recovering from stack and return */   
++    ldmia         sp!, {fp, pc};        /* recovering from stack and return */
+ 
+ #define UNROLL_F64_TEMPLATE(fname,finst) \
+   .global vfp_ ## fname ## ;                                                  \
+@@ -79,10 +79,10 @@
+     ands          ip, r3, #3;               /* ip = n % 3 */                  \
+     beq           vfp_ ## fname ## _unroll; /* if ip == 0 goto prep_loop2 */  \
+   vfp_ ## fname ## _loop1:                                                    \
+-    fldmiad       r1!, {d0};                                                  \
+-    fldmiad       r2!, {d1};                                                  \
++    vldmia.f64       r1!, {d0};                                                  \
++    vldmia.f64       r2!, {d1};                                                  \
+     ## finst ##d  d2, d0, d1;                                                 \
+-    fstmiad       r0!, {d2};                                                  \
++    vstmia.f64       r0!, {d2};                                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop1;                                    \
+   vfp_ ## fname ## _unroll:                 /* unroll by 4 */                 \
+@@ -93,15 +93,15 @@
+     orr           fp, lr, fp, lsl #16;      /* set vector lenght to 8 */      \
+     fmxr          fpscr, fp;                                                  \
+   vfp_ ## fname ## _loop2:                                                    \
+-    fldmiad       r1!, {d4, d5, d6, d7};                                      \
+-    fldmiad       r2!, {d8, d9, d10, d11};                                    \
++    vldmia.f64       r1!, {d4, d5, d6, d7};                                      \
++    vldmia.f64       r2!, {d8, d9, d10, d11};                                    \
+     ## finst ##d  d12, d4, d8;                                                \
+-    fstmiad       r0!, {d12, d13, d14, d15};                                  \
++    vstmia.f64       r0!, {d12, d13, d14, d15};                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop2;                                    \
+     fmxr          fpscr, lr;                /* restore original fpscr */      \
+   vfp_ ## fname ## _end:                                                      \
+-    ldmia         sp!, {fp, pc};        /* recovering from stack and return */   
++    ldmia         sp!, {fp, pc};        /* recovering from stack and return */
+ 
+ .align 2
+ UNROLL_F32_TEMPLATE(add_f32,fadd);
+@@ -119,7 +119,7 @@ UNROLL_F64_TEMPLATE(subtract_f64,fsub);
+ #undef UNROLL_F32_TEMPLATE
+ #undef UNROLL_F64_TEMPLATE
+ 
+-/* 
++/*
+ **
+ ** void vfp_scalaradd_f32_ns (float *d, const float *s1, const float *s2_1, int n);
+ ** void vfp_scalaradd_f64_ns (double *d, const double *s1, const double *s2_1, int n);
+@@ -133,13 +133,13 @@ UNROLL_F64_TEMPLATE(subtract_f64,fsub);
+   .global vfp_ ## fname ## ;                                                  \
+   vfp_ ## fname ## :                                                          \
+     stmdb         sp!, {fp, lr};            /* save registers to stack */     \
+-    fldmias       r2, {s1};                 /* load scalar value */           \
++    vldmia.f32       r2, {s1};                 /* load scalar value */           \
+     ands          ip, r3, #7;               /* ip = n % 8 */                  \
+     beq           vfp_ ## fname ## _unroll; /* if ip == 0 goto prep_loop2 */  \
+   vfp_ ## fname ## _loop1:                                                    \
+-    fldmias       r1!, {s0};                                                  \
++    vldmia.f32       r1!, {s0};                                                  \
+     ## finst ##s  s2, s0, s1;                                                 \
+-    fstmias       r0!, {s2};                                                  \
++    vstmia.f32       r0!, {s2};                                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop1;                                    \
+   vfp_ ## fname ## _unroll:                 /* unroll by 8 */                 \
+@@ -150,26 +150,26 @@ UNROLL_F64_TEMPLATE(subtract_f64,fsub);
+     orr           fp, lr, fp, lsl #16;      /* set vector lenght to 8 */      \
+     fmxr          fpscr, fp;                                                  \
+   vfp_ ## fname ## _loop2:                                                    \
+-    fldmias       r1!, {s8, s9, s10, s11, s12, s13, s14, s15};                \
++    vldmia.f32       r1!, {s8, s9, s10, s11, s12, s13, s14, s15};                \
+     ## finst ##s  s24, s8, s1;                                                \
+-    fstmias       r0!, {s24, s25, s26, s27, s28, s29, s30, s31};              \
++    vstmia.f32       r0!, {s24, s25, s26, s27, s28, s29, s30, s31};              \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop2;                                    \
+     fmxr          fpscr, lr;                /* restore original fpscr */      \
+   vfp_ ## fname ## _end:                                                      \
+-    ldmia         sp!, {fp, pc};        /* recovering from stack and return */   
++    ldmia         sp!, {fp, pc};        /* recovering from stack and return */
+ 
+ #define UNROLL_F64_TEMPLATE(fname,finst) \
+   .global vfp_ ## fname ## ;                                                  \
+   vfp_ ## fname ## :                                                          \
+     stmdb         sp!, {fp, lr};            /* save registers to stack */     \
+-    fldmiad       r2, {d1};                 /* load scalar value */           \
++    vldmia.f64       r2, {d1};                 /* load scalar value */           \
+     ands          ip, r3, #3;               /* ip = n % 3 */                  \
+     beq           vfp_ ## fname ## _unroll; /* if ip == 0 goto prep_loop2 */  \
+   vfp_ ## fname ## _loop1:                                                    \
+-    fldmiad       r1!, {d0};                                                  \
++    vldmia.f64       r1!, {d0};                                                  \
+     ## finst ##d  d2, d0, d1;                                                 \
+-    fstmiad       r0!, {d2};                                                  \
++    vstmia.f64       r0!, {d2};                                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop1;                                    \
+   vfp_ ## fname ## _unroll:                 /* unroll by 4 */                 \
+@@ -180,14 +180,14 @@ UNROLL_F64_TEMPLATE(subtract_f64,fsub);
+     orr           fp, lr, fp, lsl #16;      /* set vector lenght to 4 */      \
+     fmxr          fpscr, fp;                                                  \
+   vfp_ ## fname ## _loop2:                                                    \
+-    fldmiad       r1!, {d4, d5, d6, d7};                                      \
++    vldmia.f64       r1!, {d4, d5, d6, d7};                                      \
+     ## finst ##d  d12, d4, d1;                                                \
+-    fstmiad       r0!, {d12, d13, d14, d15};                                  \
++    vstmia.f64       r0!, {d12, d13, d14, d15};                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop2;                                    \
+     fmxr          fpscr, lr;                /* restore original fpscr */      \
+   vfp_ ## fname ## _end:                                                      \
+-    ldmia         sp!, {fp, pc};        /* recovering from stack and return */   
++    ldmia         sp!, {fp, pc};        /* recovering from stack and return */
+ 
+ UNROLL_F32_TEMPLATE(scalaradd_f32_ns,fadd);
+ UNROLL_F64_TEMPLATE(scalaradd_f64_ns,fadd);
+@@ -198,7 +198,7 @@ UNROLL_F64_TEMPLATE(scalarmultiply_f64_ns,fmul);
+ #undef UNROLL_F32_TEMPLATE
+ #undef UNROLL_F64_TEMPLATE
+ 
+-/* 
++/*
+ **
+ ** void vfp_abs_f32_f32_ns(float *d, const float *s, int n);
+ ** void vfp_abs_f64_f64_ns(double *d, const double *s, int n);
+@@ -215,9 +215,9 @@ UNROLL_F64_TEMPLATE(scalarmultiply_f64_ns,fmul);
+     ands          ip, r2, #7;               /* ip = n % 8 */                  \
+     beq           vfp_ ## fname ## _unroll; /* if ip == 0 goto prep_loop2 */  \
+   vfp_ ## fname ## _loop1:                                                    \
+-    fldmias       r1!, {s0};                                                  \
+-    ## finst ##s  s2, s0;                                                     \
+-    fstmias       r0!, {s2};                                                  \
++    vldmia.f32       r1!, {s0};                                                  \
++    ## finst ##.f32  s2, s0;                                                     \
++    vstmia.f32       r0!, {s2};                                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop1;                                    \
+   vfp_ ## fname ## _unroll:                 /* unroll by 8 */                 \
+@@ -228,14 +228,14 @@ UNROLL_F64_TEMPLATE(scalarmultiply_f64_ns,fmul);
+     orr           fp, lr, fp, lsl #16;      /* set vector lenght to 8 */      \
+     fmxr          fpscr, fp;                                                  \
+   vfp_ ## fname ## _loop2:                                                    \
+-    fldmias       r1!, {s8, s9, s10, s11, s12, s13, s14, s15};                \
+-    ## finst ##s  s24, s8;                                                    \
+-    fstmias       r0!, {s24, s25, s26, s27, s28, s29, s30, s31};              \
++    vldmia.f32       r1!, {s8, s9, s10, s11, s12, s13, s14, s15};                \
++    ## finst  ##.f32 s24, s8;                                                    \
++    vstmia.f32       r0!, {s24, s25, s26, s27, s28, s29, s30, s31};              \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop2;                                    \
+     fmxr          fpscr, lr;                /* restore original fpscr */      \
+   vfp_ ## fname ## _end:                                                      \
+-    ldmia         sp!, {fp, pc};        /* recovering from stack and return */   
++    ldmia         sp!, {fp, pc};        /* recovering from stack and return */
+ 
+ #define UNROLL_F64_TEMPLATE(fname,finst) \
+   .global vfp_ ## fname ## ;                                                  \
+@@ -244,9 +244,9 @@ UNROLL_F64_TEMPLATE(scalarmultiply_f64_ns,fmul);
+     ands          ip, r2, #3;               /* ip = n % 3 */                  \
+     beq           vfp_ ## fname ## _unroll; /* if ip == 0 goto prep_loop2 */  \
+   vfp_ ## fname ## _loop1:                                                    \
+-    fldmiad       r1!, {d0};                                                  \
+-    ## finst ##d  d2, d0;                                                     \
+-    fstmiad       r0!, {d2};                                                  \
++    vldmia.f64       r1!, {d0};                                                  \
++    ## finst  ##.f64 d2, d0;                                                     \
++    vstmia.f64       r0!, {d2};                                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop1;                                    \
+   vfp_ ## fname ## _unroll:                 /* unroll by 4 */                 \
+@@ -257,20 +257,20 @@ UNROLL_F64_TEMPLATE(scalarmultiply_f64_ns,fmul);
+     orr           fp, lr, fp, lsl #16;      /* set vector lenght to 4 */      \
+     fmxr          fpscr, fp;                                                  \
+   vfp_ ## fname ## _loop2:                                                    \
+-    fldmiad       r1!, {d4, d5, d6, d7};                                      \
+-    ## finst ##d  d12, d4;                                                    \
+-    fstmiad       r0!, {d12, d13, d14, d15};                                  \
++    vldmia.f64       r1!, {d4, d5, d6, d7};                                      \
++    ## finst  ##.f64 d12, d4;                                                    \
++    vstmia.f64       r0!, {d12, d13, d14, d15};                                  \
+     subs          ip, ip, #1;                                                 \
+     bne           vfp_ ## fname ## _loop2;                                    \
+     fmxr          fpscr, lr;                /* restore original fpscr */      \
+   vfp_ ## fname ## _end:                                                      \
+-    ldmia         sp!, {fp, pc};        /* recovering from stack and return */   
++    ldmia         sp!, {fp, pc};        /* recovering from stack and return */
+ 
+-UNROLL_F32_TEMPLATE(abs_f32_f32_ns,fabs);
+-UNROLL_F64_TEMPLATE(abs_f64_f64_ns,fabs);
++UNROLL_F32_TEMPLATE(abs_f32_f32_ns,vabs);
++UNROLL_F64_TEMPLATE(abs_f64_f64_ns,vabs);
+ 
+-UNROLL_F32_TEMPLATE(negative_f32,fneg);
+-UNROLL_F64_TEMPLATE(negative_f64,fneg);
++UNROLL_F32_TEMPLATE(negative_f32,vneg);
++UNROLL_F64_TEMPLATE(negative_f64,vneg);
+ 
+ #undef UNROLL_F32_TEMPLATE
+ #undef UNROLL_F64_TEMPLATE
meta-multimedia/recipes-support/liboil/liboil_0.3.17.bb +2 -1
index 03b7785215..7e8aa1572a 100644
@@ -17,7 +17,8 @@ SRC_URI = "http://liboil.freedesktop.org/download/${BPN}-${PV}.tar.gz \
            file://fix-unaligned-whitelist.patch \
            file://0001-Fix-enable-vfp-flag.patch \
            file://liboil_fix_for_x32.patch \
-          "
+           file://0001-math_vfp_asm.S-Convert-fldmia-fstmia-instructions-to.patch \
+           "
 
 SRC_URI[md5sum] = "47dc734f82faeb2964d97771cfd2e701"
 SRC_URI[sha256sum] = "105f02079b0b50034c759db34b473ecb5704ffa20a5486b60a8b7698128bfc69"
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH 2/6 gperftools: Use ARM ISA when using clang

It seemingly needs to be fixed in application, chromium also force ARM ISA for internal gperftools

also see https://bugs.llvm.org/show_bug.cgi?id=31058

Fixes errors like below

| ../git/src/base/atomicops-internals-arm-v6plus.h:228:8: error: instruction requires: arm-mode
|       "ldrexd  %1, [%3]\n"
|        ^
---
 meta-oe/recipes-support/gperftools/gperftools_2.7.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +1 -0
index e9fcc4cc98..c8b91278da 100644
@@ -26,4 +26,5 @@ COMPATIBLE_HOST_mipsarch_libc-glibc = "null"
 # {standard input}:434: Error: lo register required -- `ldr pc,[sp]'
 # Makefile:4538: recipe for target 'src/base/libtcmalloc_la-linuxthreads.lo' failed
 ARM_INSTRUCTION_SET_armv5 = "arm"
+ARM_INSTRUCTION_SET_toolchain-clang_arm = "arm"
 
Signature · 1 line
2.20.1
author
#2 lore raw

PATCH 3/6 oprofile: Fix build with clang

In reply to Khem Raj
---
 meta-oe/recipes-kernel/oprofile/oprofile.inc  |   1 +
 ...ace-sym_iterator-0-with-sym_iterator.patch | 131 ++++++++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch
meta-oe/recipes-kernel/oprofile/oprofile.inc +1 -0
index 349e2bf543..515ea8faf7 100644
@@ -25,6 +25,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
            file://run-ptest \
            file://root-home-dir.patch \
            file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \
+           file://0001-replace-sym_iterator-0-with-sym_iterator.patch \
 "
 UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/"
 UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/"
meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch new file +131 -0

131 lines not on this page · raw message

Signature · 1 line
2.20.1
author
#3 lore raw

PATCH 4/6 catch2: Upgrade to 2.6.1

In reply to Khem Raj

Fix build with clang

---
 .../{catch2_2.6.0.bb => catch2_2.6.1.bb}      |  5 +--
 ...-Wdefaulted-function-deleted-warning.patch | 35 +++++++++++++++++++
 2 files changed, 38 insertions(+), 2 deletions(-)
 rename meta-oe/recipes-test/catch2/{catch2_2.6.0.bb => catch2_2.6.1.bb} (83%)
 create mode 100644 meta-oe/recipes-test/catch2/files/0001-Fix-Wdefaulted-function-deleted-warning.patch
meta-oe/recipes-test/catch2/catch2_2.6.1.bb renamed from meta-oe/recipes-test/catch2/catch2_2.6.0.bb +3 -2
similarity index 83%
rename from meta-oe/recipes-test/catch2/catch2_2.6.0.bb
rename to meta-oe/recipes-test/catch2/catch2_2.6.1.bb
index 13beb9e8b5..08d6616401 100644
@@ -6,9 +6,10 @@ LICENSE = "BSL-1.0"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
 
 SRC_URI = "git://github.com/catchorg/Catch2.git \
+           file://0001-Fix-Wdefaulted-function-deleted-warning.patch \
           "
-# v2.6.0
-SRCREV = "d75e9b3c0f24fe42553131873459611ed155e297"
+# v2.6.1
+SRCREV = "dbbab8727c342733f75045483048cdcb52421e32"
 
 S = "${WORKDIR}/git"
 
meta-oe/recipes-test/catch2/files/0001-Fix-Wdefaulted-function-deleted-warning.patch new file +35 -0
new file mode 100644
index 0000000000..555c71ad22
@@ -0,0 +1,35 @@
+From a39e0eaa8318335260967ffd1d16388eb5a1d6d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 12 Feb 2019 12:57:00 -0800
+Subject: [PATCH] Fix -Wdefaulted-function-deleted warning
+
+Clang8 warns
+
+catch_interfaces_reporter.h:84:25: error: explicitly defaulted move assignment operator is implicitly deleted [-Werror,-Wdefaulted-function-deleted]
+|         AssertionStats& operator = ( AssertionStats && )     = default;
+|                         ^
+
+Upstream-Status: Submitted [https://github.com/catchorg/Catch2/pull/1537]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ include/internal/catch_interfaces_reporter.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h
+index 9d99c981..e5fbf8bb 100644
+--- a/include/internal/catch_interfaces_reporter.h
++++ b/include/internal/catch_interfaces_reporter.h
+@@ -80,8 +80,8 @@ namespace Catch {
+ 
+         AssertionStats( AssertionStats const& )              = default;
+         AssertionStats( AssertionStats && )                  = default;
+-        AssertionStats& operator = ( AssertionStats const& ) = default;
+-        AssertionStats& operator = ( AssertionStats && )     = default;
++        AssertionStats& operator = ( AssertionStats const& ) = delete;
++        AssertionStats& operator = ( AssertionStats && )     = delete;
+         virtual ~AssertionStats();
+ 
+         AssertionResult assertionResult;
+-- 
+2.20.1
+
Signature · 1 line
2.20.1
author
#4 lore raw

PATCH 5/6 cli11: Add knob to Enable/Disable clang-tidy explicity

In reply to Khem Raj

When building with clang otherwise this gets enabled and we have problems with headers especially due to OEs multilibbing effort on arm where headers like bits/wordsize.h are hijacked and some wrappers are translanted, these transplants have additional requirements/constraints e.g. compiler internal arch defines e.g. __arm__ etc. which may not be passed by tools like clang-tidy which are arch independent.

Ideally we should not require to disable clang-tidy here but we make a compromise, since OEs headers are the way as explained above

---
 meta-oe/recipes-support/cli11/cli11_1.6.2.bb  |  5 +++-
 .../files/0001-Add-CLANG_TIDY-check.patch     | 27 +++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/cli11/files/0001-Add-CLANG_TIDY-check.patch
meta-oe/recipes-support/cli11/cli11_1.6.2.bb +4 -1
index 6899b1264b..e62c1d3d13 100644
@@ -6,11 +6,14 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=c271fee3ae28e11b24b97284d9f82887"
 SRCREV = "bd4dc911847d0cde7a6b41dfa626a85aab213baf"
 PV .= "+git${SRCPV}"
 
-SRC_URI += "gitsm://github.com/CLIUtils/CLI11"
+SRC_URI += "gitsm://github.com/CLIUtils/CLI11 \
+            file://0001-Add-CLANG_TIDY-check.patch \
+           "
 
 S = "${WORKDIR}/git"
 
 inherit cmake
 inherit ptest
 
+EXTRA_OECMAKE += "-DCLANG_TIDY=OFF"
 DEPENDS += "boost"
meta-oe/recipes-support/cli11/files/0001-Add-CLANG_TIDY-check.patch new file +27 -0
new file mode 100644
index 0000000000..bef3548a29
@@ -0,0 +1,27 @@
+From ef6310bc726a53ff6b45071633fa7b37224cae96 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 12 Feb 2019 13:22:21 -0800
+Subject: [PATCH] Add CLANG_TIDY check
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 79404b8..f68217d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -39,7 +39,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
+         add_definitions(-Wall -Wextra -pedantic)
+     endif()
+ 
+-    if(CMAKE_VERSION VERSION_GREATER 3.6)
++    if(CMAKE_VERSION VERSION_GREATER 3.6 AND CLANG_TIDY)
+         # Add clang-tidy if available
+         option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
+         find_program(
+-- 
+2.20.1
+
Signature · 1 line
2.20.1
author
#5 lore raw

PATCH 6/6 rocksdb: Fix build with clang

In reply to Khem Raj
---
 ...and-do-not-mark-default-copy-constru.patch | 57 +++++++++++++++++++
 meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb    |  1 +
 2 files changed, 58 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/rocksdb/files/0001-Disable-Wshadow-and-do-not-mark-default-copy-constru.patch
meta-oe/recipes-dbs/rocksdb/files/0001-Disable-Wshadow-and-do-not-mark-default-copy-constru.patch new file +57 -0
new file mode 100644
index 0000000000..eccaa3a37a
@@ -0,0 +1,57 @@
+From ee728434124b9b7d17abbd060a62aac79a9b79c0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 12 Feb 2019 14:31:24 -0800
+Subject: [PATCH] Disable -Wshadow and do not mark default copy constructors
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ CMakeLists.txt                                     | 2 +-
+ utilities/persistent_cache/block_cache_tier.h      | 4 ++--
+ utilities/persistent_cache/block_cache_tier_file.h | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 98e2e1973..3a24a075b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -254,7 +254,7 @@ if(FAIL_ON_WARNINGS)
+   if(MSVC)
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
+   else() # assume GCC
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=shadow")
+   endif()
+ endif()
+ 
+diff --git a/utilities/persistent_cache/block_cache_tier.h b/utilities/persistent_cache/block_cache_tier.h
+index 2b2c0ef4f..96d0540a4 100644
+--- a/utilities/persistent_cache/block_cache_tier.h
++++ b/utilities/persistent_cache/block_cache_tier.h
+@@ -91,9 +91,9 @@ class BlockCacheTier : public PersistentCacheTier {
+         : key_(std::move(key)), data_(data) {}
+     ~InsertOp() {}
+ 
+-    InsertOp() = delete;
++    InsertOp() = default;
+     InsertOp(InsertOp&& /*rhs*/) = default;
+-    InsertOp& operator=(InsertOp&& rhs) = default;
++    InsertOp& operator=(InsertOp&& rhs) = delete;
+ 
+     // used for estimating size by bounded queue
+     size_t Size() { return data_.size() + key_.size(); }
+diff --git a/utilities/persistent_cache/block_cache_tier_file.h b/utilities/persistent_cache/block_cache_tier_file.h
+index e38b6c9a1..d9b89a4f7 100644
+--- a/utilities/persistent_cache/block_cache_tier_file.h
++++ b/utilities/persistent_cache/block_cache_tier_file.h
+@@ -262,7 +262,7 @@ class ThreadedWriter : public Writer {
+         : file_(file), buf_(buf), file_off_(file_off), callback_(callback) {}
+ 
+     IO(const IO&) = default;
+-    IO& operator=(const IO&) = default;
++    IO& operator=(const IO&) = delete;
+     size_t Size() const { return sizeof(IO); }
+ 
+     WritableFile* file_ = nullptr;           // File to write to
+-- 
+2.20.1
+
meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb +1 -0
index ebe50a58ec..78520f99b0 100644
@@ -11,6 +11,7 @@ SRCBRANCH = "5.18.fb"
 PV = "5.18.2"
 
 SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH} \
+           file://0001-Disable-Wshadow-and-do-not-mark-default-copy-constru.patch \
           "
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.20.1