From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: guix-devel@gnu.org, Paul Sherwood <paul.sherwood@codethink.co.uk>,
bootstrappable@freelists.org
Subject: Re: [bootstrappable] Re: wip-full-source-bootstrap: from a 357-byte `hex0' to 'hello'
Date: Fri, 08 Jan 2021 17:15:24 +0100 [thread overview]
Message-ID: <87sg7bmmlf.fsf@gnu.org> (raw)
In-Reply-To: <20210108150725.591cfd31@scratchpost.org> (Danny Milosavljevic's message of "Fri, 8 Jan 2021 15:07:25 +0100")
Danny Milosavljevic writes:
Hi Danny,
> I propose to, instead, change mes libc to align stuff malloc returns like this:
>
> That should fix it.
That's great; I'd like to go test this. Would you like to push to "wip"
when you're ready?
> 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
>
> +/* TODO: On armhf gcc, max_align_t is 16 Byte big instead. Use that? */
> +
> +typedef double max_align_t;
> +
> #endif // ! SYSTEM_LIBC
Is this something you can get more info on, or do we just try it like
this?
> #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 @@
>
> #include <mes/lib.h>
> #include <string.h>
> +#include <stddef.h>
> +#include <stdint.h>
>
> /* 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 = (char *) brk (0);
> + /* align what we give back. */
> + __brk = (char*) (((uintptr_t) __brk + sizeof(max_align_t) - 1) & -sizeof(max_align_t));
> if (brk (__brk + size) == -1)
> return 0;
> char *p = __brk;
Very nice, thanks!!
Janneke
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
next prev parent reply other threads:[~2021-01-08 16:16 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 17:01 wip-full-source-bootstrap: from a 357-byte `hex0' to 'hello' Jan Nieuwenhuizen
2021-01-05 0:49 ` [bootstrappable] " jeremiah
2021-01-05 16:58 ` Pierre Neidhardt
2021-01-06 11:32 ` [bootstrappable] " Ludovic Courtès
2021-01-06 11:46 ` [bootstrappable] " Andrius Štikonas via Development of GNU Guix and the GNU System distribution.
2021-01-06 14:03 ` Orians, Jeremiah (DTMB)
2021-01-14 21:37 ` Ludovic Courtès
2021-01-15 1:27 ` jeremiah
2021-01-21 11:09 ` Ludovic Courtès
2021-01-21 17:52 ` Orians, Jeremiah (DTMB)
2021-01-28 13:40 ` Ludovic Courtès
2021-01-28 13:44 ` Orians, Jeremiah (DTMB)
2021-01-06 14:38 ` [bootstrappable] " Paul Sherwood
2021-01-07 10:43 ` Jan Nieuwenhuizen
2021-01-07 20:10 ` [bootstrappable] " Danny Milosavljevic
2021-01-07 20:23 ` Danny Milosavljevic
2021-01-07 22:52 ` Danny Milosavljevic
2021-01-08 6:25 ` Jan Nieuwenhuizen
2021-01-08 8:05 ` [Tinycc-devel] " arnold
2021-01-08 13:02 ` Jan Nieuwenhuizen
2021-01-08 13:43 ` Danny Milosavljevic
2021-01-08 14:07 ` Danny Milosavljevic
2021-01-08 16:15 ` Jan Nieuwenhuizen [this message]
2021-01-08 18:56 ` Danny Milosavljevic
2021-01-08 21:11 ` Danny Milosavljevic
2021-01-08 22:13 ` Jan Nieuwenhuizen
2021-01-08 7:16 ` [Tinycc-devel] " grischka
2021-01-08 13:25 ` Danny Milosavljevic
2021-01-08 13:36 ` [bootstrappable] Re: [Tinycc-devel] " Orians, Jeremiah (DTMB)
2021-01-08 15:16 ` [Tinycc-devel] [bootstrappable] " Vincent Lefevre
2021-01-08 16:12 ` [Tinycc-devel] [bootstrappable] " Jan Nieuwenhuizen
2021-01-25 22:47 ` ARM Unified Assembly Language - GNU as does some weird stuff Danny Milosavljevic
2021-01-25 23:12 ` [bootstrappable] " Orians, Jeremiah (DTMB)
2021-01-26 1:14 ` Danny Milosavljevic
2021-01-08 0:29 ` wip-full-source-bootstrap: from a 357-byte `hex0' to 'hello' Jan Wielkiewicz
2021-01-20 20:19 ` Timothy Sample
2021-01-25 18:48 ` Efraim Flashner
2021-01-29 7:23 ` [bootstrappable] " Jan Nieuwenhuizen
2021-01-29 10:18 ` andrius--- via Development of GNU Guix and the GNU System distribution.
2021-01-29 16:02 ` Orians, Jeremiah (DTMB)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sg7bmmlf.fsf@gnu.org \
--to=janneke@gnu.org \
--cc=bootstrappable@freelists.org \
--cc=dannym@scratchpost.org \
--cc=guix-devel@gnu.org \
--cc=paul.sherwood@codethink.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.