public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jeremyhu at macports dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/52268] tls support should be added for darwin11
Date: Mon, 30 Jun 2014 05:44:00 -0000	[thread overview]
Message-ID: <bug-52268-4-NVRPLNRblj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52268-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52268

Jeremy Huddleston Sequoia <jeremyhu at macports dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeremyhu at macports dot org

--- Comment #8 from Jeremy Huddleston Sequoia <jeremyhu at macports dot org> ---
Seems to work to me in gcc-4.6:

~ $ cat test_thread.c 
#include <pthread.h>
#include <stdio.h>

#define NUM_THREADS 5

int __thread value;

void * test_thread(void *arg) {
    return &value;
}

int main(void) {
    int i;
    pthread_t thread[NUM_THREADS];

    for(i=0; i < 5; i++) {
        pthread_create(&thread[i], NULL, test_thread, NULL);
    }

    for(i=0; i < 5; i++) {
        void *loc;
        pthread_join(thread[i], &loc);
        printf("%p\n", loc);
    }

    return 0;
}

$ gcc-mp-4.6 test_thread.c 

$ ./a.out
0x7fc7b3d00118
0x7fc7b3e00118
0x7fc7b3f00118
0x7fc7b3d00118
0x7fc7b3c03b28

$ gcc-mp-4.6 --version
gcc-mp-4.6 (MacPorts gcc46 4.6.4_5+universal) 4.6.4
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


  parent reply	other threads:[~2014-06-30  5:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16  4:02 [Bug target/52268] New: " howarth at nitro dot med.uc.edu
2012-02-16  6:30 ` [Bug target/52268] " howarth at nitro dot med.uc.edu
2012-02-16 17:20 ` mikestump at comcast dot net
2012-02-16 19:01 ` iains at gcc dot gnu.org
2012-02-29 17:44 ` howarth at nitro dot med.uc.edu
2012-03-01  1:28 ` howarth at nitro dot med.uc.edu
2012-03-01  1:29 ` howarth at nitro dot med.uc.edu
2012-03-01 14:15 ` howarth at nitro dot med.uc.edu
2014-06-20 21:15 ` egall at gwmail dot gwu.edu
2014-06-30  5:44 ` jeremyhu at macports dot org [this message]
2014-06-30  8:17 ` iains at gcc dot gnu.org
2014-06-30 17:55 ` jeremyhu at macports dot org
2014-07-30 11:36 ` [Bug target/52268] native " egall at gwmail dot gwu.edu
2021-07-09 23:04 ` egallager at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-52268-4-NVRPLNRblj@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).