From owner-svn-src-all@freebsd.org Fri Feb 23 14:30:18 2018 Return-Path: Delivered-To: svn-src-all@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 33598F26AB1 for ; Fri, 23 Feb 2018 14:30:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEB6982B5A for ; Fri, 23 Feb 2018 14:30:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id v6so8855580iog.7 for ; Fri, 23 Feb 2018 06:30:17 -0800 (PST) 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=xTQWHqx6T3AapJLwZwAue9rQ0s6FBb4MtAj2jnl8NAY=; b=wnNPCCzXjwVpNjfNlcumBbZvK0wp1dJV7YyMb4LIClQGBw2J1dyF3lx9HaYqK2OWqQ WyyRwiz6okv4dE/X5AI6swr5kNTcZOlqmwkYFi0Ir559kk0Hltjr885keNaBfoanT5uN cH8CRYJYlzTU5XGclE3hNIV0xPLmQvHdVAXQfGzberIJrsEZ05uj5g4D5+kctCOvCBfS SzkTva1GUjZl6bKmSzZTGZdr2nraM6lZVsdoKn7V7w3+KDRGOR4QlJfXcwTPmmhfe5ll tvjMc09ys/5GsxjvJZNfgkK6C3toU35UTjNAKtRC6wxD+4/pfDtXqdLF2XL1hQGTcI6A kPrw== 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=xTQWHqx6T3AapJLwZwAue9rQ0s6FBb4MtAj2jnl8NAY=; b=Y6YCUra0PKoUFG/GQwderRnKw4zQ/gsObqO2PVmzEL4h8t6Q0SJ1ehEeo/GeuV6EV+ +01zlJwnrZUd8jK2O3oFHy8QPHA/YR4NiMxsEcZbGM3BTKiMSNm6n9a4rpH/S2KOPdRT SbPgI6cqombpCmp5xJL+YYv0Da21G41XU621yjti60nnOT5nHLlC87gFih3wtT0JPPre B5YXJ08CoLdf8tZawqAyL6732bMCoxNmL4ydUT2QWd8D5hJxOpjKZzwNk8tzRirz3nQw 86kh0ALYNNWVldZlg+WO2HF8wXztkrT7rtGBGQcu3Vkm8Bw6hDkrxUxVuFiMEYiIj74E YCcQ== X-Gm-Message-State: APf1xPC2bJuNGcG1eQm3Buq441Y3idZ7XfJvD9rFVkbSXN0moxJUEv8L qr7U0G5FxxJElugoc7mp68CE2+roimKknN8KxVDVtEuz X-Google-Smtp-Source: AG47ELtTasWK81cxlpRuFlTZU/mfjlcYC8YLwlNq6li3sUbuSawUnB9Z17NuzPBnyLhJq+rY4ec0poa/c6CMOmHbxkg= X-Received: by 10.107.180.83 with SMTP id d80mr1902590iof.168.1519396216589; Fri, 23 Feb 2018 06:30:16 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 23 Feb 2018 06:30:15 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180223170403.I1331@besplex.bde.org> References: <201802230404.w1N44PiD053834@repo.freebsd.org> <20180223170403.I1331@besplex.bde.org> From: Warner Losh Date: Fri, 23 Feb 2018 07:30:15 -0700 X-Google-Sender-Auth: 6ZBIMAgZYbwnKFcUMZINc7RVfCA Message-ID: Subject: Re: svn commit: r329859 - in head: contrib/compiler-rt/lib/builtins include stand sys/arm/include sys/arm64/include sys/mips/include sys/powerpc/include sys/riscv/include sys/sparc64/include sys/sys sy... To: Bruce Evans Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 14:30:18 -0000 On Thu, Feb 22, 2018 at 11:12 PM, Bruce Evans wrote: > On Fri, 23 Feb 2018, Warner Losh wrote: > > Log: >> Do not include float interfaces when using libsa. >> >> We don't support float in the boot loaders, so don't include >> interfaces for float or double in systems headers. In addition, take >> the unusual step of spiking double and float to prevent any more >> accidental seepage. >> > > This unimproves all the _types.h headers, probably for no benefits for lua. > > Modified: head/sys/arm/include/_types.h >> ============================================================ >> ================== >> --- head/sys/arm/include/_types.h Fri Feb 23 04:04:18 2018 >> (r329858) >> +++ head/sys/arm/include/_types.h Fri Feb 23 04:04:25 2018 >> (r329859) >> @@ -70,8 +70,10 @@ typedef unsigned long long __uint64_t; >> */ >> typedef __uint32_t __clock_t; /* clock()... */ >> typedef __int32_t __critical_t; >> +#ifndef _STANDALONE >> typedef double __double_t; >> typedef float __float_t; >> +#endif >> typedef __int32_t __intfptr_t; >> typedef __int64_t __intmax_t; >> typedef __int32_t __intptr_t; >> > > __types.h headers exist to avoid ifdefs like this. They only define types > in the implementation namespace. Nothing except should use > __double_t or __float_t directly. There is only a problem if some option > like -fno-float turns off floating point completely, so that 'float' is > a syntax error. Right. Except, there's no longer a -fno-float option. Then again, these should almost certainly be in sys/_types instead because they are identical on every platform and will almost certainly never ever be anything other than what they are. For the boot loader, I spiked double and float definitions so that we don't touch floating point types at all. We do this in the Makefile by intentionally creating syntax errors. I don't think this is undefined behavior, I think it is well defined behavior: A syntax error is a syntax error. We're using a restricted set of C for the loader anyway. It's mostly to prevent accidental use of floating point. If we ever support floats and such in the boot loader, I'll revert. This helps us catch accidents like one of the lua files being compiled incorrectly, leading to stray references to float/double on arm which caused float stuff to be referenced and pulled in due to inlining. That's the real bug, and that's been fixed. Until we need float/double in the loader, I'll keep this in place to prevent a recurrence. Warner