Skip to content

Include user defined static lib files in the Linker object files paths #7758

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
Aug 27, 2018

Conversation

phyokyaw
Copy link

@phyokyaw phyokyaw commented Aug 10, 2018

Description

This is to fix linker not finding symbols declared in object files inside static library files.

For this case throwing:-

rm-none-eabi-g++: error: unrecognized command line option '--wrap=main'; did you mean '--warn-main'?

For this case to include libmbed.a which contains

mbed_alloc_wrappers.o:
U __real__calloc_r
U __real__free_r
U __real__malloc_r
U __real__memalign_r
U __real__realloc_r
00000000 T __wrap__calloc_r
00000000 T __wrap__free_r
00000000 T __wrap__malloc_r
00000000 T __wrap__memalign_r
00000000 T __wrap__realloc_r
00000000 T free_wrapper
00000000 T malloc_wrapper
00000000 T mbed_stats_heap_get
U memset

This patch also changed the library order to system and then user.

-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -lmbed

Resolves: #7155

Pull request type

[ x ] Fix
[ ] Refactor
[ ] Target update
[ ] Feature
[ ] Breaking change

@cmonr
Copy link
Contributor

cmonr commented Aug 10, 2018

@phyokyaw Please update your comment to indicate what kind of PR this is.

Additionally, what does 7155 refer to?

… files path.

### Description

This is to fix linker not finding symbols declared in object files inside static library files.

For this case throwing:-

> rm-none-eabi-g++: error: unrecognized command line option '--wrap=main'; did you mean '--warn-main'?

For this case to include libmbed.a which contains

mbed_alloc_wrappers.o:
         U __real__calloc_r
         U __real__free_r
         U __real__malloc_r
         U __real__memalign_r
         U __real__realloc_r
00000000 T __wrap__calloc_r
00000000 T __wrap__free_r
00000000 T __wrap__malloc_r
00000000 T __wrap__memalign_r
00000000 T __wrap__realloc_r
00000000 T free_wrapper
00000000 T malloc_wrapper
00000000 T mbed_stats_heap_get
         U memset

This patch also changed the library order to system and then user.

-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -lmbed

Resolves: ARMmbed#7155

### Pull request type

    [ x ] Fix
    [ ] Refactor
    [ ] Target update
    [ ] Feature
    [ ] Breaking change
@phyokyaw
Copy link
Author

@cmonr Thanks for you comment. I amended the commit title and message. 7155 is the issue this PR is related to, added reference at the bottom of the message.

Thanks
Phyo

@cmonr cmonr changed the title #7155: Updated to include user defined static lib files in the Linker… Include user defined static lib files in the Linker object files paths Aug 13, 2018
@cmonr cmonr requested a review from theotherjimmy August 13, 2018 14:22
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 24, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Aug 24, 2018

Build : SUCCESS

Build number : 2894
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7758/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Aug 24, 2018

@mbed-ci
Copy link

mbed-ci commented Aug 25, 2018

@cmonr
Copy link
Contributor

cmonr commented Aug 26, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Aug 26, 2018

@cmonr
Copy link
Contributor

cmonr commented Aug 27, 2018

/morph mbed2-build

@0xc0170 0xc0170 merged commit 2dfd3be into ARMmbed:master Aug 27, 2018
@adbridge
Copy link
Contributor

adbridge commented Sep 7, 2018

This is on top of changes only present in 5.10, so moving to 5.10.1

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.

Error occurs when building exported mbed-os programs on e2studio
8 participants