From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2MyoB/Rn+F/IBgAA0tVLHw (envelope-from ) for ; Fri, 08 Jan 2021 14:11:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iIiWA/Rn+F9RIgAA1q6Kng (envelope-from ) for ; Fri, 08 Jan 2021 14:11:00 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B21A89401BC for ; Fri, 8 Jan 2021 14:10:59 +0000 (UTC) Received: from localhost ([::1]:39000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxsTi-0001be-My for larch@yhetil.org; Fri, 08 Jan 2021 09:10:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxsQd-00083A-5m for guix-devel@gnu.org; Fri, 08 Jan 2021 09:07:47 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:47308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxsQX-00053K-Ti; Fri, 08 Jan 2021 09:07:46 -0500 Received: from localhost (80-110-127-104.cgn.dynamic.surfer.at [80.110.127.104]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 66B0533640EF; Fri, 8 Jan 2021 15:07:38 +0100 (CET) Date: Fri, 8 Jan 2021 15:07:25 +0100 From: Danny Milosavljevic To: Jan Nieuwenhuizen Subject: Re: [bootstrappable] Re: wip-full-source-bootstrap: from a 357-byte `hex0' to 'hello' Message-ID: <20210108150725.591cfd31@scratchpost.org> In-Reply-To: <20210108144347.12d82f90@scratchpost.org> References: <87im8cvdpa.fsf@gnu.org> <36b3777d90af6fa2e1c1778ba183111e@codethink.co.uk> <87lfd5rpr8.fsf@gnu.org> <20210107211058.40e0813a@scratchpost.org> <20210107212324.36bfd236@scratchpost.org> <20210107235208.04835b95@scratchpost.org> <87ble0ueq7.fsf@gnu.org> <20210108144347.12d82f90@scratchpost.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/9D7s+vpt3lx4Mt5Z19ORz86"; protocol="application/pgp-signature"; micalg=pgp-sha512 Received-SPF: none client-ip=85.13.145.193; envelope-from=dannym@scratchpost.org; helo=dd26836.kasserver.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, Paul Sherwood , bootstrappable@freelists.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.45 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: B21A89401BC X-Spam-Score: -2.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: TGweXdQ46cGu --Sig_/9D7s+vpt3lx4Mt5Z19ORz86 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Janneke, I propose to, instead, change mes libc to align stuff malloc returns like t= his: That should fix it. diff --git a/include/stddef.h b/include/stddef.h index a597c9bb..a682d726 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -37,6 +37,10 @@ #endif // !__MESC__ #endif // offsetof =20 +/* TODO: On armhf gcc, max_align_t is 16 Byte big instead. Use that? */ + +typedef double max_align_t; + #endif // ! SYSTEM_LIBC =20 #endif // __MES_STDDEF_H diff --git a/lib/stdlib/malloc.c b/lib/stdlib/malloc.c index f4be4de1..aaf99886 100644 --- a/lib/stdlib/malloc.c +++ b/lib/stdlib/malloc.c @@ -20,6 +20,8 @@ =20 #include #include +#include +#include =20 /* FIXME: We want bin/mes-mescc's x86-linux sha256sum to stay the same. Therfore we cannot remove stdlib/malloc from libc_SOURCES, which is @@ -37,6 +39,8 @@ malloc (size_t size) { if (!__brk) __brk =3D (char *) brk (0); + /* align what we give back. */ + __brk =3D (char*) (((uintptr_t) __brk + sizeof(max_align_t) - 1) & -size= of(max_align_t)); if (brk (__brk + size) =3D=3D -1) return 0; char *p =3D __brk; --Sig_/9D7s+vpt3lx4Mt5Z19ORz86 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl/4Zx0ACgkQ5xo1VCww uqVZRQf/ZvkwAOsshZmY3uuatYZoFbKrgmEtsy5jTF9dMRafk7noPzmuK6pZP7fu EJuQoy1F3mI55fh4pFN48osI3f5BuN9zQifnsJUkwF0LvMftY2qgRth/jNDTJEHt WjTfqooL5mo5mmJHTfh/sWz9wfAyikglpaXVmez9uMlshNTxnPz5YyHow85dhDgd mU5M3ae99Zmmzw8XBi/u0/8t7F/6EBGQWIqek3B0d6xO2LH8bBhT+hWBsrx8p7U1 il8ts1/ALQ6+WDFleCilVnuf0TQkNmB/mqgGOBb2kU2mIh/PPVV0ASJsNbqEa8Mq I8nD4Y7n6MmmrDhEUrCXIXUoqXP51Q== =V/bo -----END PGP SIGNATURE----- --Sig_/9D7s+vpt3lx4Mt5Z19ORz86--