From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 31 09:54:25 2014 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E56A47D for ; Thu, 31 Jul 2014 09:54:25 +0000 (UTC) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) (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 DCB38244B for ; Thu, 31 Jul 2014 09:54:24 +0000 (UTC) Received: by mail-pd0-f170.google.com with SMTP id g10so3197104pdj.29 for ; Thu, 31 Jul 2014 02:54:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=U20WJBT7EQXI/AyyflRzEvskcM50GxN0vnZlihg8iNM=; b=jIPBxMymj7WT30PyaxDxRWcOE9uud7btl7bmsaK8jmrC/EBAigd0q2TRfIOxltITPt /N2MW26NsxOKhuCPnyj5Zk/g/nVLshMqDCIFYmDwTea2fPQYzqv4jZP7k7rLXyn/Tp5t Kd2LmRb2Zcr0IWdttXQGo9XhkoLSvbOmR6RjWva9epzTipDLlERA8ol4v7Qc6MBWVdNq 60oHjRY0YzPWf6tww2Nn0+HOJ/zh6GH5DP/rLY7ZLNK1Si1KmC+h2TztxfuwiBe223Pd j2rI8E/VAlnnATOkdiY5tGDgx4TXS78Faif0r5Z0uww0VkUxGH1539OKfuEZnohC1dd6 cVmw== X-Gm-Message-State: ALoCoQkhboE1eSEh6wS2hqXMsEap4Pbh5kOLjQHjwZJ3xUouNeZDjaYZ7qtdAE4LNONNg3AHbn3P MIME-Version: 1.0 X-Received: by 10.67.15.194 with SMTP id fq2mr3021851pad.31.1406800464128; Thu, 31 Jul 2014 02:54:24 -0700 (PDT) Received: by 10.70.54.38 with HTTP; Thu, 31 Jul 2014 02:54:24 -0700 (PDT) Date: Thu, 31 Jul 2014 19:54:24 +1000 Message-ID: Subject: thread_local broken on clang From: Troy Heron To: freebsd-bugs@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 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: Thu, 31 Jul 2014 09:54:25 -0000 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? Thanks, Troy Heron