From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D49A71F66E for ; Mon, 15 Feb 2021 03:29:42 +0000 (UTC) Received: from localhost ([::1]:44088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBUZx-0007XK-GW for normalperson@yhbt.net; Sun, 14 Feb 2021 22:29:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBUZt-0007XB-UW for bug-gnulib@gnu.org; Sun, 14 Feb 2021 22:29:37 -0500 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:45757) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBUZo-0007Wn-Ir for bug-gnulib@gnu.org; Sun, 14 Feb 2021 22:29:35 -0500 Received: by mail-io1-xd33.google.com with SMTP id n201so5385192iod.12 for ; Sun, 14 Feb 2021 19:29:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=JOUSl8WZJSmt8joCS8uGP3o4vd7L7JGMnBlXMpj1GIw=; b=MMr6C2bJgxDW5RlKWS5UpOFS8SOwt3Q70bXDHE+oxNOlCUvZNNQ5tNm7/4q0uOTsMV IcSHHWQSn78QcJFnU661ii9OVHK1lUOIvVUIwjNgff4mfhkx3z9cAPLMXNk+0LU8OryP mdEMznHnj8ekE07tqPRMP97u3RUTUdgfRDZKoSYmb4C+lB70qO9F/E76WQ+CG8p3fheB pxKeywMOAOqdEs1k4YfiZ44SNuuFKzTvbRcTdXOQbVOYBm6JEIx06qYPXgItBwe6hVzQ 0JTGG1r7ZKRI0q4J6Kk7IMUfdI4sI/kNHSSvMUhuYVR5m6GQNLG2BBuAiEzkVx2yYFzy FhfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=JOUSl8WZJSmt8joCS8uGP3o4vd7L7JGMnBlXMpj1GIw=; b=g194s4xdrPjBvHjyHkAO5z9krHZ9J9UdFNH+eHa3p37RVH58nrYwjGfxCFIDJykTtH NInUZzRZOKpJPTXvmwPFuCnNl21lShMNa2oM4Za/XQhqjcEuRyZs/vfkflot5yG8fb3E ndyqAoSbtavn8KEmpbWX0wCMBjbbGOFshxsszr4pM6VGo+iVHZ4w7oNwRFWn53T1+23o pUjLaFveo7H/5ZTmvOKKBEzGF4ENSEpgpH6vUYlsPvuvUbQcqCxXueiJ6zaFoqHtlAm8 iV5lX99kWF1eLEUq9ohaqcpp/cnR5LccoEvRdQuB6n9SiImqDdmAhmS0JPS2usHTOtEC zhaA== X-Gm-Message-State: AOAM530Qqd8Iqcp+mxSJgmmkUKBPCBOlAmhYweQfu9n76JInEkJFB1kd ge8+VyK2d269pGZ/2UjwO2DdfxVh50TZyo0f3ZQ= X-Google-Smtp-Source: ABdhPJwvNOI9oQCYhHSSaaPcxBIQ90VUT+sgH3/SCFwUQ5+SSg+Jm1ZXqwpYfWfvpz//QD9MM97BOoDGpz05a3JVZJI= X-Received: by 2002:a5e:940a:: with SMTP id q10mr11720035ioj.66.1613359770997; Sun, 14 Feb 2021 19:29:30 -0800 (PST) MIME-Version: 1.0 References: <6456685.5lUXKWfzpP@omega> In-Reply-To: <6456685.5lUXKWfzpP@omega> From: Jeffrey Walton Date: Sun, 14 Feb 2021 22:29:11 -0500 Message-ID: Subject: Re: Fix distinction of 32-bit/64-bit mode with xlc 13.1.3 on AIX To: Bruno Haible Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::d33; envelope-from=noloader@gmail.com; helo=mail-io1-xd33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: noloader@gmail.com Cc: "bug-gnulib@gnu.org List" Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Bruno, On Sun, Feb 14, 2021 at 9:50 PM Bruno Haible wrote: > > Starting with xlc version 13, this compiler defines the preprocessor macro > _ARCH_PPC64 also in 32-bit builds. See: > > $ xlc -qversion > IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72) > Version: 12.01.0000.0000 > $ echo > empty.c ; xlc -qshowmacros=pre -E empty.c | grep ARCH_PPC > #define _ARCH_PPC 1 > > $ xlc -qversion > IBM XL C/C++ for AIX, V13.1.3 (5725-C72, 5765-J07) > Version: 13.01.0003.0006 > $ echo > empty.c ; xlc -qshowmacros=pre -E empty.c | grep ARCH_PPC > #define _ARCH_PPCGR 1 > #define _ARCH_PPC64GRSQ 1 > #define _ARCH_PPC 1 > #define _ARCH_PPC64GR 1 > #define _ARCH_PPC64 1 > > So, in order to distinguish a 32-bit mode from a 64-bit mode, only the > following macros can be used: > - defined in 32-bit mode only: _ILP32 __ILP32__ > - defined in 64-bit mode only: _LP64 __LP64__ __64BIT__ Are you sure that is correct? It almost sounds like the default is 32-bit, and you need an option to enable 64-bit. According to the XL C/C++ manual for AIX (p. 507) [1]: _ARCH_PPC - Indicates that the application is targeted to run on any Power processor. _ARCH_PPC64 - Indicates that the application is targeted to run on Power processors with 64-bit support. And from the manual (p. 28): Compiler mode is set according to the last-found instance of the -q32or -q64 compiler options. If neither of these compiler options is set, the compiler mode is set by the value of the OBJECT_MODE environment variable. If the OBJECT_MODE environment variable is also not set, the compiler assumes32-bit compilation mode. So it sounds like you are getting a 32-bit binary that runs on either a 32-bit or 64-bit machine. Jeff [1] https://www.ibm.com/support/knowledgecenter/SSGH3R_13.1.3/com.ibm.compilers.aix.doc/compiler.pdf