Bug 88127 - Many gdc.dg testsuite failures due to undefined reference to qsort_r
Summary: Many gdc.dg testsuite failures due to undefined reference to qsort_r
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: d (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Iain Buclaw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-21 08:41 UTC by Uroš Bizjak
Modified: 2019-02-18 23:31 UTC (History)
0 users

See Also:
Host:
Target: x86 glibc 2.5
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uroš Bizjak 2018-11-21 08:41:16 UTC
Many tests in gdc.dg fail with:

/home/uros/gcc-build/x86_64-pc-linux-gnu/./libphobos/libdruntime/.libs/libgdruntime.a(qsort.o): In function `_adSort':
/home/uros/gcc-build/x86_64-pc-linux-gnu/libphobos/libdruntime/../../../../git/gcc/libphobos/libdruntime/rt/qsort.d:41: undefined reference to `qsort_r'
collect2: error: ld returned 1 exit status

The tests are run on CentOS 5.11 with "GNU C Library stable release version 2.5".

Please note that qsort_r() was added to glibc in version 2.8.
Comment 1 Johannes Pfau 2019-02-01 23:55:32 UTC
Upstream PR: https://github.com/dlang/druntime/pull/2480
Comment 2 Uroš Bizjak 2019-02-10 20:06:53 UTC
Patch at [1].

[1] https://gcc.gnu.org/ml/gcc-patches/2019-02/msg00120.html
Comment 3 Iain Buclaw 2019-02-18 23:30:21 UTC
Author: ibuclaw
Date: Mon Feb 18 23:29:39 2019
New Revision: 268999

URL: https://gcc.gnu.org/viewcvs?rev=268999&root=gcc&view=rev
Log:
libphobos: Detect if qsort_r is available

Merges upstream druntime bbfb58e8.

libphobos/ChangeLog:

2019-02-19  Johannes Pfau  <johannespfau@gmail.com>

	PR d/88127
	* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_CLIB): Add new macro.
	* configure.ac: Use DRUNTIME_LIBRARIES_CLIB.
	* configure: Regenerate
	* Makefile.in: Regenerate
	* libdruntime/gcc/config.d.in: Add Have_Qsort_R.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

Modified:
    trunk/libphobos/ChangeLog
    trunk/libphobos/Makefile.in
    trunk/libphobos/configure
    trunk/libphobos/configure.ac
    trunk/libphobos/libdruntime/MERGE
    trunk/libphobos/libdruntime/Makefile.in
    trunk/libphobos/libdruntime/gcc/config.d.in
    trunk/libphobos/libdruntime/rt/qsort.d
    trunk/libphobos/m4/druntime/libraries.m4
    trunk/libphobos/src/Makefile.in
    trunk/libphobos/testsuite/Makefile.in
Comment 4 Iain Buclaw 2019-02-18 23:31:48 UTC
This should be fixed now.