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

Attachment: cxa-atexit.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to