autoconf-archive-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #8847] AX_PTHREAD: improve support for Solaris


From: Alan Coopersmith
Subject: [patch #8847] AX_PTHREAD: improve support for Solaris
Date: Sun, 10 Jan 2016 04:33:44 +0000
User-agent: Mozilla/5.0 (X11; SunOS i86pc; rv:31.0) Gecko/20100101 Firefox/31.0

URL:
  <http://savannah.gnu.org/patch/?8847>

                 Summary: AX_PTHREAD: improve support for Solaris
                 Project: GNU Autoconf Archive
            Submitted by: alanc
            Submitted on: Sun 10 Jan 2016 04:33:43 AM GMT
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

This patch improves the selection of flags for gcc & Sun cc on
Solaris, dropping those no longer needed on modern versions,
while preserving support for older versions that still need them.

It also modifies the fix for http://savannah.gnu.org/patch/?7666
to use the existing compiler tests - previously that wasn't
effective because -lpthread was tested before -mt so it never
got to the -mt test - now it tests -mt & -lpthread in unison
so we add -mt only for compilers that support it, not for all
which aren't gcc (hence removing the need for the "What about
clang?" comment).

To test, I wrote a quick stub configure.ac:

AC_INIT(test, 0.1)
AM_INIT_AUTOMAKE([foreign])

AX_PTHREAD()

AC_MSG_NOTICE([host_os:        ${host_os}])
AC_MSG_NOTICE([PTHREAD_CC:     ${PTHREAD_CC}])
AC_MSG_NOTICE([PTHREAD_CFLAGS: ${PTHREAD_CFLAGS}])
AC_MSG_NOTICE([PTHREAD_LIBS:   ${PTHREAD_LIBS}])
        
AC_OUTPUT

Output on various machines using Studio cc:

configure: host_os:        solaris2.12
configure: PTHREAD_CC:     cc
configure: PTHREAD_CFLAGS:
configure: PTHREAD_LIBS:

configure: host_os:        solaris2.11
configure: PTHREAD_CC:     cc
configure: PTHREAD_CFLAGS: -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
configure: PTHREAD_LIBS:

configure: host_os:        solaris2.10
configure: PTHREAD_CC:     cc
configure: PTHREAD_CFLAGS: -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
configure: PTHREAD_LIBS:

configure: host_os:        solaris2.9
configure: PTHREAD_CC:     cc
configure: PTHREAD_CFLAGS: -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -mt
configure: PTHREAD_LIBS:   -lpthread

And using gcc:

configure: host_os:        solaris2.12
configure: PTHREAD_CC:     gcc
configure: PTHREAD_CFLAGS: 
configure: PTHREAD_LIBS:

configure: host_os:        solaris2.11
configure: PTHREAD_CC:     gcc
configure: PTHREAD_CFLAGS: -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
configure: PTHREAD_LIBS:

configure: host_os:        solaris2.10
configure: PTHREAD_CC:     gcc
configure: PTHREAD_CFLAGS: -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
configure: PTHREAD_LIBS:

[I couldn't find a working pre-S10 machine with gcc to test on.]

And for comparison, prior to this fix:

configure: host_os:        solaris2.12
configure: PTHREAD_CC:     cc
configure: PTHREAD_CFLAGS: -mt -D_REENTRANT
configure: PTHREAD_LIBS:   -lpthread

configure: host_os:        solaris2.12
configure: PTHREAD_CC:     gcc
configure: PTHREAD_CFLAGS: -D_REENTRANT -pthreads
configure: PTHREAD_LIBS:

I've confirmed with the Solaris libc/threads, linker, and compiler teams that
these are the correct flags for these OS'es.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 10 Jan 2016 04:33:43 AM GMT  Name:
0001-AX_PTHREAD-improve-support-for-Solaris.patch  Size: 5kB   By: alanc

<http://savannah.gnu.org/patch/download.php?file_id=35959>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8847>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]