title: LLVM/Clang Error: Expected top-level entity
body: <p>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:</p>
  
  <pre><code>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    
  </code></pre>
  
  <p>I tried trying the different LLVM compiler and linker flags. But nothing seems to work:</p>
  
  <pre><code>### 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
  </code></pre>