Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1] package/assimp: disable -Werror compile flag
@ 2021-12-10 14:25 Peter Seiderer
  2021-12-12 14:41 ` Arnout Vandecappelle
  2021-12-27 10:26 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Seiderer @ 2021-12-10 14:25 UTC (permalink / raw)
  To: buildroot

Add patch to disable -Werror compile flag.

Fixes:

  - http://autobuild.buildroot.net/results/49beb264b8454b9af092278074c4087013692052/

  .../build/assimp-5.1.3/code/PostProcessing/TriangulateProcess.cpp:285:50: error: argument 1 value ‘4294967294’ exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
    285 |     std::unique_ptr<bool[]> done(new bool[max_out]);
        |                                                  ^
  [...]
  .../host/opt/ext-toolchain/powerpc-buildroot-linux-uclibc/include/c++/9.3.0/new:127:26: note: in a call to allocation function ‘void* operator new [](std::size_t)’ declared here
    127 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
        |                          ^~~~~~~~

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 package/assimp/0001-code-disable-Werror.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/assimp/0001-code-disable-Werror.patch

diff --git a/package/assimp/0001-code-disable-Werror.patch b/package/assimp/0001-code-disable-Werror.patch
new file mode 100644
index 0000000000..33867e61c3
--- /dev/null
+++ b/package/assimp/0001-code-disable-Werror.patch
@@ -0,0 +1,39 @@
+From 5146e1c4d58174e302dbdcf2a85c2023be1cffc6 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Fri, 10 Dec 2021 15:15:30 +0100
+Subject: [PATCH] code: disable -Werror
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+
+  .../build/assimp-5.1.3/code/PostProcessing/TriangulateProcess.cpp:285:50: error: argument 1 value ‘4294967294’ exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
+    285 |     std::unique_ptr<bool[]> done(new bool[max_out]);
+        |                                                  ^
+  [...]
+  .../host/opt/ext-toolchain/powerpc-buildroot-linux-uclibc/include/c++/9.3.0/new:127:26: note: in a call to allocation function ‘void* operator new [](std::size_t)’ declared here
+    127 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
+        |                          ^~~~~~~~
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ code/CMakeLists.txt | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
+index e45bf8a2a..f71b6583d 100644
+--- a/code/CMakeLists.txt
++++ b/code/CMakeLists.txt
+@@ -1167,8 +1167,6 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp)
+ # enable warnings as errors ########################################
+ IF (MSVC)
+   TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX)
+-ELSE()
+-  TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)
+ ENDIF()
+ 
+ # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler
+-- 
+2.34.1
+
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v1] package/assimp: disable -Werror compile flag
  2021-12-10 14:25 [Buildroot] [PATCH v1] package/assimp: disable -Werror compile flag Peter Seiderer
@ 2021-12-12 14:41 ` Arnout Vandecappelle
  2021-12-12 16:02   ` Peter Seiderer
  2021-12-27 10:26 ` Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2021-12-12 14:41 UTC (permalink / raw)
  To: Peter Seiderer, buildroot



