Keil Logo

ARMCLANG: Issue using built-in ARMCLANG 6.9 in MDK 5.25pre


Information in this knowledgebase article applies to:

  • MDK v5.25 preview
  • Built-in ARMCLANG v6.9 in MDK v5.25 preview

SYMPTOM

A project has the Project -> Options for Target -> Target tab - Use MicroLIB checked, but the linker does not link in all the microlib libraries.

Symptoms include:

  • the *.map file shows that the normal ARM C standard library cw.l, instead of the MicroLIB version mcw.l has been linked into project
  • Project ->Options for Target ->Linker tab shows --library_type=microlib defined under the in the Linker control string
  • Some semihosting functions, such as _sys_open etc., and some floating point libraries, which are not used in project, are still linked into project
  • significantly larger code size
  • side effects like the program stopping at BKPT 0xAB when debugging.

This happens when using the

  • MDK v5.25 preview's µVision
  • the default ARMCLANG v6.9 compiler

The same project with the same settings doesn't have this issue using ARMCLANG v6.7. What has caused such an issue using ARMCLANG v6.9 and how can I resolve it?

CAUSE

In the ARMCLANG v6.9 folder installed by MDK v5.25 preview, such as C:\Keil_525pre\ARM\ARMCLANG\lib\libcxx\ , there are 428 C library files, which shouldn't be in the libcxx C++ library folder.

Due to the way that armlink searches for symbols in libraries to resolve them, the wrong C library files inside this libcxx folder might be linked into your program, instead of the right C library files located in C:\Keil_525pre\ARM\ARMCLANG\lib\armlib\

This can cause wrong libraries or unused libraries to be linked into your program.

RESOLUTION

  • Update: This issue was fixed in MDK v5.25 and later. Download it from Keil Product Downloads page, under the Maintenance Status and Previous Versions section.

  • Replace the files:

  1. Open the local MDK installation directory, such as C:\Keil_525pre\ARM\ARMCLANG\lib\libcxx\ ,
  2. delete all 428 files, whose filenames do NOT start with lib*. After deleting these 428 files, there should be a total of 1665 files left in this folder.

Alternatively you can go to this libcxx directory, such as C:\Keil_525pre\ARM\ARMCLANG\lib\libcxx\ , and then run the following windows batch commands from there to delete these 428 superfluous files.

attrib +r lib*
del /q *
attrib -r lib*

Afterwards, there should be a total of 1665 files remaining in this folder, whose filesnames all start with lib*.

STATUS

This issue only happens when the built-in ARMCLANG v6.9 in MDK v5.25 preview is used. If you download ARMCLANG v6.9 from developer.arm.com and integrate it into MDK, you are not affected by this issue.

MORE INFORMATION

Last Reviewed: Thursday, November 26, 2020


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.