Skip to content

Drop include paths for ARM assembler #6713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
*/

#include "memory_zones.h"
#include "../memory_zones.h"

__initial_sp EQU ZBT_SSRAM23_START + ZBT_SSRAM23_SIZE ; Top of ZBT SSRAM2 and 3, used for data

Expand Down
2 changes: 1 addition & 1 deletion tools/export/uvision/uvision.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
<MiscControls>{{asm_flags}}</MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath>{{include_paths}}</IncludePath>
<IncludePath></IncludePath>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually reverts ebc9289 and solves the problem @hug-dev was having by updating the path in targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/TOOLCHAIN_ARM_STD/startup_MPS2.S ? The include is still there, where does assembler finds it? - not clear to me.

</VariousControls>
</Aads>
<LDads>
Expand Down
26 changes: 15 additions & 11 deletions tools/toolchains/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, target, notify=None, macros=None,

ARM_BIN = join(TOOLCHAIN_PATHS['ARM'], "bin")
ARM_INC = join(TOOLCHAIN_PATHS['ARM'], "include")

main_cc = join(ARM_BIN, "armcc")

self.flags['common'] += ["--cpu=%s" % cpu]
Expand Down Expand Up @@ -135,17 +135,18 @@ def get_dep_option(self, object):
def get_config_option(self, config_header):
return ['--preinclude=' + config_header]

def get_compile_options(self, defines, includes, for_asm=False):
def get_compile_options(self, defines, includes, for_asm=False):
opts = ['-D%s' % d for d in defines]
if for_asm:
return opts
if self.RESPONSE_FILES:
opts += ['--via', self.get_inc_file(includes)]
else:
opts += ["-I%s" % i for i in includes]

if not for_asm:
config_header = self.get_config_header()
if config_header is not None:
opts = opts + self.get_config_option(config_header)
config_header = self.get_config_header()
if config_header is not None:
opts = opts + self.get_config_option(config_header)
return opts

@hook_tool
Expand All @@ -154,27 +155,30 @@ def assemble(self, source, object, includes):
dir = join(dirname(object), '.temp')
mkdir(dir)
tempfile = join(dir, basename(object) + '.E.s')

# Build preprocess assemble command
cmd_pre = self.asm + self.get_compile_options(self.get_symbols(True), includes) + ["-E", "-o", tempfile, source]
cmd_pre = copy(self.asm)
cmd_pre.extend(self.get_compile_options(
self.get_symbols(True), includes, True))
cmd_pre.extend(["-E", "-o", tempfile, source])

# Build main assemble command
cmd = self.asm + ["-o", object, tempfile]

# Call cmdline hook
cmd_pre = self.hook.get_cmdline_assembler(cmd_pre)
cmd = self.hook.get_cmdline_assembler(cmd)

# Return command array, don't execute
return [cmd_pre, cmd]

@hook_tool
def compile(self, cc, source, object, includes):
# Build compile command
cmd = cc + self.get_compile_options(self.get_symbols(), includes)

cmd.extend(self.get_dep_option(object))

cmd.extend(["-o", object, source])

# Call cmdline hook
Expand Down