stellarsolver icon indicating copy to clipboard operation
stellarsolver copied to clipboard

qsort_r previous declaration failure when building on musl libc

Open craftyguy opened this issue 1 year ago • 5 comments

qsort_r configuration at build time fails to do the right thing for me when building 2.6 with musl libc:

/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/ioutils.h:34:6: note: in expansion of macro 'QSORT_R'
   34 | void QSORT_R(void* base, size_t nmembers, size_t member_size,
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~

It never worked correctly on <2.6 either, in order to get 2.5 to build correctly I had a patch that basically just forced this config:

#define NEED_DECLARE_QSORT_R 0
#define NEED_QSORT_R 0
#define NEED_SWAP_QSORT_R 1

This trick no longer works on 2.6, and using the cmake logic in stellarsolver 2.6 doesn't work either.

full output from failed build
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib/ccache/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.3.0")
-- Checking for module 'cfitsio'
--   Found cfitsio, version 4.4.1
-- Found CFITSIO: /usr/lib/libcfitsio.so
-- Found GSL: /usr/include (found version "2.7.1")
-- Checking for module 'wcslib'
--   Found wcslib, version 8.3
-- Found WCSLIB: /usr/lib/libwcs.so, /usr/include/wcslib
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build
[1/75] Automatic MOC for target stellarsolver
[2/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_float.c.o
[3/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_rw.c.o
[4/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_memory.c.o
[5/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_byteswap.c.o
[6/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_tools.c.o
[7/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_time.c.o
[8/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_table.c.o
[9/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_image.c.o
[10/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_header.c.o
[11/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_error.c.o
[12/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_convert.c.o
[13/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/qfits_card.c.o
[14/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/qfits-an/anqfits.c.o
[15/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdtree_fits_io.c.o
[16/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdtree_mem.c.o
[17/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdtree_dim.c.o
[18/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdtree.c.o
[19/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_dss.c.o
[20/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_dds.c.o
[21/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_duu.c.o
[22/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_ddu.c.o
[23/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_fff.c.o
[24/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_ddd.c.o
[25/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/datalog.c.o
[26/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/log.c.o
[27/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/errors.c.o
[28/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/os-features.c.o
[29/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/ioutils.c.o
[30/75] Building C object CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/permutedsort.c.o
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/ioutils.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/ioutils.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/ioutils.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/ioutils.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/ioutils.c:44:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/ioutils.c:26:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/ioutils.h:34:6: note: in expansion of macro 'QSORT_R'
   34 | void QSORT_R(void* base, size_t nmembers, size_t member_size,
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/qsort_reentrant.c:34,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/ioutils.c:46:
/usr/include/sys/cdefs.h:4:2: warning: #warning usage of non-standard #include <sys/cdefs.h> is deprecated [-Wcpp]
    4 | #warning usage of non-standard #include <sys/cdefs.h> is deprecated
      |  ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/qsort_reentrant.c:97:6: note: in expansion of macro 'QSORT_R'
   97 | void QSORT_R(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/os-features.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/os-features.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/os-features.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/os-features.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/os-features.c:9:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/os-features.c:5:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdtree.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdtree.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdtree.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree.c:12:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree.c:7:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_fff.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_fff.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_fff.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_fff.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:11,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_fff.c:41:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:7:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/ioutils.h:34:6: note: in expansion of macro 'QSORT_R'
   34 | void QSORT_R(void* base, size_t nmembers, size_t member_size,
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_dds.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_dds.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_dds.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_dds.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:11,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_dds.c:41:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:7:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/ioutils.h:34:6: note: in expansion of macro 'QSORT_R'
   34 | void QSORT_R(void* base, size_t nmembers, size_t member_size,
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/permutedsort.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/permutedsort.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/permutedsort.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/permutedsort.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/permutedsort.c:20:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util/permutedsort.c:6:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_dss.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_dss.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_dss.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_dss.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:11,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_dss.c:41:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:7:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/ioutils.h:34:6: note: in expansion of macro 'QSORT_R'
   34 | void QSORT_R(void* base, size_t nmembers, size_t member_size,
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_ddd.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_ddd.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_ddd.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_ddd.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:11,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_ddd.c:41:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:7:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/ioutils.h:34:6: note: in expansion of macro 'QSORT_R'
   34 | void QSORT_R(void* base, size_t nmembers, size_t member_size,
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_duu.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_duu.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_duu.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_duu.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:11,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_duu.c:41:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:7:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/ioutils.h:34:6: note: in expansion of macro 'QSORT_R'
   34 | void QSORT_R(void* base, size_t nmembers, size_t member_size,
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: job failed: /usr/lib/ccache/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build/stellarsolver_autogen/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/build -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6 -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/tester -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry -I/usr/include/wcslib -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/qfits-an -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/util -I/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/blind -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtConcurrent -fPIC -fPIC -MD -MT CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_ddu.c.o -MF CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_ddu.c.o.d -o CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/libkd/kdint_ddu.c.o -c /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_ddu.c
In file included from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:11,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdint_ddu.c:41:
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:113:6: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  113 | void qsort_r(void *base, size_t nmemb, size_t sz,
      |      ^~~~~~~
In file included from /usr/include/fortify/stdlib.h:23,
                 from /home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/libkd/kdtree_internal.c:7:
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/os-features.h:123:17: error: conflicting types for 'qsort_r'; have 'void(void *, size_t,  size_t,  void *, int (*)(void *, const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  void *, int (*)(void *, const void *, const void *))'}
  123 | #define QSORT_R qsort_r
      |                 ^~~~~~~
/home/clayton/src/aports/community/stellarsolver/src/stellarsolver-2.6/stellarsolver/astrometry/include/astrometry/ioutils.h:34:6: note: in expansion of macro 'QSORT_R'
   34 | void QSORT_R(void* base, size_t nmembers, size_t member_size,
      |      ^~~~~~~
/usr/include/stdlib.h:151:6: note: previous declaration of 'qsort_r' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *, void *), void *)' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *, void *), void *)'}
  151 | void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
      |      ^~~~~~~
ninja: subcommands failed

craftyguy avatar Aug 16 '24 04:08 craftyguy

I thought the QSortR declaration issues were improved upstream by the astrometry team. I had hoped that this contribution had improved that: https://github.com/rlancaste/stellarsolver/pull/139. Did this change cause the issue you are reporting?

rlancaste avatar Aug 22 '24 02:08 rlancaste

Since Qt5 is being unmaintained from the 26th of May (this month!) I've been trying to get this to compile with Qt6, but I can sadly reproduce the same problem as @craftyguy (also on Alpine Linux).

I guess the original problem was fixed but qsort_r is very much still a problem.

PureTryOut avatar May 08 '25 18:05 PureTryOut

Aside from a segfault in the test suite this seems to fix the qsort issue:

--- a/stellarsolver/astrometry/include/astrometry/ioutils.h
+++ b/stellarsolver/astrometry/include/astrometry/ioutils.h
@@ -28,17 +28,12 @@
 #include "astrometry/an-bool.h"
 #include "astrometry/bl.h"
 #include "astrometry/keywords.h"
+#include "astrometry/os-features.h"
 
 extern uint32_t ENDIAN_DETECTOR;
 
 void QSORT_R(void* base, size_t nmembers, size_t member_size,
-             void* token, int (*compar)(void *, const void *, const void *));
-
-/**
-   You should define the "comparison" function like this:
-   static int QSORT_COMPARISON_FUNCTION(my_comparison, void* token, const void* v1, const void* v2) {
- */
-#define QSORT_COMPARISON_FUNCTION(func, thunk, v1, v2) func(thunk, v1, v2)
+             void* token, QSORT_COMPARISON_FUNCTION(int (*compar), void *, const void *, const void *));
 
 int copy_file(const char* infn, const char* outfn);
 
--- a/stellarsolver/astrometry/util/qsort_reentrant.c
+++ b/stellarsolver/astrometry/util/qsort_reentrant.c
@@ -34,14 +34,14 @@
 # include <sys/cdefs.h>
 #endif
 //__FBSDID("$FreeBSD: src/sys/libkern/qsort.c,v 1.15 2004/07/15 23:58:23 glebius Exp $");
+#include "astrometry/os-features.h"
 
-
 // Astrometry.net: we lightly modified this file:
 // - renamed qsort_r to QSORT_R to avoid clashes with system version
 // - removed the preprocessor magic that support re-entrant and non-
 //   functions in the same source code.
 
-typedef int             cmp_t(void *, const void *, const void *);
+typedef int             QSORT_COMPARISON_FUNCTION(cmp_t, void *, const void *, const void *);
 
 static __inline char    *med3(char *, char *, char *, cmp_t *, void *);
 static __inline void     swapfunc(char *, char *, int, int);

Essentially the order if const and non-const arguments in the callback function was wrong in multiple places.

sertonix avatar May 08 '25 20:05 sertonix

Also the removal of code from os-features-test.c broke automated test completely since test compilation now always fails with undefined reference to `main': https://github.com/rlancaste/stellarsolver/pull/139/files#diff-ab098867e3d6840103789db63646fa629a1558eecee4fc3d9284dfbf4d93756a

sertonix avatar May 08 '25 20:05 sertonix

Looking at #139 it seems to me that it broke more things than it fixes

sertonix avatar May 08 '25 20:05 sertonix