Commit: Fix building ld/emultempl/avrelf.em with clang
Nick Clifton
nickc@redhat.com
Wed Sep 25 13:34:00 GMT 2019
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 ();
More information about the Binutils
mailing list