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

fix unresolved linker msg: __wrap_ #4822

Merged
merged 2 commits into from Aug 10, 2017

Conversation

Projects
None yet
4 participants
@JojoS62
Contributor

JojoS62 commented Jul 27, 2017

Description

Issue #3673
The make_gcc_arm exporter for mbed os 2 fails with linker errors for wrapper functions. These can be fixed by adding the libraries to the linker group

Status

READY

Migrations

If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.

NO

Todos

  • Tests

Steps to test or reproduce

import mbed classic program
mbed export -i make_gcc_arm
make

will fail with messages like:

undefined` reference to `__wrap__free_r'
@JojoS62

This comment has been minimized.

Contributor

JojoS62 commented Jul 27, 2017

@theotherjimmy finally... from a fresh forked repo.

tools/export/makefile/__init__.py Outdated
@@ -200,7 +200,7 @@ class GccArm(Makefile):
@staticmethod
def prepare_lib(libname):
return "-l:" + libname
return "-l" + libname[3:-2]

This comment has been minimized.

@theotherjimmy

theotherjimmy Jul 27, 2017

Contributor

Could we check for the lib prefix here before we strip it? Don't worry about the .a suffix, it's gaurenteed.

This comment has been minimized.

@JojoS62

JojoS62 Jul 27, 2017

Contributor

Isn't the name generated by prefix + name + suffix because its a gcc naming convention? And what to assume when the prefix is not 'lib'?

This comment has been minimized.

@theotherjimmy

theotherjimmy Jul 27, 2017

Contributor

It should be, but you can easily generate a library by using the ar command yourself that does not follow the standard. I think there are versions of mbed OS 5 and 2 that contain libraries that do not conform (It won't happen in the future, we have a Travis CI check to prevent that now). It should be pretty safe to add that check.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jul 27, 2017

NICE! You got it working, and the diff looks correct!

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jul 27, 2017

This should actually fix the eclipse_gcc_arm exporter too!

@theotherjimmy

LGTM!

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jul 27, 2017

/morph export-build

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jul 27, 2017

Travis, what are you doing?! How can you succed with PIP but fail to load the python modlue you just installed!

Just expressing frustration unrelated to this PR, But we will have to rebuild in travis.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jul 31, 2017

The travis should be fixed on master. @JojoS62 Can you please rebase?

@theotherjimmy theotherjimmy added needs: work and removed needs: CI labels Jul 31, 2017

@JojoS62

This comment has been minimized.

Contributor

JojoS62 commented Jul 31, 2017

@theotherjimmy what have I to do for the rebase?

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jul 31, 2017

@JojoS62 You should pull down the latest armmbed master and rebase your branch onto it. For example (with fix-makefile-exporter checked out, assuming that armmbed/mbed-os is the armmbed remote):

  1. git fetch armmbed
  2. git rebase armmbed/master
  3. git push -f

JojoS62 added some commits Jul 27, 2017

fix unresolved linker msg: __wrap_
adding  libraries to gcc linker group command

@JojoS62 JojoS62 force-pushed the JojoS62:fix-makefile-exporter branch to 0c25444 Jul 31, 2017

@JojoS62

This comment has been minimized.

Contributor

JojoS62 commented Jul 31, 2017

ok, something happend.
And to keep my master up to date I just use 'git fetch armmbed/master' when my master is checked out?

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jul 31, 2017

@JojoS62 That looks correct! and Travis CI Passed!

git fetch armmbed/master will keep the ref armmbed/master up to date. To keep your master branch up to date with armmbed/master you could just run git pull armmbed master with your master branch checked out. That's what I do. NOTE: That will only work if you never commit to master. If you commit to master, then you will get a merge commit, and you cannot rebase with your local master anymore. If that happens, let me know and I can give you some steps to mitigate that problem.

@theotherjimmy theotherjimmy added needs: CI and removed needs: work labels Aug 7, 2017

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Aug 7, 2017

/morph export-build

@mbed-bot

This comment has been minimized.

mbed-bot commented Aug 7, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 115

Exporter Build failed!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 9, 2017

/morph export-build

@mbed-bot

This comment has been minimized.

mbed-bot commented Aug 9, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 117

All exports and builds passed!

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Aug 9, 2017

@theotherjimmy theotherjimmy merged commit 92ac0ab into ARMmbed:master Aug 10, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-export-build Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@JojoS62 JojoS62 deleted the JojoS62:fix-makefile-exporter branch Aug 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment