diff mbox

[13/16] elf2flt: disable Werror to avoid build issues

Message ID 1458164602-16983-14-git-send-email-thomas.petazzoni@free-electrons.com
State Superseded
Headers show

Commit Message

Thomas Petazzoni March 16, 2016, 9:43 p.m. UTC
Some of the debugging printf use incorrect formats, which cause some
warnings. Due to the use of -Werror by default, the build breaks
unnecessarily. Therefore, disable -Werror when building elf2flt.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/elf2flt/elf2flt.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Arnout Vandecappelle March 16, 2016, 11:53 p.m. UTC | #1
On 03/16/16 22:43, Thomas Petazzoni wrote:
> Some of the debugging printf use incorrect formats, which cause some
> warnings. Due to the use of -Werror by default, the build breaks
> unnecessarily. Therefore, disable -Werror when building elf2flt.

  Wouldn't it be better to patch elf2flt to fix the errors?

  Still:

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>


  Regards,
  Arnout

>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>   package/elf2flt/elf2flt.mk | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/package/elf2flt/elf2flt.mk b/package/elf2flt/elf2flt.mk
> index 796313b..eb0baad 100644
> --- a/package/elf2flt/elf2flt.mk
> +++ b/package/elf2flt/elf2flt.mk
> @@ -18,7 +18,8 @@ HOST_ELF2FLT_CONF_OPTS = \
>   	--with-binutils-include-dir=$(HOST_BINUTILS_DIR)/include/ \
>   	--with-libbfd=$(HOST_BINUTILS_DIR)/bfd/libbfd.a \
>   	--with-libiberty=$(HOST_BINUTILS_DIR)/libiberty/libiberty.a \
> -	--target=$(GNU_TARGET_NAME)
> +	--target=$(GNU_TARGET_NAME) \
> +	--disable-werror
>
>   HOST_ELF2FLT_LIBS = -lz
>
>
Mike Frysinger March 17, 2016, 1:40 a.m. UTC | #2
On 16 Mar 2016 22:43, Thomas Petazzoni wrote:
> Some of the debugging printf use incorrect formats, which cause some
> warnings. Due to the use of -Werror by default, the build breaks
> unnecessarily. Therefore, disable -Werror when building elf2flt.

you should send a patch and/or open an issue.
the build bot is clean for all the targets w/Werror:
	https://travis-ci.org/uclinux-dev/elf2flt
-mike
Thomas Petazzoni March 17, 2016, 8:18 a.m. UTC | #3
Dear Arnout Vandecappelle,

On Thu, 17 Mar 2016 00:53:41 +0100, Arnout Vandecappelle wrote:
> On 03/16/16 22:43, Thomas Petazzoni wrote:
> > Some of the debugging printf use incorrect formats, which cause some
> > warnings. Due to the use of -Werror by default, the build breaks
> > unnecessarily. Therefore, disable -Werror when building elf2flt.
> 
>   Wouldn't it be better to patch elf2flt to fix the errors?

Yes, indeed it is better, but one step at a time :)

Also, we generally anyway build things with -Werror disabled.

Thomas
Thomas Petazzoni March 17, 2016, 8:19 a.m. UTC | #4
Mike,

On Wed, 16 Mar 2016 21:40:51 -0400, Mike Frysinger wrote:
> On 16 Mar 2016 22:43, Thomas Petazzoni wrote:
> > Some of the debugging printf use incorrect formats, which cause some
> > warnings. Due to the use of -Werror by default, the build breaks
> > unnecessarily. Therefore, disable -Werror when building elf2flt.
> 
> you should send a patch and/or open an issue.
> the build bot is clean for all the targets w/Werror:
> 	https://travis-ci.org/uclinux-dev/elf2flt

Sure, I'll reproduce and report. It's just some stupid printf specifier
issue with some of the funky bfd types.

Thomas
Mike Frysinger March 17, 2016, 6:57 p.m. UTC | #5
On 17 Mar 2016 09:19, Thomas Petazzoni wrote:
> On Wed, 16 Mar 2016 21:40:51 -0400, Mike Frysinger wrote:
> > On 16 Mar 2016 22:43, Thomas Petazzoni wrote:
> > > Some of the debugging printf use incorrect formats, which cause some
> > > warnings. Due to the use of -Werror by default, the build breaks
> > > unnecessarily. Therefore, disable -Werror when building elf2flt.
> > 
> > you should send a patch and/or open an issue.
> > the build bot is clean for all the targets w/Werror:
> > 	https://travis-ci.org/uclinux-dev/elf2flt
> 
> Sure, I'll reproduce and report. It's just some stupid printf specifier
> issue with some of the funky bfd types.

depending on the ABI, printf mismatches can be pretty bad.  consider
that most 32bit arches require splitting 64bit values across two "slots"
and that a 64bit printf length will consume 2 "slots".  so a mismatch
there (either passing too many or consuming too many) with a pointer
following them can lead to crashes :).

the buildbots are only doing one type of build atm (64bit host), so it
might be missing coverage w/a 32bit userland.  we might be able to add
that to the travis matrix.
-mike
diff mbox

Patch

diff --git a/package/elf2flt/elf2flt.mk b/package/elf2flt/elf2flt.mk
index 796313b..eb0baad 100644
--- a/package/elf2flt/elf2flt.mk
+++ b/package/elf2flt/elf2flt.mk
@@ -18,7 +18,8 @@  HOST_ELF2FLT_CONF_OPTS = \
 	--with-binutils-include-dir=$(HOST_BINUTILS_DIR)/include/ \
 	--with-libbfd=$(HOST_BINUTILS_DIR)/bfd/libbfd.a \
 	--with-libiberty=$(HOST_BINUTILS_DIR)/libiberty/libiberty.a \
-	--target=$(GNU_TARGET_NAME)
+	--target=$(GNU_TARGET_NAME) \
+	--disable-werror
 
 HOST_ELF2FLT_LIBS = -lz