C Compilation Make Error, It's Trying to Compile Comment Line - makefile

I'm not too familiar with C but this is pretty weird. I'm running the make command on a makefile I made to compile my C modules on an HP-UX (nightmare!) machine. Things are compiling correctly but towards the end I get this error:
Make: Don't know how to make #----------------. Stop.
It looks like it's trying to make the start of a comment line I have in the makefile. Here is the makefile (it's ugly, not something I wrote in the first place):
#--------------------------------------------------------------
# Name : Makefile
#--------------------------------------------------------------
CCOPTS = -c +DD64 -Ae -I/path/to/include
DEFINES = -DUNIX
INCLUDE = /path/to/include
BIN = /path/to/bin
FIRSTOBJS = asvc.o getname.o err.o
SECONDOBJS = CCARD.o getname.o err.o
THIRDOBJS = CREQ.o getname.o err.o
FOURTHOBJS = CPORG.o implin.o getname.o cchcomm.o err.o
FIFTHOBJS = UNFOR.o getname.o err.o
DBINCDIR = /path/to/mysql-connector-c-6.0.2-hpux11.11-hppa2.0-64bit/include
LIBS = -lmysqlclient
DBLIB = +DD64 -L/path/to/lib
#---------------- All Executables -------------------
default : $(BIN)/asvc \
$(BIN)/UNFOR \
$(BIN)/ontop \
$(BIN)/CCARD \
$(BIN)/CREQ \
$(BIN)/xltscri \
#---------------- Common object Modules -------------
asvc.o : asvc.c $(INCLUDE)/err.h $(INCLUDE)/xcerr.h
cc $(CCOPTS) $(DEFINES) -I$(DBINCDIR) asvc.c
err.o : err.c $(INCLUDE)/err.h
cc $(CCOPTS) -g err.c -I$(DBINCDIR)
UNFOR.o : UNFOR.c $(INCLUDE)/err.h $(INCLUDE)/xcerr.h
cc $(CCOPTS) $(DEFINES) -I$(DBINCDIR) UNFOR.c
xltscri.o : xltscri.c $(INCLUDE)/ontop.h $(INCLUDE)/err.h \
$(INCLUDE)/xcerr.h
cc $(CCOPTS) $(DEFINES) -I$(DBINCDIR) xltscri.c
ontop.o : ontop.c $(INCLUDE)/ontop.h $(INCLUDE)/err.h \
$(INCLUDE)/xcerr.h
cc $(CCOPTS) $(DEFINES) -I$(DBINCDIR) ontop.c
getname.o : getname.c $(INCLUDE)/ontop.h
cc $(CCOPTS) $(DEFINES) -I$(DBINCDIR) getname.c
CCARD.o : CCARD.c $(INCLUDE)/err.h $(INCLUDE)/xcerr.h
cc $(CCOPTS) $(DEFINES) -I$(DBINCDIR) CCARD.c
implin.o : implin.c $(INCLUDE)/err.h $(INCLUDE)/xcerr.h
cc $(CCOPTS) implin.c -I$(DBINCDIR)
CREQ.o : CREQ.c $(INCLUDE)/err.h $(INCLUDE)/xcerr.h
cc $(CCOPTS) $(DEFINES) -I$(DBINCDIR) CREQ.c
#------------ Make asvc (Get SubService ) ---------
$(BIN)/asvc: $(FIRSTOBJS)
cc -o $# \
$(FIRSTOBJS) \
$(DBLIB) \
$(LIBS)
#------------ Make CCARD (Update Completed TimeStamp ) ---------
$(BIN)/CCARD: $(SECONDOBJS)
cc -o $# \
$(SECONDOBJS) \
$(DBLIB) \
$(LIBS)
#------------ Make UNFOR ( Match Partitioning Abend Checker ) ---------
$(BIN)/UNFOR: $(FIFTHOBJS)
cc -o $# \
$(FIFTHOBJS) \
$(DBLIB) \
$(LIBS)
#------------ Make ontop (Add script)---------
$(BIN)/ontop: ontop.o getname.o err.o
cc -o $# \
ontop.o \
getname.o \
err.o \
$(DBLIB) \
$(LIBS)
#------------ Make CREQ (FPC Requests ) ---------
$(BIN)/CREQ: $(THIRDOBJS)
cc -o $# \
$(THIRDOBJS) \
$(DBLIB) \
$(LIBS)
#------------ Make xltscri (Select script)---------
$(BIN)/xltscri: xltscri.o getname.o err.o
cc -o $# \
xltscri.o \
getname.o \
err.o \
$(DBLIB) \
$(LIBS)
#---------------End of Makefile ---------------------

