Skip to content

Commit c6c8d42

Browse files
authored
Merge pull request #2303 from theotherjimmy/export-asm-symbols
Add missing --preinclude and -input on assembly files
2 parents 68d48ea + 3873ccc commit c6c8d42

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

tools/export/exporters.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def progen_flags(self):
6262
if self.config_header:
6363
self._progen_flag_cache['c_flags'] += self.toolchain.get_config_option(self.config_header)
6464
self._progen_flag_cache['cxx_flags'] += self.toolchain.get_config_option(self.config_header)
65+
self._progen_flag_cache['asm_flags'] += self.toolchain.get_config_option(self.config_header)
6566
return self._progen_flag_cache
6667

6768
def __scan_and_copy(self, src_path, trg_path):
@@ -196,6 +197,7 @@ def scan_and_copy_resources(self, prj_paths, trg_path, relative=False):
196197
self.config_header = self.toolchain.MBED_CONFIG_FILE_NAME
197198
config.get_config_data_header(join(trg_path, self.config_header))
198199
self.config_macros = []
200+
self.resources.inc_dirs.append(".")
199201
else:
200202
# And add the configuration macros to the toolchain
201203
self.config_macros = config.get_config_data_macros()

tools/export/gcc_arm_common.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ all: $(PROJECT).bin $(PROJECT).hex size
8989

9090
.asm.o:
9191
+@$(call MAKEDIR,$(dir $@))
92-
$(CC) $(CPU) -c $(ASM_FLAGS) -o $@ $<
92+
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
9393
.s.o:
9494
+@$(call MAKEDIR,$(dir $@))
95-
$(CC) $(CPU) -c $(ASM_FLAGS) -o $@ $<
95+
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
9696
.S.o:
9797
+@$(call MAKEDIR,$(dir $@))
98-
$(CC) $(CPU) -c $(ASM_FLAGS) -o $@ $<
98+
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
9999

100100
.c.o:
101101
+@$(call MAKEDIR,$(dir $@))

tools/export/iar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ def generate(self, progen_build=False):
7676
project_data['tool_specific']['iar'].setdefault("misc", {})
7777
project_data['tool_specific']['iar'].update(tool_specific['iar'])
7878
project_data['tool_specific']['iar']['misc'].update(self.progen_flags)
79+
project_data['tool_specific']['iar']['misc']['asm_flags'].remove(
80+
self.toolchain.get_config_option(self.config_header)[0])
81+
project_data['tool_specific']['iar']['misc']['asm_flags'].extend(
82+
['-D%s' % d for d in self.toolchain.get_symbols()])
7983
# VLA is enabled via template IccAllowVLA
8084
project_data['tool_specific']['iar']['misc']['c_flags'].remove("--vla")
8185
project_data['common']['build_dir'] = os.path.join(project_data['common']['build_dir'], 'iar_arm')

0 commit comments

Comments
 (0)