Re: build of 2021/03/07 -current fails because of pthread_types.h (without MKLLVM!)

"Greg A. Woods" <[email protected]>
Newsgroups gmane.os.netbsd.current,gmane.os.netbsd.devel.toolchain
Organization Planix, Inc.
Message-ID <[email protected]>
So, the clue is in the last two "notes" from the compiler:

/build/woods/b2/current-amd64-destdir/usr/include/pthread_types.h:170:8: note: '__pthread_cond_st' is not literal because:
  170 | struct __pthread_cond_st {
      |        ^~~~~~~~~~~~~~~~~
/build/woods/b2/current-amd64-destdir/usr/include/pthread_types.h:175:17: note:   non-static data member '__pthread_cond_st::ptc_waiters' has volatile type
  175 |  void *volatile ptc_waiters;
      |                 ^~~~~~~~~~~


These lead me to pthread_types.h, and to the apparent change that may
have introduced the fault (revision 1.25 of pthread_types.h), which
after looking at the full set of changes in 1.25 lead me to find the
definition of __pthread_volatile, and that allowed me to read the
comment about this definition and that suggested the following fix,
which at least allows the compile to continue.  I hate C++ and I hate
debugging C++, but here at least I'm grateful someone had already
figured out how to solve the problem and I only had to apply it in one
more place.

If all goes well I should be able to test the build under Xen in the
next few hours.


Index: lib/libpthread/pthread_types.h
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/lib/libpthread/pthread_types.h,v
retrieving revision 1.25
diff -u -r1.25 pthread_types.h
--- lib/libpthread/pthread_types.h	10 Jun 2020 22:45:15 -0000	1.25
+++ lib/libpthread/pthread_types.h	9 Mar 2021 22:43:05 -0000
@@ -172,7 +172,7 @@

 	/* Protects the queue of waiters */
 	__pthread_spin_t ptc_lock;
-	void *volatile ptc_waiters;
+	void *__pthread_volatile ptc_waiters;
 	void *ptc_spare;

 	pthread_mutex_t	*ptc_mutex;	/* Current mutex */

--
					Greg A. Woods <[email protected]>

Kelowna, BC     +1 250 762-7675           RoboHack <[email protected]>
Planix, Inc. <[email protected]>     Avoncote Farms <[email protected]>
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (NetBSD)

iEYEABECAAYFAmBH+vQACgkQZn1xt3i/9H99ogCeNJZQSJzP+BZbxxua4OaMpfTO
bIYAn0eK6B08rlUOaCQ/hX0NXrLK5qmE
=NS/4
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.