This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: Fix building ld/emultempl/avrelf.em with clang
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Wed, 25 Sep 2019 14:34:12 +0100
- Subject: Commit: Fix building ld/emultempl/avrelf.em with clang
Hi Guys,
I recently came across this build error when using clang instead of
gcc on a toolchain configure with --enable-targets=all:
eavr1.c:104:7: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
&& strcmp ("avr1","avrxmega6")
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
So I am checking in the patch below to fix the problem.
Cheers
Nick
ld/ChangeLog
2019-09-25 Nick Clifton <nickc@redhat.com>
* emultempl/avrelf.em (_before_allocation): Silence build warning
using clang.
diff --git a/ld/emultempl/avrelf.em b/ld/emultempl/avrelf.em
index f3d1082287..48675efc22 100644
--- a/ld/emultempl/avrelf.em
+++ b/ld/emultempl/avrelf.em
@@ -77,10 +77,10 @@ avr_elf_${EMULATION_NAME}_before_allocation (void)
return;
}
- /* We only need stubs for avr6, avrxmega6, and avrxmega7. */
- if (strcmp ("${EMULATION_NAME}","avr6")
- && strcmp ("${EMULATION_NAME}","avrxmega6")
- && strcmp ("${EMULATION_NAME}","avrxmega7") )
+ /* We only need stubs for avr6, avrxmega6, and avrxmega7. */
+ if (strcmp ("${EMULATION_NAME}", "avr6") != 0
+ && strcmp ("${EMULATION_NAME}", "avrxmega6") != 0
+ && strcmp ("${EMULATION_NAME}", "avrxmega7") != 0)
avr_no_stubs = TRUE;
avr_elf_set_global_bfd_parameters ();