[PATCH] Defaulting to -fno-use-cxa-atexit on Windows
João Matos
ripzonetriton at gmail.com
Mon Mar 11 17:35:10 PDT 2013
LGTM
On Tue, Mar 12, 2013 at 12:30 AM, Aaron Ballman <aaron at aaronballman.com>wrote:
> When building for Windows, using cxa-atexit causes link errors. We
> already set this flag to false for Cygywin, MinGW and hexagon targets.
> This patch also sets it to false for Windows targets.
>
> Note: to reproduce:
>
> class c {
> public:
> ~c() { }
> };
>
> C c;
>
> int main() { return 0; }
>
> On Windows when built with MSVC, this will yield:
>
> test2-906565.o : error LNK2019: unresolved external symbol ___dso_handle
> referen
> ced in function ___cxx_global_var_init
> test2-906565.o : error LNK2019: unresolved external symbol ___cxa_atexit
> referen
> ced in function ___cxx_global_var_init
> a.out : fatal error LNK1120: 2 unresolved externals
>
> This patch resolves it so that you do not have to pass
> -fno-use-cxa-atexit in order to properly link.
>
> ~Aaron
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
--
João Matos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130312/90cfedd3/attachment.html>
More information about the cfe-commits
mailing list