Reputation: 93
I am trying to compile a FirmwareProject which has both C and C++ code using LLVM/Clang. But, I get the following error which I am not able to get rid of:
Description Resource Path Location
expected top-level entity Bx000484 line 1, external location: C:\Program Files (x86)\msys64\mingw64\bin\llvm-as.exe: obj\rel\LibStm32f10x\LibStm32f10x\src\cortexm3_macro.s.o.s
I tried trying the different LLVM compiler and linker flags. But nothing seems to work:
### Global complier and linker settings
INCLUDES_APP := -I$(GLOBALS_DIR)/inc -I$(LIBGLOBALS_DIR)/inc -I$(LIBSTM32F10X_DIR)/inc
AFLAGS :=
CFLAGS := -Wall -Wextra -Wmissing-field-initializers -Wstrict-prototypes -mcpu=cortex-m3 -mthumb -fsigned-char -ffunction-sections -mlittle-endian -D_FLASH_PROG
CXXFLAGS := -Wall -Wnarrowing -Wextra -Wmissing-field-initializers -mcpu=cortex-m3 -mthumb -fno-rtti -fno-exceptions -fsigned-char -ffunction-sections -mlittle-endian -D_FLASH_PROG
LINKER_FILE := $(LD_DIR)/STM32F101_64K_10K_FLASH.ld
LFLAGS := --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group \
-mcpu=cortex-m3 -mthumb -Wl,-L$(LD_DIR) -Wl,-static -Wl,--gc-sections -nostartfiles --specs=nosys.specs -specs=nano.specs
### TOOLCHAIN
COMMAND_DIR := "$(PROGRAMFILES)\msys64\mingw64\bin"
COMMAND_PREFIX := arm-none-eabi-
CMD_PREFIX := arm-none-eabi-
CC := $(COMMAND_DIR)/clang
CPPC := $(COMMAND_DIR)/clang++
ASM := $(COMMAND_DIR)/llvm-as
LINK := $(COMMAND_DIR)/clang++
ELFBIN := $(COMMAND_DIR)/objcopy
AR := $(COMMAND_DIR)/llvm-ar
SIZE := $(COMMAND_DIR)/llvm-size
Upvotes: 1
Views: 3203
Reputation: 34411
llvm-as
command assembles LLVM IR sources, not assembler ones. Try using clang
as ASM
, or llvm-mc -assemble
.
Upvotes: 3