Re: [libcxx] r291329 - Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.

2017-01-07 Thread Eric Fiselier via cfe-commits
On Sat, Jan 7, 2017 at 1:29 AM, Shoaib Meenai  wrote:

> Do you think it's worth also checking for the presence of cxxabi.h and
> assuming the Itanium ABI if it's found, since the MS ABI shouldn't be using
> any ABI library?
>

No I don't think we should check for `cxxabi.h`.It's entirely possible to
want to compile
for the Microsoft ABI when `cxxabi.h` is in your path.

That being said I don't think the current configuration is correct either.
I'm just using it
until we change Clang to provide the needed macros.


>
> (_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY would have been ideal were it
> available
> persistently rather than only during the build of libc++ itself. It could
> still work if this macro isn't used in any headers though.)
>
> Also, is there ever a case where _MSC_VER would be defined and _WIN32
> wouldn't? The current check seems slightly redundant.
>
> On 1/6/17, 6:43 PM, "cfe-commits on behalf of Eric Fiselier via
> cfe-commits"  cfe-commits@lists.llvm.org> wrote:
>
> Author: ericwf
> Date: Fri Jan  6 20:43:58 2017
> New Revision: 291329
>
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.
> org_viewvc_llvm-2Dproject-3Frev-3D291329-26view-3Drev=DgIGaQ=
> 5VD0RTtNlTh3ycd41b3MUw=o3kDXzdBUE3ljQXKeTWOMw=vt8N_ZR6syyL2-CBgE_
> SBSS0YTQdKIMfcLf4r8leu2c=fVFRdDSSgXSZHuGlbfQI1SHyPLDGvuVdhQdxOsU30hI=
> Log:
> Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.
>
> This patch adds a libc++ configuration macro for the ABI we
> are targeting, either Itanium or Microsoft. For now we configure
> for the Microsoft ABI when on Windows with a compiler that defines
> _MSC_VER. However this is only temporary until Clang implements
> builtin macros we can use.
>
> Modified:
> libcxx/trunk/include/__config
>
> Modified: libcxx/trunk/include/__config
> URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.
> org_viewvc_llvm-2Dproject_libcxx_trunk_include_-5F-
> 5Fconfig-3Frev-3D291329-26r1-3D291328-26r2-3D291329-26view-
> 3Ddiff=DgIGaQ=5VD0RTtNlTh3ycd41b3MUw=o3kDXzdBUE3ljQXKeTWOMw=vt8N_
> ZR6syyL2-CBgE_SBSS0YTQdKIMfcLf4r8leu2c=46ge62wLL0LHhhQmWVsvb0uPoh8oV4
> 4DG0fsq0nEPs8=
> 
> ==
> --- libcxx/trunk/include/__config (original)
> +++ libcxx/trunk/include/__config Fri Jan  6 20:43:58 2017
> @@ -111,6 +111,15 @@
>  #define _LIBCPP_COMPILER_IBM
>  #endif
>
> +// FIXME: ABI detection should be done via compiler builtin macros.
> This
> +// is just a placeholder until Clang implements such macros. For now
> assume
> +// that Windows compilers pretending to be MSVC++ target the
> microsoft ABI.
> +#if defined(_WIN32) && defined(_MSC_VER)
> +# define _LIBCPP_ABI_MICROSOFT
> +#else
> +# define _LIBCPP_ABI_ITANIUM
> +#endif
> +
>  // Need to detect which libc we're using if we're on Linux.
>  #if defined(__linux__)
>  #include 
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.
> llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dcommits=DgIGaQ=
> 5VD0RTtNlTh3ycd41b3MUw=o3kDXzdBUE3ljQXKeTWOMw=vt8N_ZR6syyL2-CBgE_
> SBSS0YTQdKIMfcLf4r8leu2c=rzONjyM9TBpTpA9aQpIA9LFsaiofSZIYff34ZiNb5cA=
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r291329 - Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.

2017-01-07 Thread Shoaib Meenai via cfe-commits
Do you think it's worth also checking for the presence of cxxabi.h and
assuming the Itanium ABI if it's found, since the MS ABI shouldn't be using
any ABI library?

(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY would have been ideal were it available
persistently rather than only during the build of libc++ itself. It could
still work if this macro isn't used in any headers though.)

Also, is there ever a case where _MSC_VER would be defined and _WIN32
wouldn't? The current check seems slightly redundant.

On 1/6/17, 6:43 PM, "cfe-commits on behalf of Eric Fiselier via cfe-commits" 
 
wrote:

Author: ericwf
Date: Fri Jan  6 20:43:58 2017
New Revision: 291329

URL: 
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D291329-26view-3Drev=DgIGaQ=5VD0RTtNlTh3ycd41b3MUw=o3kDXzdBUE3ljQXKeTWOMw=vt8N_ZR6syyL2-CBgE_SBSS0YTQdKIMfcLf4r8leu2c=fVFRdDSSgXSZHuGlbfQI1SHyPLDGvuVdhQdxOsU30hI=
 
Log:
Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.

This patch adds a libc++ configuration macro for the ABI we
are targeting, either Itanium or Microsoft. For now we configure
for the Microsoft ABI when on Windows with a compiler that defines
_MSC_VER. However this is only temporary until Clang implements
builtin macros we can use.

Modified:
libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: 
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_include_-5F-5Fconfig-3Frev-3D291329-26r1-3D291328-26r2-3D291329-26view-3Ddiff=DgIGaQ=5VD0RTtNlTh3ycd41b3MUw=o3kDXzdBUE3ljQXKeTWOMw=vt8N_ZR6syyL2-CBgE_SBSS0YTQdKIMfcLf4r8leu2c=46ge62wLL0LHhhQmWVsvb0uPoh8oV44DG0fsq0nEPs8=
 

==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Fri Jan  6 20:43:58 2017
@@ -111,6 +111,15 @@
 #define _LIBCPP_COMPILER_IBM
 #endif
 
+// FIXME: ABI detection should be done via compiler builtin macros. This
+// is just a placeholder until Clang implements such macros. For now assume
+// that Windows compilers pretending to be MSVC++ target the microsoft ABI.
+#if defined(_WIN32) && defined(_MSC_VER)
+# define _LIBCPP_ABI_MICROSOFT
+#else
+# define _LIBCPP_ABI_ITANIUM
+#endif
+
 // Need to detect which libc we're using if we're on Linux.
 #if defined(__linux__)
 #include 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org

https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dcommits=DgIGaQ=5VD0RTtNlTh3ycd41b3MUw=o3kDXzdBUE3ljQXKeTWOMw=vt8N_ZR6syyL2-CBgE_SBSS0YTQdKIMfcLf4r8leu2c=rzONjyM9TBpTpA9aQpIA9LFsaiofSZIYff34ZiNb5cA=
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r291329 - Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.

2017-01-06 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Fri Jan  6 20:43:58 2017
New Revision: 291329

URL: http://llvm.org/viewvc/llvm-project?rev=291329=rev
Log:
Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.

This patch adds a libc++ configuration macro for the ABI we
are targeting, either Itanium or Microsoft. For now we configure
for the Microsoft ABI when on Windows with a compiler that defines
_MSC_VER. However this is only temporary until Clang implements
builtin macros we can use.

Modified:
libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=291329=291328=291329=diff
==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Fri Jan  6 20:43:58 2017
@@ -111,6 +111,15 @@
 #define _LIBCPP_COMPILER_IBM
 #endif
 
+// FIXME: ABI detection should be done via compiler builtin macros. This
+// is just a placeholder until Clang implements such macros. For now assume
+// that Windows compilers pretending to be MSVC++ target the microsoft ABI.
+#if defined(_WIN32) && defined(_MSC_VER)
+# define _LIBCPP_ABI_MICROSOFT
+#else
+# define _LIBCPP_ABI_ITANIUM
+#endif
+
 // Need to detect which libc we're using if we're on Linux.
 #if defined(__linux__)
 #include 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits