From owner-freebsd-current@freebsd.org Fri Aug 10 13:53:22 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 C3E9D106B8B8 for ; Fri, 10 Aug 2018 13:53:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (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 47C108BB0F for ; Fri, 10 Aug 2018 13:53:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id z19-v6so7707596ioh.4 for ; Fri, 10 Aug 2018 06:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7+p15+U4jI0ZPMs0ZON01yK8zJ5f26idlygXn/kK7IM=; b=O0f33eCT/J7EAo4npQyLiYa6otXaXvEUbfvwSE4KL73xMuWmLDBVEnzAxiZf7MceKo gfQVu7JxRakbZGToVU3F3nL9h/y2wJrdrgGpIyBEreUyhf9fsrjbBQgVKaBx70gT9YLL 2eECvtxX4wXHPdDsivw2YIBwq70g9oUSiYBw+FelmLsfe4LQ3CxCUQXG4+rWImK4u6+e F8/PNinFQIparsfsTTDG83+iyKzRgJFWJku0Zdv2mxYVJJHcBFQTUOk2Ex5ZjsQmJl4l ndIjBRRZoBpY2jLfEPCt4sp/ydHZlH2iyePqgrcHggEbUzCwYUs62fL108tfFFzh+1BV 0Udw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=7+p15+U4jI0ZPMs0ZON01yK8zJ5f26idlygXn/kK7IM=; b=LUC5i3ehoeVXSRdlRUELNulwyfg/IeDf2q6d24vO/7u03TVZrEgudBIgQMaKExppaS 6P4ZxEM0X1XllmkMPs8WSIgspbiqp4xdmFN3N3EESTDO/cuRyMurKMrKJYfCUp7AApRe PkD4GodlJ/2xaInoMuv+lpzl2EqhUILvvsXovB5vnFL2KP6FS250dIq/GVQ9AYPAypp5 vQqpwHu2EQ3RGRi3OhpMW3dGSY/zLw2yAg2FI9JEFvk/GzpJll7l/rfJ7D0n8FonBvzV LrKGjQlYiiAUOpHq1gvJU3c2SrXOs7LSloblYMA4FCeZ5HWET4rI+hbXNOcMLBfLsvGn oR7g== X-Gm-Message-State: AOUpUlGkj1Vr85F6tzec77r/D2eT7Ay0+CqFq9f6iOEAK4d4qkBEYgpA NXWqvVOMn+5Q5Y2Rq1AnWqp8/KMejdJ/h7hH3hCkzxg++7g4Nw== X-Google-Smtp-Source: AA+uWPzu2bJVld1hbIis59q9xBx/fwW9hmOSKiiH0H1nfJDs/GOs5CqTtX8sATPxq/Ce7KGUT4R4WbyNud0qwMPUR6w= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr5477014ioa.168.1533909200226; Fri, 10 Aug 2018 06:53:20 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Fri, 10 Aug 2018 06:53:19 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180810135149.6a95b233.freebsd.ed.lists@sumeritec.com> References: <20180810082813.3a165d2b.freebsd.ed.lists@sumeritec.com> <20180810135149.6a95b233.freebsd.ed.lists@sumeritec.com> From: Warner Losh Date: Fri, 10 Aug 2018 07:53:19 -0600 X-Google-Sender-Auth: -A4961fiAKn26j8VG2P3S8_l-l0 Message-ID: Subject: Re: #includes and #defined To: Erich Dollansky Cc: blubee blubeeme , 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 13:53:22 -0000 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__ 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