On 10/12/2021 15:25, Peter Seiderer wrote:
> Add patch to disable -Werror compile flag.
> 
> Fixes:
> 
>    - http://autobuild.buildroot.net/results/49beb264b8454b9af092278074c4087013692052/
> 
>    .../build/assimp-5.1.3/code/PostProcessing/TriangulateProcess.cpp:285:50: error: argument 1 value ‘4294967294’ exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
>      285 |     std::unique_ptr<bool[]> done(new bool[max_out]);
>          |                                                  ^
>    [...]
>    .../host/opt/ext-toolchain/powerpc-buildroot-linux-uclibc/include/c++/9.3.0/new:127:26: note: in a call to allocation function ‘void* operator new [](std::size_t)’ declared here
>      127 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
>          |                          ^~~~~~~~
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>   package/assimp/0001-code-disable-Werror.patch | 39 +++++++++++++++++++
>   1 file changed, 39 insertions(+)
>   create mode 100644 package/assimp/0001-code-disable-Werror.patch
> 
> diff --git a/package/assimp/0001-code-disable-Werror.patch b/package/assimp/0001-code-disable-Werror.patch
> new file mode 100644
> index 0000000000..33867e61c3
> --- /dev/null
> +++ b/package/assimp/0001-code-disable-Werror.patch
> @@ -0,0 +1,39 @@
> +From 5146e1c4d58174e302dbdcf2a85c2023be1cffc6 Mon Sep 17 00:00:00 2001
> +From: Peter Seiderer <ps.report@gmx.net>
> +Date: Fri, 10 Dec 2021 15:15:30 +0100
> +Subject: [PATCH] code: disable -Werror
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Fixes:
> +
> +  .../build/assimp-5.1.3/code/PostProcessing/TriangulateProcess.cpp:285:50: error: argument 1 value ‘4294967294’ exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
> +    285 |     std::unique_ptr<bool[]> done(new bool[max_out]);
> +        |                                                  ^
> +  [...]
> +  .../host/opt/ext-toolchain/powerpc-buildroot-linux-uclibc/include/c++/9.3.0/new:127:26: note: in a call to allocation function ‘void* operator new [](std::size_t)’ declared here
> +    127 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
> +        |                          ^~~~~~~~
> +
> +Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> +---
> + code/CMakeLists.txt | 2 --
> + 1 file changed, 2 deletions(-)
> +
> +diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
> +index e45bf8a2a..f71b6583d 100644
> +--- a/code/CMakeLists.txt
> ++++ b/code/CMakeLists.txt
> +@@ -1167,8 +1167,6 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp)
> + # enable warnings as errors ########################################
> + IF (MSVC)
> +   TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX)
> +-ELSE()
> +-  TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)

  This looks like a patch that is not upstreamable, so not so nice.

  Worse though: it seems that the issue raised by Werror could be an actual bug. 
Allocting 4GB doesn't sound like a good idea, does it?

  So perhaps it would be better to create an upstream issue for this? It should 
be relatively easy to reproduce, any 32-bit target should be sufficient, no?

  Regards,
  Arnout

> + ENDIF()
> +
> + # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler
> +--
> +2.34.1
> +
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v1] package/assimp: disable -Werror compile flag
  2021-12-12 14:41 ` Arnout Vandecappelle
@ 2021-12-12 16:02   ` Peter Seiderer
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Seiderer @ 2021-12-12 16:02 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: buildroot

Hello Arnout,

On Sun, 12 Dec 2021 15:41:09 +0100, Arnout Vandecappelle <arnout@mind.be> wrote:

> On 10/12/2021 15:25, Peter Seiderer wrote:
> > Add patch to disable -Werror compile flag.
> > 
> > Fixes:
> > 
> >    - http://autobuild.buildroot.net/results/49beb264b8454b9af092278074c4087013692052/
> > 
> >    .../build/assimp-5.1.3/code/PostProcessing/TriangulateProcess.cpp:285:50: error: argument 1 value ‘4294967294’ exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
> >      285 |     std::unique_ptr<bool[]> done(new bool[max_out]);
> >          |                                                  ^
> >    [...]
> >    .../host/opt/ext-toolchain/powerpc-buildroot-linux-uclibc/include/c++/9.3.0/new:127:26: note: in a call to allocation function ‘void* operator new [](std::size_t)’ declared here
> >      127 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
> >          |                          ^~~~~~~~
> > 
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> >   package/assimp/0001-code-disable-Werror.patch | 39 +++++++++++++++++++
> >   1 file changed, 39 insertions(+)
> >   create mode 100644 package/assimp/0001-code-disable-Werror.patch
> > 
> > diff --git a/package/assimp/0001-code-disable-Werror.patch b/package/assimp/0001-code-disable-Werror.patch
> > new file mode 100644
> > index 0000000000..33867e61c3
> > --- /dev/null
> > +++ b/package/assimp/0001-code-disable-Werror.patch
> > @@ -0,0 +1,39 @@
> > +From 5146e1c4d58174e302dbdcf2a85c2023be1cffc6 Mon Sep 17 00:00:00 2001
> > +From: Peter Seiderer <ps.report@gmx.net>
> > +Date: Fri, 10 Dec 2021 15:15:30 +0100
> > +Subject: [PATCH] code: disable -Werror
> > +MIME-Version: 1.0
> > +Content-Type: text/plain; charset=UTF-8
> > +Content-Transfer-Encoding: 8bit
> > +
> > +Fixes:
> > +
> > +  .../build/assimp-5.1.3/code/PostProcessing/TriangulateProcess.cpp:285:50: error: argument 1 value ‘4294967294’ exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
> > +    285 |     std::unique_ptr<bool[]> done(new bool[max_out]);
> > +        |                                                  ^
> > +  [...]
> > +  .../host/opt/ext-toolchain/powerpc-buildroot-linux-uclibc/include/c++/9.3.0/new:127:26: note: in a call to allocation function ‘void* operator new [](std::size_t)’ declared here
> > +    127 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
> > +        |                          ^~~~~~~~
> > +
> > +Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > +---
> > + code/CMakeLists.txt | 2 --
> > + 1 file changed, 2 deletions(-)
> > +
> > +diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
> > +index e45bf8a2a..f71b6583d 100644
> > +--- a/code/CMakeLists.txt
> > ++++ b/code/CMakeLists.txt
> > +@@ -1167,8 +1167,6 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp)
> > + # enable warnings as errors ########################################
> > + IF (MSVC)
> > +   TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX)
> > +-ELSE()
> > +-  TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)  
> 
>   This looks like a patch that is not upstreamable, so not so nice.
> 
>   Worse though: it seems that the issue raised by Werror could be an actual bug. 
> Allocting 4GB doesn't sound like a good idea, does it?
> 
>   So perhaps it would be better to create an upstream issue for this? It should 
> be relatively easy to reproduce, any 32-bit target should be sufficient, no?

