From owner-freebsd-current@freebsd.org Fri Aug 10 14:31:51 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1245F106C4B9 for ; Fri, 10 Aug 2018 14:31:51 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B87E8D20A for ; Fri, 10 Aug 2018 14:31:50 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: by mail-io0-x232.google.com with SMTP id z20-v6so7836267iol.0 for ; Fri, 10 Aug 2018 07:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uuYoFAb5Zm8G9f3xo1qPbm0UTze0RTQSv7q6I4/KjY8=; b=j72D2NiKH25wQyB23t0nAubyclVSfBWgsPOe1WbWA4J0EzIM25U5s/8plzEe03xwtG AZTZTuaZwqnsCaUKDhnTUZmLS8VvMr9SvWVPr5lFTHfdt3xWUm5/rC8C9ER4q2j+MSbP wyUO4sqm5y4k61+5YU8RVqQz5OKKOmd6cs6MIOASUuAHYqXJGtoxW/z+svHhVsujz78x y/zpBJWNuzLjzKxrxPKubtyFxdtwlaGKeMjx9ainnDZvkC6RzAt/reX//quj+rJOssf7 ANZ7cF/J3ClKXzpUVUtUdLI0n8RTN/9vjIEQlaEGInRAH049JOqnsNdnh4Yv+xyX1xa5 GpMg== 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:from:date :message-id:subject:to:cc; bh=uuYoFAb5Zm8G9f3xo1qPbm0UTze0RTQSv7q6I4/KjY8=; b=KTTzdUMb3bfhgsPL+Xz2IqzBwqsOpyEJE7AGBOtk5SIPwMqNj5HpH2fcUqsZt91q1T xUkhQuqZhlxdHYrtfQ71hujGb5pMq1dRdgfCW0Gdn0bqQpUKCtSXwInC5cV1EtoCC1ty cHUk+w3ud1BWbCxVUqAtp9HKsI7WcWjPxmLI8WEhUYkXtQpkE9dLlNMUgx56I+z8cHSg qk5rv1QxGVWyf9pPYI6gmldwnQy9vD/O99qwDAkDFEXhwZ/wbirdG22L/Gw7xyhq7l8r uwr2nX04+SZCJkp0UzaZkmQHl0Z+3Jy7XeHZoRfSZpV1ElNW+Exxdz2HvjLNYWlSDe/1 FSlA== X-Gm-Message-State: AOUpUlFBTDSp2yh8F0kGsLDnhVHgSP4riwUNtk2rae1OYoeJ8QDPCnjN Bf9kgsgeVlJb+wpH9g/OetuUStPRRrnM3b/0hqOjYMPB X-Google-Smtp-Source: AA+uWPxh8P0worv3+NDooHJpMWIcK1mUldHuWrt445chqp8PX8VP/jTc8CcNSyeaa/2bU+JYmnrJBRy2dh2uxOdOV1k= X-Received: by 2002:a6b:2c82:: with SMTP id s124-v6mr5379305ios.136.1533911510035; Fri, 10 Aug 2018 07:31:50 -0700 (PDT) MIME-Version: 1.0 References: <20180810082813.3a165d2b.freebsd.ed.lists@sumeritec.com> <20180810135149.6a95b233.freebsd.ed.lists@sumeritec.com> In-Reply-To: From: blubee blubeeme Date: Fri, 10 Aug 2018 22:31:38 +0800 Message-ID: Subject: Re: #includes and #defined To: Warner Losh Cc: freebsd.ed.lists@sumeritec.com, FreeBSD current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 14:31:51 -0000 On Fri, Aug 10, 2018 at 9:53 PM Warner Losh wrote: > > > On Thu, Aug 9, 2018 at 11:51 PM, Erich Dollansky < > freebsd.ed.lists@sumeritec.com> wrote: > >> Hi, >> >> On Fri, 10 Aug 2018 12:40:48 +0800 >> blubee blubeeme wrote: >> >> > On Fri, Aug 10, 2018 at 8:28 AM Erich Dollansky < >> > freebsd.ed.lists@sumeritec.com> wrote: >> > >> > > Hi, >> > > >> > > On Fri, 10 Aug 2018 08:01:42 +0800 >> > > blubee blubeeme wrote: >> > > >> > > > What's the proper way to define and include FreeBSD amd64 in GNU >> > > > Makefiles >> > > > >> > > > Do we define FreeBSD as x86_64 or amd64 also is it __FreeBSD__, >> > > > FreeBSD__, or __FreeBSD >> > > > >> > > > I've seen all of the above looking through different projects. >> > > >> > > clang defines '__FreeBSD__' >> > > >> > > Erich >> > > >> > >> > What about the architecture name is it recommended to use x86_64 or >> > amd64? >> >> my clang reports on an Intel CPU: >> >> #define __amd64 1 >> #define __amd64__ 1 >> #define __x86_64 1 >> #define __x86_64__ 1 >> >> as defined. >> >> It reports >> >> #define __aarch64__ 1 >> >> on an 64 bit ARM CPU. >> > > 'man 7 arch' will tell you these things: > > amd64 __amd64__, __x86_64__ > This is what I was looking for, thank you for the man page and it's good to see that these things are starting to get documented. > > it contains the preferred list of macros to use. Ideally, you'd use the > first one listed, though all the ones listed are supported. Others might > not be. > > Warner > Best, Owen