#Eugene SH. nailed it and #Ingo Leonhardt as well. Extra backslash in the last line of the All executables section caused the program to think the next line (until the whitespace) was part of the command. Thanks. Being new to makefiles there's no telling how much time I would have wasted before noticing that.

Related

makefile, gcc, arm-cortex collect2.exe: error: ld returned 1 exit status

This makefile is autogenerated by STM32CubeMX. I am getting this linker error when I am using the arm-gnu-toolchain version > 9.2.1. I need to solve this problem. I cannot use the version in which the make is working fine because the openocd debugger is not compatible with arm-gnu-toolchain version 9.2.1
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [3.13.0-B3] date: [Thu Mar 11 18:44:56 IST 2021]
##########################################################################################################################
# ------------------------------------------------
# Generic Makefile (based on gcc)
#
# ChangeLog :
# 2017-02-10 - Several enhancements + project update mode
# 2015-07-22 - first version
# ------------------------------------------------
######################################
# target
######################################
TARGET = Testing_fes_bms
######################################
# building variables
######################################
# debug build?
DEBUG = 1
# optimization
OPT = -Og
#######################################
# paths
#######################################
# Build path
BUILD_DIR = build
######################################
# source
######################################
# C sources
C_SOURCES = \
Core/Src/main.c \
Core/Src/freertos.c \
Core/Src/stm32l4xx_it.c \
Core/Src/stm32l4xx_hal_msp.c \
Core/Src/stm32l4xx_hal_timebase_tim.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c \
/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_can.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c \
Core/Src/system_stm32l4xx.c \
Middlewares/Third_Party/FreeRTOS/Source/croutine.c \
Middlewares/Third_Party/FreeRTOS/Source/event_groups.c \
Middlewares/Third_Party/FreeRTOS/Source/list.c \
Middlewares/Third_Party/FreeRTOS/Source/queue.c \
Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c \
Middlewares/Third_Party/FreeRTOS/Source/tasks.c \
Middlewares/Third_Party/FreeRTOS/Source/timers.c \
Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c \
Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c \
Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c \
BMS_OPERATION/BMS_OPERATION.c \
EXTERNAL_COMMUNICATION/USART_OPERATION.c \
AFE_OPERATION/AFE_OPERATION.c \
CAN_OPERATION/can.c
#===============================================#
# ASM CONFIG #
#===============================================#
# 433
#ASM_SOURCES = \
#startup_stm32l433rctxp.s
# 431
ASM_SOURCES = \
startup_stm32l431xx.s
#===============================================#
#######################################
# binaries
#######################################
PREFIX = arm-none-eabi-
# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
# either it can be added to the PATH environment variable.
ifdef GCC_PATH
CC = $(GCC_PATH)/$(PREFIX)gcc
AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp
CP = $(GCC_PATH)/$(PREFIX)objcopy
SZ = $(GCC_PATH)/$(PREFIX)size
else
CC = $(PREFIX)gcc
AS = $(PREFIX)gcc -x assembler-with-cpp
CP = $(PREFIX)objcopy
SZ = $(PREFIX)size
endif
HEX = $(CP) -O ihex
BIN = $(CP) -O binary -S
#######################################
# CFLAGS
#######################################
# cpu
CPU = -mcpu=cortex-m4
# fpu
FPU = -mfpu=fpv4-sp-d16
# float-abi
FLOAT-ABI = -mfloat-abi=hard
# mcu
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
# macros for gcc
# AS defines
AS_DEFS =
#===============================================#
# C DEFINE #
#===============================================#
# 433
#C_DEFS = \
#-DUSE_HAL_DRIVER \
#-DSTM32L433xx
# 431
C_DEFS = \
-DUSE_HAL_DRIVER \
-DSTM32L431xx
#===============================================#
# AS includes
AS_INCLUDES = \
-ICore/Inc
# C includes
C_INCLUDES = \
-ICore/Inc \
-IDrivers/STM32L4xx_HAL_Driver/Inc \
-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy \
-IMiddlewares/Third_Party/FreeRTOS/Source/include \
-IMiddlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 \
-IMiddlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F \
-IDrivers/CMSIS/Device/ST/STM32L4xx/Include \
-IDrivers/CMSIS/Include \
-IAFE_OPERATION \
-IBMS_OPERATION \
-IEXTERNAL_COMMUNICATION \
-ICAN_OPERATION
# compile gcc flags
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
ifeq ($(DEBUG), 1)
CFLAGS += -g -gdwarf-2
endif
# Generate dependency information
CFLAGS += -MMD -MP -MF"$(#:%.o=%.d)"
#===============================================#
# LINKER CONFIG #
#===============================================#
# 433
#LDSCRIPT = STM32L433RCTXP_FLASH.ld
# 431
LDSCRIPT = STM32L431CBTx_FLASH.ld
#===============================================#
# libraries
LIBS = -lc -lm -lnosys
LIBDIR =
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
# default action: build all
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
#######################################
# build the application
#######################################
# list of objects
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
vpath %.c $(sort $(dir $(C_SOURCES)))
# list of ASM program objects
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
vpath %.s $(sort $(dir $(ASM_SOURCES)))
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $#
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $#
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
$(CC) $(OBJECTS) $(LDFLAGS) -o $#
$(SZ) $#
$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
$(HEX) $< $#
$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
$(BIN) $< $#
$(BUILD_DIR):
mkdir $#
#flash: build/Testing_fes_bms.bin
# st-flash write build/Testing_fes_bms.bin 0x8000000
# python3 reader_python.py
#######################################
# clean up
#######################################
clean:
-rm -fR $(BUILD_DIR)
#######################################
# dependencies
#######################################
-include $(wildcard $(BUILD_DIR)/*.d)
# *** EOF ***
This is the error I am getting
PS C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN> make
arm-none-eabi-gcc build/main.o build/freertos.o build/stm32l4xx_it.o build/stm32l4xx_hal_msp.o build/stm32l4xx_hal_timebase_tim.o build/stm32l4xx_hal_adc.o build/stm32l4xx_hal_adc_ex.o build/stm32l4xx_hal_can.o build/stm32l4xx_hal.o build/stm32l4xx_hal_i2c.o build/stm32l4xx_hal_i2c_ex.o build/stm32l4xx_hal_rcc.o build/stm32l4xx_hal_rcc_ex.o build/stm32l4xx_hal_flash.o build/stm32l4xx_hal_flash_ex.o build/stm32l4xx_hal_flash_ramfunc.o build/stm32l4xx_hal_gpio.o build/stm32l4xx_hal_dma.o build/stm32l4xx_hal_dma_ex.o build/stm32l4xx_hal_pwr.o build/stm32l4xx_hal_pwr_ex.o build/stm32l4xx_hal_cortex.o build/stm32l4xx_hal_exti.o build/stm32l4xx_hal_tim.o build/stm32l4xx_hal_tim_ex.o build/stm32l4xx_hal_uart.o build/stm32l4xx_hal_uart_ex.o build/system_stm32l4xx.o build/croutine.o build/event_groups.o build/list.o build/queue.o build/stream_buffer.o build/tasks.o build/timers.o build/cmsis_os2.o build/heap_4.o build/port.o build/BMS_OPERATION.o build/USART_OPERATION.o build/AFE_OPERATION.o build/can.o build/startup_stm32l431xx.o -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nano.specs -TSTM32L431CBTx_FLASH.ld -lc -lm -lnosys -Wl,-Map=build/Testing_fes_bms.map,--cref -Wl,--gc-sections -o build/Testing_fes_bms.elf
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/stm32l4xx_it.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: multiple definition of `QUEUE_bmsqueue_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/BMS_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: multiple definition of `QUEUE_bmsqueue_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/USART_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: multiple definition of `QUEUE_bmsqueue_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/USART_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:65: multiple definition of `USART_RX_Queue_Data'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:65: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/USART_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:64: multiple definition of `USART_TASK_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:64: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/USART_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:59: multiple definition of `USART_RX_st_tag_Obj'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:59: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/AFE_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: multiple definition of `QUEUE_bmsqueue_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: first defined here
/11.3.1/thumb/v7e-m+fp/hard\libc_nano.a(libc_a-writer.o): in function `_write_r':/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-cygwin/newlib/libc/reent/writer.c:49: warning: _write is not implemented and will always fail
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:225: build/Testing_fes_bms.elf] Error 1
This is line 225 where the error is occuring
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
$(CC) $(OBJECTS) $(LDFLAGS) -o $#
$(SZ) $#
At last, after a month I was able to resolve this issue. The error was resolved once I solved the following errors
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/stm32l4xx_it.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: multiple definition of `QUEUE_bmsqueue_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/BMS_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: multiple definition of `QUEUE_bmsqueue_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/USART_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: multiple definition of `QUEUE_bmsqueue_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/BMS_OPERATION/BMS_OPERATION.h:136: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/USART_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:65: multiple definition of `USART_RX_Queue_Data'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:65: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/USART_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:64: multiple definition of `USART_TASK_handler'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:64: first defined here
c:/users/syedk/downloads/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: build/USART_OPERATION.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:59: multiple definition of `USART_RX_st_tag_Obj'; build/main.o:C:\Users\syedk\Downloads\FES_BMS-v1.5.3_CAN\FES_BMS-v1.5.2_CAN/EXTERNAL_COMMUNICATION/USART_OPERATION.h:59: first defined here
The issue seems to be that the variables defined in header files need the extern keyword. If the header is included by several files it results in multiple definitions of the same variable. In previous GCC versions, this error is ignored. From GCC 10 a linker error will be reported. Hence the reason why the code was not getting compiled in arm toolchain version > 9

RELEASE and DEBUG build in makefile

I am developing an application for STM32 in stm32cubeIDE
I am using the below custom makefile. Now i want to have a release and a debug build, but they both build the debug build.
I´ve tried
RELDIR = bin/release
DEBUGDIR = bin/debug
ifdef DEBUG
BIN=$(DEBUGDIR)
COMPILERFLAGS += -g3 -O0 -D_DEBUG
else
BIN=$(RELDIR)
COMPILERFLAGS += -O3
endif
and
debug : rebuild
BIN=$(DEBUGDIR)
COMPILERFLAGS += -g3 -O0 -D_DEBUG
release : rebuild
BIN=$(RELDIR)
COMPILERFLAGS += -O3
Can someone tell me how to achieve a release and a debug build :)
Full script:
RED = [31m
GREEN = [32m
YELLOW = [33m
BLUE = [34m
NC = [0m
BIN = bin
SRC = src
INC = inc
SOURCE = $(wildcard $(SRC)/*.c)
OBJECT = $(patsubst %,$(BIN)/%, $(notdir $(SOURCE:.c=.o)))
COMPILER=arm-none-eabi-gcc
ARCHITECTURE=cortex-m4
COMPILERFLAGS= -c -mcpu=$(ARCHITECTURE) -mthumb -mfloat-abi=soft -std=gnu11 -Wall -I $(INC)
LINKERFLAGS= -mcpu=$(ARCHITECTURE) -mthumb -mfloat-abi=soft --specs=nano.specs --specs=rdimon.specs -lc -lrdimon --specs=nosys.specs -T stm32_linker_script.ld -Wl,-Map=out.map
COMPILE= $(COMPILER) $(COMPILERFLAGS) -o $# $<
LINK= $(COMPILER) $(LINKERFLAGS) -o $# $^
RELDIR = bin/release
DEBUGDIR = bin/debug
ifdef DEBUG
BIN=$(DEBUGDIR)
COMPILERFLAGS += -g3 -O0 -D_DEBUG
else
BIN=$(RELDIR)
COMPILERFLAGS += -O3
endif
debug : rebuild
#BIN=$(DEBUGDIR)
#COMPILERFLAGS += -g3 -O0 -D_DEBUG
#
release : rebuild
#BIN=$(RELDIR)
#COMPILERFLAGS += -O3
.PHONY: rebuild
rebuild:
$(MAKE) clean
$(MAKE) all
all : out.elf
#echo "$(GREEN)Done!$(NC)"
out.elf : $(OBJECT)
#echo "$(YELLOW)Linking...$(NC)"
$(LINK)
$(BIN)/%.o : $(SRC)/%.c
$(COMPILE)
.PHONY: all clean debug prep release remake
clean:
#echo "$(GREEN)Cleaning...$(NC)"
rm -rf $(BIN)/*.o $(BIN)/*.elf
I ended up creating two makefiles, one for debug and one for release. It is kind of anoying to have duplicated code, but at least it is obvious what is going on in each script. The scripts are then called from the IDE via "make -f Makefile.DEBUG.mk rebuild" and "make -f Makefile.REBUILD.mk rebuild"
#RED = [31m
#GREEN = [32m
#YELLOW = [33m
BLUE = [34m
NC = [0m
BIN = bin/release
SRC = src
INC = inc
MAKE = make -f Makefile.RELEASE.mk
COMPILER=arm-none-eabi-gcc
ARCHITECTURE=cortex-m4
COMPILERFLAGS= -c -mcpu=$(ARCHITECTURE) \
-mthumb -mfloat-abi=soft -std=gnu11 -Wall -O3 -I $(INC)
LINKERFLAGS= -mcpu=$(ARCHITECTURE) \
-mthumb -mfloat-abi=soft \
--specs=nano.specs \
-T stm32_linker_script.ld \
-Wl,-Map=$(BIN)/out.map
COMPILE= $(COMPILER) $(COMPILERFLAGS) -o $# $<
LINK= $(COMPILER) $(LINKERFLAGS) -o $(BIN)/$# $^
SOURCE = $(wildcard $(SRC)/*.c)
OBJECT = $(patsubst %,$(BIN)/%, $(notdir $(SOURCE:.c=.o)))
.PHONY: rebuild
rebuild:
$(MAKE) clean
$(MAKE) all
all : out.elf
#echo "$(BLUE)Done!$(NC)"
out.elf : $(OBJECT)
#echo "$(BLUE)Linking...$(NC)"
$(LINK)
$(BIN)/%.o : $(SRC)/%.c
$(COMPILE)
.PHONY: all clean
clean:
#echo "$(BLUE)Cleaning...$(NC)"
rm -rf $(BIN)/*.o $(BIN)/*.elf $(BIN)/*.map
and
#RED = [31m
#GREEN = [32m
#YELLOW = [33m
BLUE = [34m
NC = [0m
BIN = bin/debug
SRC = src
INC = inc
MAKE = make -f Makefile.DEBUG.mk
COMPILER=arm-none-eabi-gcc
ARCHITECTURE=cortex-m4
COMPILERFLAGS= -c -mcpu=$(ARCHITECTURE) \
-mthumb -mfloat-abi=soft -std=gnu11 -Wall -g -I $(INC)
LINKERFLAGS= -mcpu=$(ARCHITECTURE) \
-mthumb -mfloat-abi=soft \
--specs=nano.specs \
--specs=rdimon.specs -lc -lrdimon \
--specs=nosys.specs \
-T stm32_linker_script.ld \
-Wl,-Map=$(BIN)/out.map
COMPILE= $(COMPILER) $(COMPILERFLAGS) -o $# $<
LINK= $(COMPILER) $(LINKERFLAGS) -o $(BIN)/$# $^
SOURCE = $(wildcard $(SRC)/*.c)
OBJECT = $(patsubst %,$(BIN)/%, $(notdir $(SOURCE:.c=.o)))
.PHONY: rebuild
rebuild:
$(MAKE) clean
$(MAKE) all
all : out.elf
#echo "$(BLUE)Done!$(NC)"
out.elf : $(OBJECT)
#echo "$(BLUE)Linking...$(NC)"
$(LINK)
$(BIN)/%.o : $(SRC)/%.c
$(COMPILE)
.PHONY: all clean
clean :
#echo "$(BLUE)Cleaning...$(NC)"
rm -rf $(BIN)/*.o $(BIN)/*.elf $(BIN)/*.map

mpif90 not found but it's intsalled

I'm trying to run a makefile and came across two errors. When I run make I get this:
$ make
mpif90 -xHost -ip -fpp -O3 -align -I/include/intel64/lp64 -I/include/fftw -c integ-Coul.F
make: mpif90: Command not found
make: *** [makefile:181: integ-Coul.o] Error 127
So, I already have installed openmpi-devel and the file mpif90 it's in the /usr/lib64/openmpi/bin folder, but the error keeps reocurring.
This is the makefile
#
.SUFFIXES:
.SUFFIXES: .f .F .for .cpp .F90 .cu .o
#FC=ifort -xHost -ip -fpp
FC = mpif90 -xHost -ip -fpp
FREE = -free
# use this flag for debugging and coding up
SAFE = #-g -traceback -check all #-fstack-protector -assume protect_parens -implicitnone -warn all
FFLAGS1 = -O3 -align
FFLAGS2 = -O2 -align -qopenmp -parallel $(FREE) $(SAFE)
LDFLAGS = -static-intel
CXX = icpc -std=c++11
SAFE_CXX = #-g -traceback
CFLAGS = -O2 -align -xHost -ip -qopenmp -fno-exceptions -restrict $(SAFE_CXX)
# MKLROOT = If MKLROOT is not defined in your environment, edit and uncomment this line
LIB_BLAS = -lmkl_blas95_lp64
LIB_LAPACK = -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core
LIB_OMP = -liomp5 -lpthread
INCS_MKL = -I$(MKLROOT)/include/intel64/lp64 -I$(MKLROOT)/include/fftw
# Uncomment the lines below when compiling for GPUs
# GPU_DEFS options:
# -DGPU_TIMING : Print timings (CPU/GPU)
# -DUSE_GPU : Compile with GPU support
# -DGPU_DEBUG : Print some debug messages
# -DGPU_SYGVDM_VER : Use multi-gpu version of SYGVD (faster than single-gpu even with 1 gpu)
# -DGPU_SYGVD2S_VER : Use two stage version of SYGVD (faster, but needs more memory)
# -DGPU_DONT_PIN_MEM : Don't use pinned memory for faster transfers (in Fortran code)
# -DGPU_PIN_MEM_WORK : Use pinned memory for work spaces (in C code)
#GPU_DEFS = -DUSE_GPU
#
ifneq (,$(findstring USE_GPU,$(GPU_DEFS)))
# CUDA compiler
NVCC = nvcc
# compute capality (depends on your GPU, check!)
SM = 35
#SAFE_NVCC = -g -lineinfo
NVCCFLAGS = -O3 -gencode arch=compute_${SM},code=sm_${SM} -Xcompiler "-fno-strict-aliasing -march=native -fno-exceptions" $(SAFE_NVCC)
# -fno-strict-aliasing
#
# CUDA and MAGMA paths:
CUDADIR = /usr/local/cuda
MAGMADIR = /opt/magma
#
# CUDA and MAGMA libs:
# dynamic linking:
#LIB_CUDA = -L$(CUDADIR)/lib64 -lcublas -lcusparse -lcudart
# static linking:
LIB_CUDA = -L$(CUDADIR)/lib64 -lcublas_static -lcusparse_static -lculibos -lcudart_static -ldl
LIB_MAGMA = $(MAGMADIR)/lib/libmagma.a
#
LIB_GPU = $(LIB_MAGMA) $(LIB_CUDA) -lstdc++
INCS_GPU = -I$(CUDADIR)/include -I$(MAGMADIR)/include
endif
LIB = $(LIB_GPU) $(LIB_BLAS) $(LIB_LAPACK) $(LIB_OMP) -lrt
INCS = $(INCS_MKL)
#-----------------------------------------------------------------------
# general rules
#-----------------------------------------------------------------------
#INCS1 = comun.inc integcoul.inc m2cdat.inc $(INCS)
SOURCE1 = integ-Coul.o \
Coul0sim.o \
m2caux3-Coul.o \
abcpes-Coul.o \
ckplm-Coul.o \
util-Coul.o
SOURCE2 = constants_m.o \
Matrix_math.o \
exec_time.o \
types_EHT.o \
types_MM.o \
parameters.o \
MPI_defs.o \
OPT_parent.o \
parameters_MM.o \
checklist.o \
allocation_m.o \
util.o \
EHT_input.o \
tuning.o \
IdentifyNonBonded.o \
babel_routines.o \
babel.o \
gmx2mdflex.o \
namd2mdflex.o \
structure.o \
md_read.o \
md_setup.o \
f_intra.o \
f_inter.o \
md_output.o \
pbc.o \
overlap_D.o \
STO.o \
multip_routines.o \
LCMO_Builder.o \
Coulomb.o \
DP_main.o \
td_dp.o \
DP_FMO.o \
dipole_phi.o \
EnvField.o \
polarizability.o \
hamiltonians.o \
QCModel_Huckel.o \
diabatic-Ehren.o \
HuckelForces.o \
Ehrenfest.o \
CoulInt_QMMM.o \
FMO.o \
electron_hole_DP.o \
AlphaPolar.o \
data_output.o \
backup_MM.o \
Berendsen.o \
NoseHoover.o \
NoseHoover_Reversible.o \
NVE.o \
VDOS_m.o \
MM_dynamics.o \
MM_driver.o \
film_STO.o \
DOS_m.o \
oscillator.o \
ga_QCModel.o \
cost_tuning_EH.o \
cost_tuning_MM.o \
nonlinearCG.o \
CG_class.o \
MM_ERG_class.o \
nonlinear-sidekick.o \
FF_OPT_class.o \
CG_EH_driver.o \
ga_routines.o \
CG_MM_driver.o \
vibes_driver.o \
solvated_M.o \
DOS_tool.o \
backup.o \
auto_correlation.o \
ElHl_schroedinger.o \
diagnostic.o \
qdynamics.o \
Taylor.o \
ElHl_Chebyshev.o \
ElHl_Chebyshev_GPU.o \
AO_adiabatic.o \
Chebyshev_driver.o \
eigen_driver.o \
ga_driver.o \
avrg_confgs.o \
main.o
SOURCE_GPU = GPU_Interface.o \
Taylor_gpu.o
# Chebyshev_gpu.o
ifneq (,$(findstring USE_GPU,$(GPU_DEFS)))
SOURCE_CUDA= Chebyshev_gpu_kernels.o \
dzgemv_kernels.o
endif
a: $(SOURCE1) $(SOURCE2) $(SOURCE_GPU) $(SOURCE_CUDA)
rm -f a
$(FC) $(INCS) $(LDFLAGS) -o a $(SOURCE1) $(SOURCE2) $(SOURCE_GPU) $(SOURCE_CUDA) $(LIB)
.F.o:
$(FC) $(FFLAGS1) $(INCS) -c $<
.f.o:
$(FC) $(FFLAGS2) $(INCS) $(GPU_DEFS) -c $<
.F90.o:
$(FC) $(FFLAGS1) $(INCS) $(GPU_DEFS) -c $<
.cpp.o:
$(CXX) $(CFLAGS) $(INCS_GPU) $(GPU_DEFS) -c $<
.cu.o:
$(NVCC) $(NVCCFLAGS) $(INCS_GPU) $(GPU_DEFS) -c $<
clean:
-rm -f a *.o *.mod; touch *.f
depend:
#echo -en "Searching module dependencies..."
#chmod +x ./makedepend.bsh
#./makedepend.bsh > dependencies.txt
#echo -en " done.\n"
## Dependency list:
-include dependencies.txt
I don't have much experience so I would really appreciate some help with this. Thank you all.
Ps.: my SO is Fedora 32

How to use include in gfortran?

I am trying to rewrite a Makefile for gfortran instead of g77. If I include the line
FCFLAGS += -I./include
then it looks for a .mod file that I do not have, but if I omit that line it can't find a file it needs in the ./include directory. Not sure how to fix this...
CMD = tomoDD2
CC = gcc
FC = /usr/local/bin/gfortran
FCFLAGS = -g -fbounds-check
FCFLAGS = -O2
FCFLAGS += -I./include
SRCS = $(CMD).f \
aprod.f cluster_tomoDD.f covar.f datum.f \
delaz.f delaz2.f direct1.f dist.f exist.f \
freeunit.f getinp_tomoDD.f ifindi.f \
indexxi.f juliam.f syn_time_new.f\
lsqr.f matmult1.f matmult2.f matmult3.f mdian1.f \
normlz.f ran.f redist.f refract.f \
resstat_tomoDD.f scopy.f sdc2.f setorg.f \
snrm2.f sort.f sorti.f sscal.f \
svd.f tiddid.f trialsrc_tomoDD.f trimlen.f \
ttime.f vmodel.f Ray3VD.f \
getdata_tomoDD.f add_sta.f find_id.f \
dtres_tomoDD.f weighting_tomoDD_lw.f lsfitH_tomoDD_lsqrn.f
CSRCS = atoangle_.c atoangle.c ndatetime_.c nhypot_.c nrpad_.c \
sscanf3_.c
OBJS = $(SRCS:%.f=%.o) $(CSRCS:%.c=%.o)
INCLDIR = ./include
all: $(CMD)
$(CMD): $(OBJS)
$(FC) $(OBJS) $(LIBS) -o $#
%.o: %.f
$(FC) $(FCFLAGS) -c $(#F:.o=.f) -o $#
# $(FC) $(FCFLAGS) -c $<
clean:
-rm -f $(CMD) *.o core a.out *.fln junk
Because the modules have to be compiled first individually before compiling the main file in fortran.

running linker in bare-metal arm example and linker can't find the loader file which exists

I found a bare-metal example for a board different from mine so I will have to modify the loader script but for now I just want to be able to compile and link the example as it is.
I copied the arm-none-eabi cross-compiler to the directory just above c_blinky which is where the source files are.
(I have a diagram of the directory structure on a page on my website)
Here's the makefile:
ifeq ($(GNU_ARM),)
GNU_ARM = ../arm-none-eabi/bin
endif
CC := $(GNU_ARM)/arm-none-eabi-gcc
CPP := $(GNU_ARM)/arm-none-eabi-g++
ASM := $(GNU_ARM)/arm-none-eabi-as
LINK := $(GNU_ARM)/arm-none-eabi-gcc
BIN := $(GNU_ARM)/arm-none-eabi-objcopy
RM := rm -rf
MKDIR := mkdir
BLDDIR = .
CCINC = -I$(BLDDIR)
APP_DEP = $(BLDDIR)/bsp.h \
$(BLDDIR)/arm_exc.h \
$(BLDDIR)/isr.h
APP_NAME = blinky
ARM_CORE = arm7tdmi
ifeq (rel, $(CONF)) # Release configuration
BINDIR = rel
CCFLAGS = -c -mcpu=$(ARM_CORE) -mthumb-interwork -Os \
-mlong-calls -ffunction-sections -Wall -DNDBEBUG -o$#
ASMFLAGS = -mcpu=$(ARM_CORE) -mthumb-interwork -o$#
LINKFLAGS = -T .\$(APP_NAME).ld -o $(BINDIR)\$(APP_NAME).elf \
-Wl,-Map,$(BINDIR)\$(APP_NAME).map,--cref,--gc-sections
else # default Debug configuration
BINDIR = dbg
CCFLAGS = -g -c -mcpu=$(ARM_CORE) -mthumb-interwork -O \
-mlong-calls -ffunction-sections -Wall -o$#
ASMFLAGS = -g -mcpu=$(ARM_CORE) -mthumb-interwork -o$#
LINKFLAGS = -T .\$(APP_NAME).ld -o $(BINDIR)\$(APP_NAME).elf \
-Wl,-Map,$(BINDIR)\$(APP_NAME).map,--cref,--gc-sections
endif
all: $(BINDIR)/$(APP_NAME).bin
$(BINDIR)/$(APP_NAME).bin : $(BINDIR)/$(APP_NAME).elf
$(BIN) -O binary $(BINDIR)/$(APP_NAME).elf $(BINDIR)/$(APP_NAME).bin
$(BINDIR)/$(APP_NAME).elf : \
./$(APP_NAME).ld \
$(BINDIR)/startup.o \
$(BINDIR)/arm_exc.o \
$(BINDIR)/low_level_init.o \
$(BINDIR)/isr.o \
$(BINDIR)/bsp.o \
$(BINDIR)/blinky.o
$(LINK) \
$(BINDIR)/startup.o \
$(BINDIR)/arm_exc.o \
$(BINDIR)/low_level_init.o \
$(BINDIR)/isr.o \
$(BINDIR)/bsp.o \
$(BINDIR)/blinky.o \
$(LINKFLAGS)
$(BINDIR)/startup.o: $(BLDDIR)/startup.s
$(ASM) $(ASMFLAGS) $<
$(BINDIR)/arm_exc.o: $(BLDDIR)/arm_exc.s
$(ASM) $(ASMFLAGS) $<
# choose the ARM or THUMB compilation for each module...
$(BINDIR)/low_level_init.o: $(BLDDIR)/low_level_init.c $(APP_DEP)
$(CC) -marm $(CCFLAGS) $(CCINC) $<
$(BINDIR)/isr.o: $(BLDDIR)/isr.c $(APP_DEP)
$(CC) -marm $(CCFLAGS) $(CCINC) $<
$(BINDIR)/bsp.o: $(BLDDIR)/bsp.c $(APP_DEP)
$(CC) -mthumb $(CCFLAGS) $(CCINC) $<
$(BINDIR)/blinky.o: $(BLDDIR)/blinky.c $(APP_DEP)
$(CC) -mthumb $(CCFLAGS) $(CCINC) $<
I set GNU_ARM in the makefile to ../arm-none-eabi/bin and ran make and got the following error:
(the file blinky.ld does exist in the source directory)
../arm-none-eabi/bin/arm-none-eabi-gcc \
dbg/startup.o \
dbg/arm_exc.o \
dbg/low_level_init.o \
dbg/isr.o \
dbg/bsp.o \
dbg/blinky.o \
-T .\blinky.ld -o dbg\blinky.elf -Wl,-Map,dbg\blinky.map,--cref,--gc-sections
/home/dan/dev/compile/bare-metal/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot open linker script file .blinky.ld: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [dbg/blinky.elf] Error 1
I thought the LINK assignment at the beginning should be:
LINK := $(GNU_ARM)/arm-none-eabi-ld
and not
LINK := $(GNU_ARM)/arm-none-eabi-gcc
and I got:
../arm-none-eabi/bin/arm-none-eabi-ld \
dbg/startup.o \
dbg/arm_exc.o \
dbg/low_level_init.o \
dbg/isr.o \
dbg/bsp.o \
dbg/blinky.o \
-T .\blinky.ld -o dbg\blinky.elf -Wl,-Map,dbg\blinky.map,--cref,--gc-sections
../arm-none-eabi/bin/arm-none-eabi-ld: cannot open linker script file .blinky.ld: No such file or directory
make: *** [dbg/blinky.elf] Error 1
It looks like arm-none-eabi-gcc is calling collect2 in lib/gcc/arm-none-eabi/4.9.3 which in turn calls ld which is not in the main bin directory:
/home/dan/dev/compile/bare-metal/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld:
I tried making a symbolic link to arm-none-eabi-ld as ld and got the same error.

Resources