FS#50254 - [clang] mkspec with linux-clang-libc++, missing -lc++abi

Attached to Project: Arch Linux
Opened by Fred (f.rodrigo) - Thursday, 04 August 2016, 07:56 GMT
Last edited by Evangelos Foutras (foutrelis) - Wednesday, 28 June 2017, 01:48 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When using qmake with mkspec for linux-clang-libc++ it results in linking problem.

clang++ -ccc-gcc-name g++ -stdlib=libc++ -Wl,--gc-sections -Wl,-Bsymbolic-functions -o ../../../out/release/opening_hours_tests ../../../out/release/tmp/opening_hours_tests/opening_hours_tests.o -L../../../out/release -lopening_hours -lz -lpthread
/usr/bin/ld: ../../../out/release/tmp/opening_hours_tests/opening_hours_tests.o: undefined reference to symbol '_ZTISt11range_error'
/usr/lib/libc++abi.so.1: error adding symbols: DSO missing from command line

Add '-lc++abi' to command line solves the issue.


Already reported here but still present:
https://bbs.archlinux.org/viewtopic.php?id=209833
https://github.com/mapsme/omim/issues/2129


Additional info:
* extra/qt5-base 5.7.0-1

Steps to reproduce:
qmake -spec linux-clang-libc++
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Wednesday, 28 June 2017, 01:48 GMT
Reason for closing:  Fixed
Additional comments about closing:  The current libc++ package in the AUR should work fine with -stdlib=libc++, without having to specify -lc++abi.
Comment by Antonio Rojas (arojas) - Thursday, 04 August 2016, 08:34 GMT
The spec files come from upstream, report it to them.

EDIT: See https://bugreports.qt.io/browse/QTBUG-42703
Comment by Antonio Rojas (arojas) - Thursday, 04 August 2016, 08:52 GMT
According to qt devs, the compiler should add the necessary link flags automatically
Comment by Evangelos Foutras (foutrelis) - Wednesday, 28 June 2017, 01:47 GMT
Apparently this is what was needed: https://reviews.llvm.org/D13739

Due to the way our libc++ 3.8.0 was built, LIBCXX_ENABLE_ABI_LINKER_SCRIPT was turned off and that's why -stdlib=libc++ wasn't sufficient.

The current libc++ package in the AUR gets the build right and libc++.so is a linker script that automatically includes libc++abi.

Loading...