qsort_r and libc.a version?

Larry Hall (Cygwin) reply-to-list-only-lh@cygwin.com
Thu Feb 6 19:39:00 GMT 2014


On 2/6/2014 2:04 PM, Jim Garrison wrote:
> I tried to build libgit2 so I could try to build gitg but encountered
>
>      undefined reference to `qsort_r'
>
> GitHub has a closed issue for this
> https://github.com/libgit2/libgit2/issues/1606 saying that qsort_r was added
> to glibc in version 2.8, released in 2008.
>
> Since libc in Cygwin is part of the base package, how would I find out
> which upstream version it's based on?

Cygwin uses newlib for its C library.  From what I can see, qsort is there
but qsort_r isn't.

> There was a commit in libgit2 that was supposed to fix this :
>
> https://github.com/libgit2/libgit2/commit/0d77647adc1f76df66e437e6442d7f7706e2c38e#diff-bb2cd4651768482b99cb1c52d29ceffdR694
>
> but I don't know enough about Cygwin internals to determine why it still
> fails on Cygwin.

The problem with that patch is that it doesn't take Cygwin into account.
If you append a check for Cygwin there as well (i.e. defined(__CYGWIN__) )
then that should resolve the compile issue.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list