From owner-freebsd-bugs@FreeBSD.ORG Fri Aug 1 19:46:30 2014 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 568C5666 for ; Fri, 1 Aug 2014 19:46:30 +0000 (UTC) Received: from mail-qa0-x234.google.com (mail-qa0-x234.google.com [IPv6:2607:f8b0:400d:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 198812D45 for ; Fri, 1 Aug 2014 19:46:30 +0000 (UTC) Received: by mail-qa0-f52.google.com with SMTP id j15so4498790qaq.11 for ; Fri, 01 Aug 2014 12:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=t8ZNBVHZhcvv6RqvTF3/ZBLPYBOBy1qCnj/0j0n1aqU=; b=tGGmuNxW9uqiCFkpAePixhtghlsxAuJZwCWrU3oWymYoz16jEs6NzmqnIyi68Blcgh Qs2T0Lyhaxn3Hz/pt240xFBmay4BwFExYguH9fV15xbCNEozr9j0Bm0oLEpHUJbg66o/ 8skenTszEAbYn1+KHOLAARJe7nr+xN6zZA9NjZoolRs3Olf7xJ1h21u3ZXKHfUq1iaUJ KBvjo5hj9/8oltmTxNS8VE3Iwzlb76qWkzQHcOUqcKp7CU2z2NKBADg6kM/+J8JaZXz7 TVxTiLcYB0sU+OMZ5iQ/QyuYlkTVDV5dqXza5r5C05N11crC2nSCCz8pqZ1Dt5SLGPgS sLww== MIME-Version: 1.0 X-Received: by 10.224.112.1 with SMTP id u1mr12440095qap.7.1406922389128; Fri, 01 Aug 2014 12:46:29 -0700 (PDT) Received: by 10.96.73.39 with HTTP; Fri, 1 Aug 2014 12:46:28 -0700 (PDT) In-Reply-To: References: Date: Fri, 1 Aug 2014 12:46:28 -0700 Message-ID: Subject: Re: thread_local broken on clang From: hiren panchasara To: Troy Heron Content-Type: text/plain; charset=UTF-8 Cc: freebsd-bugs@freebsd.org X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 19:46:30 -0000 On Thu, Jul 31, 2014 at 2:54 AM, Troy Heron wrote: > Hello, > > I'm attempting to port an application to FreeBSD (version 10 to be > specific). The application has been developed using C++11 and uses > thread_local. > > As below, the use of thread_local is giving me linking errors for the C++ > ABI. > > troy@freebsd10:~ # cat tl.cpp > #include > > thread_local std::string test; > > int main() > { > } > troy@freebsd10:~ # clang++ -std=c++11 tl.cpp -o tl > /tmp/tl-7sN7Nb.o: In function `__cxx_global_var_init': > tl.cpp:(.text+0xbb): undefined reference to `__cxa_thread_atexit' > clang++: error: linker command failed with exit code 1 (use -v to see > invocation) > troy@freebsd10:~ # > > Has anyone else experienced this? Should I report it as a bug? Please report a bug. You can also ask this question on freebsd-stable mailing list. cheers, Hiren