From owner-svn-src-head@freebsd.org Wed Jun 1 00:32:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDA1DB57B43; Wed, 1 Jun 2016 00:32:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id D1FBC18BA; Wed, 1 Jun 2016 00:32:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id E9324D5BE; Wed, 1 Jun 2016 00:32:32 +0000 (UTC) Subject: Re: svn commit: r301023 - head/sys/boot/geli To: Xin Li , Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605310624.u4V6OAYi071387@repo.freebsd.org> <31d1323b-cb13-9a90-8b25-430fdbc1d225@delphij.net> Cc: d@delphij.net From: Allan Jude Message-ID: <7085dc80-f4ce-9a78-7153-0bf4995cabd4@freebsd.org> Date: Tue, 31 May 2016 20:32:32 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <31d1323b-cb13-9a90-8b25-430fdbc1d225@delphij.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2016 00:32:34 -0000 On 2016-05-31 02:31, Xin Li wrote: > > > On 5/30/16 23:24, Garrett Cooper wrote: >> Author: ngie >> Date: Tue May 31 06:24:09 2016 >> New Revision: 301023 >> URL: https://svnweb.freebsd.org/changeset/base/301023 >> >> Log: >> Add missing libc includes to fix -Wimplicit-function-declaration warnings >> >> MFC after: 2 weeks >> Reported by: clang >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/sys/boot/geli/geliboot_crypto.c >> >> Modified: head/sys/boot/geli/geliboot_crypto.c >> ============================================================================== >> --- head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:00:18 2016 (r301022) >> +++ head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:24:09 2016 (r301023) >> @@ -27,6 +27,10 @@ >> * $FreeBSD$ >> */ >> >> +#include >> +#include >> +#include >> + >> #include "geliboot.h" > > This is wrong, you shouldn't use standard C library in freestanding > environment. > > It seems that libstand.h is explicitly excluded, why? (in geliboot.h, > allanjude cc'ed): > > %%% > /* AES-XTS implementation */ > #define _STAND > #define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */ > #include > > %%% > > Cheers, > The boot loader uses sys/common/util.h to avoid needing all of libstand in size sensitive files like boot2 (7kb) and zfsboot (64kb). If you then pull in stand.h or string.h, you get conflicting definitions of the functions like printf and bcmp. The manual defines for STAND_H, _STRING_H_, _STDIO_H_, etc, are there to block those files being included by existing library we use, like opencrypto and geli. Since these are included before geliboot.h, and only compiled into the libgeliboot.a archive, it would seem to work, although it is probably confusing to anyone trying to read the code. -- Allan Jude