binutils-gdb/libctf
Nick Alcock 6b22174ff1 libctf: look for BSD versus GNU qsort_r signatures
We cannot just look for any declaration of qsort_r, because some
operating systems have a qsort_r that has a different prototype
but which still has a pair of pointers in the right places (the last two
args are interchanged): so use AC_LINK_IFELSE to check for both
known variants of qsort_r(), and swap their args into a consistent order
in a suitable inline function.  (The code for this is taken almost
unchanged from gnulib.)

(Now we are not using AC_LIBOBJ any more, we can use a better name for
the qsort_r replacement as well.)

libctf/
	* qsort_r.c: Rename to...
	* ctf-qsort_r.c: ... this.
	(_quicksort): Define to ctf_qsort_r.
	* ctf-decls.h (qsort_r): Remove.
	(ctf_qsort_r): Add.
	(struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
	(ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
	* Makefile.am (libctf_a_LIBADD): Remove.
	(libctf_a_SOURCES): New, add ctf-qsort_r.c.
	* ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
	* ctf-create.c (ctf_update): Likewise.
	* configure.ac: Check for BSD versus GNU qsort_r signature.
	* Makefile.in: Regenerate.
	* config.h.in: Likewise.
	* configure: Likewise.
2019-06-04 17:05:08 +01:00
..
aclocal.m4 libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
ChangeLog libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
config.h.in libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
configure libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
configure.ac libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
ctf-archive.c libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
ctf-create.c libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
ctf-decl.c libctf: core type lookup 2019-05-28 17:08:14 +01:00
ctf-decls.h libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
ctf-dump.c libctf: fix use-after-free in function dumping 2019-06-04 17:05:08 +01:00
ctf-endian.h libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
ctf-error.c
ctf-hash.c libctf: hashing 2019-05-28 17:07:29 +01:00
ctf-impl.h libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
ctf-labels.c libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
ctf-lookup.c libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
ctf-open-bfd.c libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
ctf-open.c libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
ctf-qsort_r.c libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
ctf-subr.c libctf: library version enforcement 2019-05-28 17:08:29 +01:00
ctf-types.c libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
ctf-util.c libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00
elf.h
Makefile.am libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
Makefile.in libctf: look for BSD versus GNU qsort_r signatures 2019-06-04 17:05:08 +01:00
swap.h libctf: fix a number of build problems found on Solaris and NetBSD 2019-05-31 11:10:51 +02:00