Skip to content

Remove _LIBCPP_EXTERN_TEMPLATE ARMCC compilation flag #12302

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

Conversation

michalpasztamobica
Copy link
Contributor

Summary of changes

The flag was added in #5993.

As per comment from @pan- , the flag is not necessary once libc++ is shipped with ARMCC.
According to Arm compiler 6.11 release notes:

Arm Compiler 6 includes the libc++ library as the C++ Standard Template Library.

The particular reason I am interested in removing the flag is that it gives compilation warnings if library functions are put to use (see #12300):

Warning: L6439W: Multiply defined Global Symbol std::__1::basic_streambuf<char, std::__1::char_traits<char>>::~basic_streambuf__sub_object() defined in .text._ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev(C:\Program Files\ARMCompiler6.13\bin\..\lib\libcxx\libcpp_w.l(ios.cpp.o)) rejected in favor of Symbol defined in .text._ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev(.main.o).
Warning: L6439W: Multiply defined Global Symbol std::__1::basic_istream<char, std::__1::char_traits<char>>::sentry::sentry__sub_object(std::__1::basic_istream<char, std::__1::char_traits<char>>&, bool) defined in .text._ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b(C:\Program Files\ARMCompiler6.13\bin\..\lib\libcxx\libcpp_w.l(ios.cpp.o)) rejected in favor of Symbol defined in .text._ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b(.main.o).
Warning: L6439W: Multiply defined Global Symbol std::__1::basic_ostream<char, std::__1::char_traits<char>>::sentry::sentry__sub_object(std::__1::basic_ostream<char, std::__1::char_traits<char>>&) defined in .text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_(C:\Program Files\ARMCompiler6.13\bin\..\lib\libcxx\libcpp_w.l(ios.cpp.o)) rejected in favor of Symbol defined in .text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_(.main.o).
Warning: L6439W: Multiply defined Global Symbol std::__1::basic_ostream<char, std::__1::char_traits<char>>::sentry::~sentry__sub_object() defined in .text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev(C:\Program Files\ARMCompiler6.13\bin\..\lib\libcxx\libcpp_w.l(ios.cpp.o)) rejected in favor of Symbol defined in .text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev(.main.o).
Warning: L6439W: Multiply defined Global Symbol std::__1::basic_streambuf<char, std::__1::char_traits<char>>::~basic_streambuf__deallocating() defined in .text._ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev(C:\Program Files\ARMCompiler6.13\bin\..\lib\libcxx\libcpp_w.l(ios.cpp.o)) rejected in favor of Symbol defined in .text._ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev(.main.o).

Impact of changes

Smaller image size, as the units definitions will not be copied into every compilation unit and we are linking against libc++ anyway.
Warnings about duplicate symbols, when libc++ is being used should go away.

Migration actions required

None

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[x] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@ARMmbed/mbed-os-tools
@AnttiKauppila
@kjbracey-arm


@ciarmcom ciarmcom requested review from AnttiKauppila, kjbracey and a team January 22, 2020 16:00
@ciarmcom
Copy link
Member

@michalpasztamobica, thank you for your changes.
@AnttiKauppila @kjbracey-arm @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@mark-edgeworth mark-edgeworth left a comment

Choose a reason for hiding this comment

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

Not tested by me, but the code change looks good.

@mergify mergify bot added needs: CI and removed needs: review labels Jan 22, 2020
@adbridge
Copy link
Contributor

@pan- @kjbracey-arm @AnttiKauppila could you please review ?

@kjbracey
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 30, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@kjbracey kjbracey merged commit 858d02d into ARMmbed:master Jan 30, 2020
@mergify
Copy link

mergify bot commented Jan 30, 2020

This PR does not contain release version label after merging.

@0xc0170 0xc0170 added release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 and removed Release review required labels Feb 4, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 4, 2020

I've fixed the version: Set to 6.0.0-alpha-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants