Re: Building pthreads as native windows build

Keith Marshall <[email protected]> Sun, 21 May 2017 13:09:31 +0100
Newsgroups gmane.comp.gnu.mingw.devel
Organization MinGW Project
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20/05/17 22:36, David Gressett wrote:
> wsl-5 now compiles, so I am on to the next target: pthreads
> 
> I downloaded pthreads-w32-2.10-mingw32-pre-20160821-1-src.tar.xz
> 
> (I unpacked this with 7-zip, which complained that it was not an
> xz-compressed archive, but was just a tar that had been renamed.)

Hmm.  Confirmed, thanks.  I don't know what went wrong there; all of 
the binary packages do appear to be appropriately compressed, in the 
"dist" staging directory whence I uploaded them:

  $ file dist/*.xz
  dist/pthreads-GCE-w32-2.10-mingw32-pre-20160821-1-dev.tar.xz:   XZ compressed data
  dist/pthreads-GCE-w32-2.10-mingw32-pre-20160821-1-dll-3.tar.xz: XZ compressed data
  dist/pthreads-GC-w32-2.10-mingw32-pre-20160821-1-dev.tar.xz:    XZ compressed data
  dist/pthreads-GC-w32-2.10-mingw32-pre-20160821-1-dll-3.tar.xz:  XZ compressed data
  dist/pthreads-w32-2.10-mingw32-pre-20160821-1-doc.tar.xz:       XZ compressed data
  dist/pthreads-w32-2.10-mingw32-pre-20160821-1-lic.tar.xz:       XZ compressed data
  dist/pthreads-w32-2.10-mingw32-pre-20160821-1-src.tar.xz:       POSIX tar archive (GNU)

> it already had a makefile for gcc named GNUmakefile, ...

which comes directly from upstream; it is NOT build ready.

> ... so I tried it.  It does several different builds which are
> defined by command-line arguments.
> 
> All that I tried  failed with several undefined type errors.  The
> offender is int64_t:
> 
> error: unknown type name 'int64_t'
> 
> What should I do to get this to compile correctly?

Please read the notes, at the foot of the FRS download page:
https://sourceforge.net/projects/mingw/files/MinGW/Base/pthreads-w32/pthreads-w32-2.10-pre-20160821-1/

The README source file for that is also present on the download page; 
it should have been included in the source tarball, but it appears to 
have been omitted.  I'll remedy that, together with the compression 
issue, and upload a fresh copy.

Additionally, you may note the availability of a pkgspec file, within 
the source tarball; this supports building with mingw-pkg[1]:

  $ pwd
  /home/keith/src/pthreads-win32-2.10

  $ mkdir -p build && cd build
  $ mingw-pkg --srcdir=.. patch configure compile
  $ make prefix=`pwd`/staged install

WJFFM, delivering:

  $ ls -R staged/
  staged/:
  bin  include  lib

  staged/bin:
  pthreadGC-3.dll  pthreadGCE-3.dll

  staged/include:
  pthread.h  ptw32_errno.h  _ptw32.h  sched.h  semaphore.h

  staged/lib:
  libpthread.a      libpthreadGC-3.a      libpthreadGCE-3.a
  libpthread.dll.a  libpthreadGC-3.dll.a  libpthreadGCE-3.dll.a

[1]: If you don't have the latest version of mingw-pkg, with support 
for the --srcdir option, you can substitute SRCDIR=..; (the advantage 
of the option is that it makes the SRCDIR=.. assignment persistent, so 
you don't need to specify it every time you run mingw-pkg in a given 
build directory).

- -- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJZIYN6AAoJEMCtNsY0flo/pkIQAJt6MojohVgTN8DoF3oDUsLc
SFOF57BFHn7OnHeKbkirdM9bzCg9UNFOzSgfN5z5KNFPzgz6MeVDwpej9gxDhMA7
DIbPgPyCTpsbxn401i/H6VLobZ3TY7Wdja1FiQ73BZtF5EO1M4oi6pnV+OL8Lzu6
lMlpEnDN8cMiLW6v19+h8yMaWL24BapbNoD7UTNJjQr5IFst09I6IyS5cLijdYhw
f9l+48luRi52vSZ5ZpkTFufCBmQhDPTtnm6WWf/XZuG1oZTqbN1yxlonyR4fGnCe
fQAyJYJYFciiFwCllNQZJXQECHMmxbE17xl/HjqHhE8xj6FEfUWOZ94TylMt2srl
BGmUDfl1u9tcIsKjCAbpd8z1opdEx8YC3NIDuVQ3oyljFPeSdb0ijIIGiswDNOw5
pxWXPrKwEo+b1laothGf+2XtX2DE6rZAorR4Va+vQxJiGlB84slQOj/jtX9RJz3N
ZaWynHCoDLPSWmOyXy+qTGI4IpG290MCL6IptMZWlAHqeGldMos7MovT5nDvdjZv
Di0gNAaxGyaoaHk1+HIn9RjH/85KeqYVQoFgdCSMSfgc3WSF/zWDlYrruy8PyT5c
9uvTqjSOvUELwPiURnTdWZDwd2etCaMLkY1HHHy1mX7OsvcBtdoRUqeJ7GrDB1ju
gzltx0/76s/u8OZP9PDZ
=lPMp
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot