Mbed-os: Link error: Symbol __user_perthread_libspace multiply defined

Created on 5 Jul 2018  路  23Comments  路  Source: ARMmbed/mbed-os

Description

I got link error below when I build mbed-os-example-blinky project for any target.

Error: Symbol __user_perthread_libspace multiply defined (by /build/mbed-os.lib/rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_lib.GR_LYCHEE.o and /build/mbed-os.lib/rtos/TARGET_CORTEX/mbed_boot.GR_LYCHEE.o).
Error: Not enough information to list the image map.
Info: Unable to download. Fix the reported errors...

[Steps to reproduce]

  • Import mbed-os-example-blinky program
  • Set target to Mbed OS 5 support platform (e.g. Renesas GR-LYCHEE, NXP K64F etc)
  • Compile the program

[Other notes]

  • This link error cannot be shown in command line build by Mbed-CLI

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

closed_in_jira tools mirrored bug

Most helpful comment

@0xc0170 Thank you very much for your testing.
I also confirmed that adding compiler macros fixes the problem.

  • Add _RTE_ macros from [Compile] - [Compile macros]
    pre-defined

  • Then, [Compile] - [Compile All]

All 23 comments

ARM Internal Ref: MBOTRIAGE-1075

I got same issue for L476RG....
Error: Symbol __user_perthread_libspace multiply defined (by /build/mbed-os.lib/rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_lib.NUCLEO_L476RG.o and /build/mbed-os.lib/rtos/TARGET_CORTEX/mbed_boot.NUCLEO_L476RG.o).

I confirmed the error with NUCLEO_F746ZG and only ARM toolchain with 5.9.2 label.

[DEBUG] Errors: Error: L6200E: Symbol __user_perthread_libspace multiply defined (by BUILD/tests/NUCLEO_F746ZG/ARM/rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_lib.o and BUILD/tests/NUCLEO_F746ZG/ARM/rtos/TARGET_CORTEX/mbed_boot.o).

Hi again
I have compared my local profile with the one in tools/profiles,
and it seems that -D_RTE_ was missing.
I can't explain what it is, but it solves my compilation issue...

Thanks @jeromecoutant I'll look into it.

@jeromecoutant RTE is defined for 5.9.2 . is that causing a problem?

cc @ARMmbed/mbed-os-core

I suspect this is the one that is causing a problem #6973. I'll check why rtx lib does not see the no multithreaded macro and why this was not seen in our CI previously

@theotherjimmy I referenced 7447 but that one is about own profile. This issue is in the online compiler. Can you check that profiles were updated there? RTE symbol defined? (until 5.9.3 contains proper fix for this)

We need to backport that patch into 5.9.2 to fix the problem in the online compiler.

I'm blocked since one week due to this error.
Any solution?

@mharmouche The PR (https://github.com/ARMmbed/mbed-os/pull/7474) has just been merged and is now on master. Would you mind retesting?

@toyowata Would you mind confirming that the issue has been fixed?

Issue not fixed!

image

@cmonr I can confirm the newest commit works. Although I couldn't find a way to update the official library to the newest commit (would only let me select release tags). So I resorted to forking it, and pushing my own release tag to make sure it was using the newest. Compiled and ran for me.

@mecwerks Correct. This is by design with mbed-cli.

Whenever I need to test changes that haven't hit a release, I go into the mbed-os directory and do a manual git checkout.

I'm blocked since one week due to this error.

@mharmouche This is the first time that I've read that you're having an issue. Did you open one elsewhere?
Cna you provide output of the mbed-os version that you're running?

The master branch contains the fix. The next release 5.9.3 will include it.

Meanwhile, to fix this issue - all we need is to have _RTE_ macro defined in the online compiler for 5.9.2 release. Please add mbed_lib.json file with the following (if you already have the config, just add macro):

{
    "name": "rtos_fix",
    "macros": ["_RTE_"]
}

Tested, works 馃憤

@0xc0170 Thank you very much for your testing.
I also confirmed that adding compiler macros fixes the problem.

  • Add _RTE_ macros from [Compile] - [Compile macros]
    pre-defined

  • Then, [Compile] - [Compile All]

Closing since issue appears resolved.

I'm getting this error now and adding the _RTE_ macro didn't solve it.

@diegomhamilton Please open a new issue referencing this issue. We prefer to see new issues come in instead of reviving old ones.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cesarvandevelde picture cesarvandevelde  路  4Comments

hasnainvirk picture hasnainvirk  路  3Comments

sarahmarshy picture sarahmarshy  路  4Comments

0xc0170 picture 0xc0170  路  3Comments

rbonghi picture rbonghi  路  3Comments