Skip to content

Export, MCUXpresso: Avoid assigning self.libraries #7937

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 1 commit into from
Oct 10, 2018
Merged
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
9 changes: 4 additions & 5 deletions tools/export/mcuxpresso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def generate(self):
for lib in self.libraries:
l, _ = splitext(basename(lib))
libraries.append(l[3:])
self.libraries = libraries

self.system_libraries = [
'stdc++', 'supc++', 'm', 'c', 'gcc', 'nosys'
Expand Down Expand Up @@ -156,7 +155,7 @@ def generate(self):
else:
opts['parent_id'] = 'release'

self.process_options(opts, flags)
self.process_options(opts, flags, libraries)

opts['as']['defines'] = self.as_defines
opts['c']['defines'] = self.c_defines
Expand All @@ -171,7 +170,7 @@ def generate(self):
self.filter_dot(s) for s in self.resources.lib_dirs]

opts['ld']['object_files'] = objects
opts['ld']['user_libraries'] = self.libraries
opts['ld']['user_libraries'] = libraries
opts['ld']['system_libraries'] = self.system_libraries
opts['ld']['script'] = "linker-script-%s.ld" % id
opts['cpp_cmd'] = " ".join(toolchain.preproc)
Expand Down Expand Up @@ -305,7 +304,7 @@ def build(project_name, log_name="build_log.txt", cleanup=True):

# -------------------------------------------------------------------------

def process_options(self, opts, flags_in):
def process_options(self, opts, flags_in, libraries):
"""
CDT managed projects store lots of build options in separate
variables, with separate IDs in the .cproject file.
Expand Down Expand Up @@ -701,7 +700,7 @@ def process_options(self, opts, flags_in):
opts['ld'][
'other'] += ' '.join('-l' + s for s in self.system_libraries) + ' '
opts['ld'][
'other'] += ' '.join('-l' + s for s in self.libraries)
'other'] += ' '.join('-l' + s for s in libraries)
opts['ld']['other'] += ' -Wl,--end-group '

# Strip all 'other' flags, since they might have leading spaces.
Expand Down