Skip to content

fix unresolved linker msg: __wrap_ #4822

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 2 commits into from
Aug 10, 2017

Conversation

JojoS62
Copy link
Contributor

@JojoS62 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
Copy link
Contributor Author

JojoS62 commented Jul 27, 2017

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

@@ -200,7 +200,7 @@ class GccArm(Makefile):

@staticmethod
def prepare_lib(libname):
return "-l:" + libname
return "-l" + libname[3:-2]
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

@JojoS62 JojoS62 Jul 27, 2017

Choose a reason for hiding this comment

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

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'?

Copy link
Contributor

@theotherjimmy theotherjimmy Jul 27, 2017

Choose a reason for hiding this comment

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

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
Copy link
Contributor

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

@theotherjimmy
Copy link
Contributor

This should actually fix the eclipse_gcc_arm exporter too!

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

LGTM!

@theotherjimmy
Copy link
Contributor

/morph export-build

@theotherjimmy
Copy link
Contributor

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
Copy link
Contributor

0xc0170 commented Jul 31, 2017

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

@JojoS62
Copy link
Contributor Author

JojoS62 commented Jul 31, 2017

@theotherjimmy what have I to do for the rebase?

@theotherjimmy
Copy link
Contributor

@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 JojoS62 force-pushed the fix-makefile-exporter branch from 078608d to 0c25444 Compare July 31, 2017 21:35
@JojoS62
Copy link
Contributor Author

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
Copy link
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
Copy link
Contributor

/morph export-build

@mbed-bot
Copy link

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
Copy link
Contributor

0xc0170 commented Aug 9, 2017

/morph export-build

@mbed-bot
Copy link

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!

@theotherjimmy theotherjimmy merged commit 92ac0ab into ARMmbed:master Aug 10, 2017
@JojoS62 JojoS62 deleted the fix-makefile-exporter branch August 10, 2017 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants