From 559e3eba3b4cf103da6b8d022f3e1387278b9db8 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Fri, 14 Aug 2020 09:59:11 +0200 Subject: [PATCH] fix compile error with gcc-10 With GCC 10.2 we will get following error: toolchain/inst/lib/gcc/xtensa-elf/10.2.0/../../../../xtensa-elf/bin/ld: target_firmware/build/k2/libfirmware.a(init.c.obj):target_firmware/magpie_fw_dev/target/init/init.h:53: multiple definition of `_assfail_ori'; target_firmware/build/k2/libfirmware.a(app_start.c.obj):target_firmware/magpie_fw_dev/target/init/init.h:53: first defined here Since previous compilers merged this variable automatically, the GCC 10 will do it only if we will tell it to do so. With this patch we should be able to compile this firmware with new and old compiler. Signed-off-by: Oleksij Rempel --- target_firmware/magpie_fw_dev/target/init/app_start.c | 2 ++ target_firmware/magpie_fw_dev/target/init/init.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target_firmware/magpie_fw_dev/target/init/app_start.c b/target_firmware/magpie_fw_dev/target/init/app_start.c index 8fa9c8b..7545863 100644 --- a/target_firmware/magpie_fw_dev/target/init/app_start.c +++ b/target_firmware/magpie_fw_dev/target/init/app_start.c @@ -52,6 +52,8 @@ #define ALLOCRAM_START ( ((unsigned int)&_fw_image_end) + 4) #define ALLOCRAM_SIZE ( SYS_RAM_SZIE - ( ALLOCRAM_START - SYS_D_RAM_REGION_0_BASE) - SYS_D_RAM_STACK_SIZE) +void (* _assfail_ori)(struct register_dump_s *); + // support for more than 64 bytes on command pipe extern void usb_reg_out_patch(void); extern int _HIFusb_get_max_msg_len_patch(hif_handle_t handle, int pipe); diff --git a/target_firmware/magpie_fw_dev/target/init/init.h b/target_firmware/magpie_fw_dev/target/init/init.h index 342f64b..e44c99e 100644 --- a/target_firmware/magpie_fw_dev/target/init/init.h +++ b/target_firmware/magpie_fw_dev/target/init/init.h @@ -46,7 +46,7 @@ void AR6002_fatal_exception_handler_patch(CPU_exception_frame_t *exc_frame); void exception_reset(struct register_dump_s *dump); -void (* _assfail_ori)(struct register_dump_s *); +extern void (* _assfail_ori)(struct register_dump_s *); void HTCMsgRecvHandler_patch(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *context); void HTCControlSvcProcessMsg_patch(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t hdr_buf, adf_nbuf_t pBuffers, void *arg); -- 2.31.1