Thanks for review and sorry for being to short in the commit message, the code
in question is from build/assimp-5.1.0/code/PostProcessing/TriangulateProcess.cpp
is:

225     // Find out how many output faces we'll get
226     uint32_t numOut = 0, max_out = 0;
227     bool get_normals = true;
228     for( unsigned int a = 0; a < pMesh->mNumFaces; a++) {
229         aiFace& face = pMesh->mFaces[a];
230         if (face.mNumIndices <= 4) {
231             get_normals = false;
232         }
233         if( face.mNumIndices <= 3) {
234             numOut++;
235 
236         }
237         else {
238             numOut += face.mNumIndices-2;
239             max_out = std::max(max_out,face.mNumIndices);
240         }
241     }
[...]
284     // use std::unique_ptr to avoid slow std::vector<bool> specialiations
285     std::unique_ptr<bool[]> done(new bool[max_out]);

The warning creeped in most likely with upstream commit [1] and I believe is
a false positive a la [2]..., it is not a real overflow but a warning about
a possible/theoretically overflow....

Regards,
Peter

[1] https://github.com/assimp/assimp/commit/b94183376ced40aecab78b5b5893dca8277542b9
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783

> 
>   Regards,
>   Arnout
> 
> > + ENDIF()
> > +
> > + # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler
> > +--
> > +2.34.1
> > +
> >   
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v1] package/assimp: disable -Werror compile flag
  2021-12-10 14:25 [Buildroot] [PATCH v1] package/assimp: disable -Werror compile flag Peter Seiderer
  2021-12-12 14:41 ` Arnout Vandecappelle
@ 2021-12-27 10:26 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2021-12-27 10:26 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: buildroot

On Fri, 10 Dec 2021 15:25:31 +0100
Peter Seiderer <ps.report@gmx.net> wrote:

> Add patch to disable -Werror compile flag.
> 
> Fixes:
> 
>   - http://autobuild.buildroot.net/results/49beb264b8454b9af092278074c4087013692052/
> 
>   .../build/assimp-5.1.3/code/PostProcessing/TriangulateProcess.cpp:285:50: error: argument 1 value ‘4294967294’ exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
>     285 |     std::unique_ptr<bool[]> done(new bool[max_out]);
>         |                                                  ^
>   [...]
>   .../host/opt/ext-toolchain/powerpc-buildroot-linux-uclibc/include/c++/9.3.0/new:127:26: note: in a call to allocation function ‘void* operator new [](std::size_t)’ declared here
>     127 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
>         |                          ^~~~~~~~
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  package/assimp/0001-code-disable-Werror.patch | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 package/assimp/0001-code-disable-Werror.patch

Even though Arnout had objections, this patch is reasonable, it's
obviously just dropping -Werror, and we indeed try to not build packages
with -Werror in general. So I've applied.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-27 10:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-10 14:25 [Buildroot] [PATCH v1] package/assimp: disable -Werror compile flag Peter Seiderer
2021-12-12 14:41 ` Arnout Vandecappelle
2021-12-12 16:02   ` Peter Seiderer
2021-12-27 10:26 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox