Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cMzM4-00040V-Nb for mharc-grub-devel@gnu.org; Fri, 30 Dec 2016 10:44:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMzM2-0003zF-Rp for grub-devel@gnu.org; Fri, 30 Dec 2016 10:44:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMzLx-0001q0-Rr for grub-devel@gnu.org; Fri, 30 Dec 2016 10:44:26 -0500 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:35070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cMzLx-0001p2-KN for grub-devel@gnu.org; Fri, 30 Dec 2016 10:44:21 -0500 Received: by mail-lf0-x243.google.com with SMTP id x140so20493574lfa.2 for ; Fri, 30 Dec 2016 07:44:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=loxGglSEzf0enhikyMGsP27pM9MetHwJt9P0S9DplqA=; b=oDcDDNOgF75SQqq4b3IJ08WJ70wdP24HrV+aQjBmMmT/LusuIYrkcunw9G0KhXZDGp ZehgaAO+MLE2HL2N7Eyapx+uCKN4rzaakDICwFE8SPmmDuydGe4G32mx9OsxtwMCXmaL Is7p/f+GHqy2M1+bSZ6R+lKytvfFD9dsM7G5aIPCp/DJ0i48SIOQ8T1weFUpfcaJ+0JK qoMxA/zcAmf9feoblwB7Wnkds0tqMBzeoZ0Q68AlNtoTVZsVTeRkeKOOPTJa2w1ub5Db iP9mUZD67Lc1ogKwQ5cjLCzWswEyqDlDVDF3j0pc2eNRywm/vD0o+3s2kONfD75rfUGX +Z8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=loxGglSEzf0enhikyMGsP27pM9MetHwJt9P0S9DplqA=; b=ff5CJpbzIBz9MGbbtPhbOfcVaYs9IrlhFt/yyhFOH5S2Qrsjc1eAsk4EKlfQP9yHbt MWozjZijxWsZkf8ruN0QS0g5VbTjNo9vNSy/fKgJv0+vQNsWSPzOB8hEqD/SeCUHaevd JQJis+Pxwx37qfwe79BBRutuCLbylidXBlOMbgI6HuQB/I/OoB4EHeLIlCGNvbdovBaQ pVRA5k/mgE/70Huf07UCpcqDTDnXbqx/2K4D0+k2W68gNTnaIKUzzCHPMBXKeYy9sEwD Lx4MgQocJHlMh0k9qvrCAJ9dB6paZQcShVEQRTSOFatyTnS88KAL0IGa1vnqR3pXZttd WstQ== X-Gm-Message-State: AIkVDXLrCdKkFZ2vvNj6vGIAaRn0bie0+19uFvvlsg+BQYOY6j8eqBL1Jx6OMP+K4teIMA== X-Received: by 10.46.21.78 with SMTP id 14mr13806448ljv.52.1483112659733; Fri, 30 Dec 2016 07:44:19 -0800 (PST) Received: from [192.168.1.3] (ppp109-252-90-129.pppoe.spdop.ru. [109.252.90.129]) by smtp.gmail.com with ESMTPSA id h123sm6801276lfh.45.2016.12.30.07.44.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Dec 2016 07:44:18 -0800 (PST) Subject: Re: Build error with clang 4.0 To: grub-devel@gnu.org References: <1482851432.3916.196.camel@users.sourceforge.net> From: Andrei Borzenkov Message-ID: <3132777b-7787-bcaf-adcf-a4b041bd68b4@gmail.com> Date: Fri, 30 Dec 2016 18:44:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1482851432.3916.196.camel@users.sourceforge.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B07f3glSoIgl9QvupC90V3MUJNftqoSru" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::243 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, 30 Dec 2016 15:44:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --B07f3glSoIgl9QvupC90V3MUJNftqoSru Content-Type: multipart/mixed; boundary="MPQmbJuIDdAjMHP6Ouh8f1rGBPPs0WCb4" From: Andrei Borzenkov To: grub-devel@gnu.org Message-ID: <3132777b-7787-bcaf-adcf-a4b041bd68b4@gmail.com> Subject: Re: Build error with clang 4.0 References: <1482851432.3916.196.camel@users.sourceforge.net> In-Reply-To: <1482851432.3916.196.camel@users.sourceforge.net> --MPQmbJuIDdAjMHP6Ouh8f1rGBPPs0WCb4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 27.12.2016 18:10, Paul Menzel =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > Dear GRUB folks, >=20 >=20 > 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 a= n 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= unaligned 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 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. 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. 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). 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 :( --MPQmbJuIDdAjMHP6Ouh8f1rGBPPs0WCb4-- --B07f3glSoIgl9QvupC90V3MUJNftqoSru Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlhmgNEACgkQR6LMutpd94xhNACeM5utBAF14GdZ87+offcXarYm xwsAoKZS7sZyhypKgcdm5/7eJhQfNiR3 =RiKz -----END PGP SIGNATURE----- --B07f3glSoIgl9QvupC90V3MUJNftqoSru--