[patch #9788] ax_pthread.m4: when using -pthread and GCC, also add library.

anonymous <[email protected]> Sat, 6 Apr 2019 07:38:18 -0400 (EDT)
Newsgroups gmane.comp.sysutils.autoconf.archive-maintainers
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/patch/?9788>

                 Summary: ax_pthread.m4: when using -pthread and GCC, also add
library.
                 Project: GNU Autoconf Archive
            Submitted by: None
            Submitted on: Sat 06 Apr 2019 11:38:17 AM UTC
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: [email protected]
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

GCC (and its specific language frontends) ignores the -pthread flag when using
-nostdlib.

Since we cannot know what flags will be used later on, we should better add an
existent library implementing the portable threads interface to PTHREAD_LIBS
(if available).

Note that we do not actually check if the libraries contain any pthread
symbols, the existence itself should be good enough. Otherwise, the checking
code would have to be duplicated in multiple places, which doesn't make a lot
of sense.

One popular (annoying) example of why this is necessary is libtool bug #13550,
which means that libtool always links C++ code with -nostdlib.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sat 06 Apr 2019 11:38:17 AM UTC  Name:
0001-ax_pthread.m4-when-using-pthread-and-GCC-also-add-li.patch  Size: 4KiB  
By: None

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

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?9788>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/