[cfarm-users] Where did XL C/C++ predefined macros go on GCC112?

Jeffrey Walton noloader at gmail.com
Tue Jul 31 05:06:53 CEST 2018


On Mon, Jul 30, 2018 at 9:42 PM, Jeffrey Walton <noloader at gmail.com> wrote:
> On Mon, Jul 30, 2018 at 9:33 PM, Paul Hargrove <phhargrove at lbl.gov> wrote:
>> XL for little-endian is essentially a difference beast than prior compilers
>> with the XL name.
>> So, IBM changed the identification macros.
>> See the following two docs for more info:
>>
>> https://www.ibm.com/support/knowledgecenter/en/SSXVZZ_13.1.6/com.ibm.xlcpp1316.lelinux.doc/compiler_ref/opt_qxlcompatmacros.html
>> https://www.ibm.com/support/knowledgecenter/en/SSXVZZ_13.1.6/com.ibm.xlcpp1316.lelinux.doc/compiler_ref/xlmacros.html
>>
>> TL;DR: You can "bring them back" with -qxlcompatmacros
>
> Thanks Paul.
>
> This is frightening and explains the failure:
>
>     C/C++ for Linux for little endian distributions, as both
>     __clang__ and __gcc__ macros are also defined.

Well, this is new for LLVM. It is now pretending to be three compilers:

$ xlc  -qxlcompatmacros  -qshowmacros -qarch=pwr8 -qaltivec -E
adhoc.cpp | egrep -i -E 'xlc|clang|llvm|gnuc'
#define __GNUC_GNU_INLINE__ 1
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >=
((maj) << 16) + (min))
#define __GNUC_VA_LIST 1
#define __GNUC__ 4
#define __XLC_BUILTIN_VAARG__ 1
#define __clang__ 1
#define __clang_major__ 4
#define __clang_minor__ 0
#define __clang_patchlevel__ 1
#define __clang_version__ "4.0.1 (tags/RELEASE_401/final)"
#define __llvm__ 1
#define __xlC__ 0x0d01
#define __xlC_ver__ 0x00000601

Wow...


More information about the cfarm-users mailing list