[omniORB] posix.cc: pthread * vs. pthread ** build failure with clang 16

Marcin Cieslak saper at saper.info
Mon Nov 27 02:49:22 UTC 2023


Hello,

I was trying to build omniORB 4.3.1 using the latest
FreeBSD 15.0-CURRENT which uses clang 16 as its default
compiler.

There seems to be some trouble with the references
to pthreads:

c++ -c -fPIC -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -Wall -Wno-unused -fexceptions    -I. -I. -I../../../include -I../../../include -D__OSVERSION__=0  -o shared/posix.o posix.cc
posix.cc:605:15: error: no matching function for call to 'pthread_detach'
         THROW_ERRORS(pthread_detach(&posix_thread));
                      ^~~~~~~~~~~~~~
posix.cc:110:32: note: expanded from macro 'THROW_ERRORS'
#define THROW_ERRORS(x) { if ((x) != 0) throw omni_thread_fatal(errno); }
                                ^
/usr/include/pthread.h:213:6: note: candidate function not viable: no known conversion from 'pthread_t *' (aka 'pthread **') to 'pthread_t' (aka 'pthread *') for 1st argument; remove &
int             pthread_detach(pthread_t);
                 ^
posix.cc:806:18: error: no matching function for call to 'pthread_getspecific'
     THROW_ERRORS(pthread_getspecific(self_key, (void**)&me));
                  ^~~~~~~~~~~~~~~~~~~
posix.cc:110:32: note: expanded from macro 'THROW_ERRORS'
#define THROW_ERRORS(x) { if ((x) != 0) throw omni_thread_fatal(errno); }
                                ^
/usr/include/pthread.h:216:8: note: candidate function not viable: requires 1 argument, but 2 were provided
void            *pthread_getspecific(pthread_key_t);
                  ^
2 errors generated.

A header file[1] provide the following definitions:

/*
  * Forward structure definitions.
  *
  * These are mostly opaque to the user.
  */
struct pthread;
(...)
typedef struct  pthread                 *pthread_t;

https://cgit.freebsd.org/src/tree/sys/sys/_pthreadtypes.h#n44

While here, FreeBSD porters added some local patches for omniORB,
some of them could probably make it to the omniORB releases:

For example, "patch-configure" adds DragonflyBSD and the recent
FreeBSD versions to the list of platforms recognized by configure.
Adding FreeBSD "15" to that list would be good, too.

https://cgit.freebsd.org/ports/tree/devel/omniORB/files

Thank you,

Marcin Cieślak



More information about the omniORB-list mailing list