From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cPd69-0008K3-BX for mharc-grub-devel@gnu.org; Fri, 06 Jan 2017 17:34:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPd67-0008Ji-0A for grub-devel@gnu.org; Fri, 06 Jan 2017 17:34:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPd62-0006BH-3t for grub-devel@gnu.org; Fri, 06 Jan 2017 17:34:55 -0500 Received: from mail.gw90.de ([2a01:4f8:100:7463::3]:59308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cPd61-00068o-Tk for grub-devel@gnu.org; Fri, 06 Jan 2017 17:34:50 -0500 Received: from ipservice-092-214-146-170.092.214.pools.vodafone-ip.de ([92.214.146.170] helo=mattotaupa) by mail.gw90.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cPd5t-0008QO-PL for grub-devel@gnu.org; Fri, 06 Jan 2017 22:34:42 +0000 Message-ID: <1483742072.2565.38.camel@users.sourceforge.net> Subject: Re: [solved] Build error with clang 4.0 From: Paul Menzel To: grub-devel@gnu.org Date: Fri, 06 Jan 2017 23:34:32 +0100 In-Reply-To: <3132777b-7787-bcaf-adcf-a4b041bd68b4@gmail.com> References: <1482851432.3916.196.camel@users.sourceforge.net> <3132777b-7787-bcaf-adcf-a4b041bd68b4@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-+uXtsqHpQWNBskJoOVoN" X-Mailer: Evolution 3.22.3-1 Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:100:7463::3 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 22:34:56 -0000 --=-+uXtsqHpQWNBskJoOVoN Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Andrei, Am Freitag, den 30.12.2016, 18:44 +0300 schrieb Andrei Borzenkov: > 27.12.2016 18:10, Paul Menzel =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > Using Clang 4.0 the build fails with the error below. > >=20 > > ``` > > $ sudo apt install clang-4.0 # Debian Sid/unstable > > $ clang-4.0 --version > > clang version 4.0.0-svn286225-1 (trunk) > > Target: i686-pc-linux-gnu > > Thread model: posix > > InstalledDir: /usr/bin > > $ git log --oneline -1 > > ce95549cc efi: properly terminate filepath with NULL in chainloader > > $ ./autoconf.sh > > $ CC=3Dclang-4.0 ../grub/configure --with-platform=3Dcoreboot --enable-= boot-time > > $ make -j > > [=E2=80=A6] > > ../grub/grub-core/fs/hfs.c:699:10: error: taking address of packed memb= er 'catalog_recs' of class or structure 'grub_hfs_sblock' may result in an = unaligned pointer > > value [-Werror,-Waddress-of-packed-member] > > ? (&data->sblock.catalog_recs) > > ^~~~~~~~~~~~~~~~~~~~~~~~~ > > ../grub/grub-core/fs/hfs.c:700:10: error: taking address of packed memb= er 'extent_recs' of class or structure 'grub_hfs_sblock' may result in an u= naligned pointer > > value [-Werror,-Waddress-of-packed-member] > > : (&data->sblock.extent_recs)); > > ^~~~~~~~~~~~~~~~~~~~~~~~ > > [=E2=80=A6] > > ``` > >=20 > > The build succeeds using gcc (Debian 6.2.1-7) 6.2.1 20161215, so I am > > unsure if this is a Clang issue. > >=20 >=20 > I remember having seen it with LLVM/clang development snapshot before > but got distracted. But currently I cannot reproduce it using LLVM/clang > git as of yesterday, even if I explicitly add -Waddress-of-packed-member > to compile options. May be I miss some steps. >=20 > Regarding issue itself - we should not have alignment problem here, at > least on known platforms. Structure elements are properly aligned inside > of structure and structure itself is at the beginning of malloc returned > memory. >=20 > I was about to change prototype to (void *) then as I mentioned forgot > about it (or, better, issue did not happen in released clang so I did > not want to add workarounds for development snapshot). >=20 > It would be helpful if you could check when issue disappeared (if it > did). Unfortunately, full LLVM/clang build takes half a day on my system > and tears HDD apart :( It seems to have been a LLVM/clang issue. With the version below, from around January 1st or 2nd I believe, everything builds fine. ``` $ clang-4.0 --version clang version 4.0.0-svn290810-1 (trunk) Target: i686-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin ``` Sorry for the noise. Thanks, Paul --=-+uXtsqHpQWNBskJoOVoN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQ8+w9d414FAVARIpk9fVorbA4dWAUCWHAbegAKCRA9fVorbA4d WDMBAJ92YofpunDIk5fwSlW6SNelABrJaQCeLnN84IH6rxPoRKzxH0+QBrAYNII= =2Hux -----END PGP SIGNATURE----- --=-+uXtsqHpQWNBskJoOVoN--