All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] sandbox on FreeBSD
Date: Tue, 10 Feb 2015 08:34:42 -0700	[thread overview]
Message-ID: <CAPnjgZ3t6tzhhMzNyvmOs8f61X3ChY6_sUZYiqnmcDh=q=djcg@mail.gmail.com> (raw)
In-Reply-To: <54D940D1.1050507@myspectrum.nl>

Hi Jeroen,

On 9 February 2015 at 16:20, Jeroen Hofstee <jeroen@myspectrum.nl> wrote:
> Hello Simon,
>
> On 02/07/15 16:10, Simon Glass wrote:
>>
>>
>>>
>>> I am not giving up, I think it is sane if a tool which adds a header and
>>> a checksum does not use linker magic.  Sandbox biggest problem is
>>> not the linking, but the fact that linux headers and std* are included,
>>> it is a different topic.
>>
>> This should be easy to fix in os.c since all the inclusions are
>> isolated to there. I'd been keen to see a patch for that. Also if you
>> want LCD support, sdl.c.
>
>
> I had a look at this and hacked my way through and linked it
> with a GNU ld (GNU Binutils) 2.25. So at least I have a binary, but
> unfortunately it doesn't work, and errors out with:
>
> Fatal error 'Can't allocate initial thread' at line 350 in file
> /usr/src/lib/libthr/thread/thr_init.c (errno = 2)
>
>
> The reason for this seems to be void _thread_init_hack(void) __attribute__
> ((constructor));
> which calls _libpthread_init -> _thr_alloc -> calloc and that calls the
> version
> in u-boots version of dl-malloc which is not initialized yet.
>
>
> Did you encounter such problems on linux as well? Or does libpthread simply
> not allocate memory before reaching main?

No I see no such problem but I can understand why it might happen.

There is a USE_DL_PREFIX in malloc.h which might fix the naming clash.
U-Boot sandbox uses mmap() to allocate memory from the OS.

It may be worth sending a patch even if you are not quite there?

I suspect we can adjust the Makefile to use U-Boot's internal malloc()
only for U-Boot and not for the libraries it uses. I've done that sort
of thing before and remember it being a little painful.

>
>
> Regards,
> Jeroen
>
>
> ldd ../u-boot-build/u-boot
> ../u-boot-build/u-boot:
> librt.so.1 => /usr/lib/librt.so.1 (0x800896000)
> libSDL-1.2.so.0 => /usr/local/lib/libSDL-1.2.so.0 (0x800a9c000)
> libthr.so.3 => /lib/libthr.so.3 (0x800d02000)
> libc.so.7 => /lib/libc.so.7 (0x800f27000)
> libm.so.5 => /lib/libm.so.5 (0x8012d0000)
> libvgl.so.6 => /usr/lib/libvgl.so.6 (0x8014f8000)
> libaa.so.1 => /usr/local/lib/libaa.so.1 (0x801701000)
> libusbhid.so.4 => /usr/lib/libusbhid.so.4 (0x801919000)
> libncurses.so.8 => /lib/libncurses.so.8 (0x801b1d000)
>

Regards,
Simon

      reply	other threads:[~2015-02-10 15:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 19:37 [U-Boot] recent tools on FreeBSD Jeroen Hofstee
2015-02-05  3:34 ` Simon Glass
2015-02-05  7:07   ` Jeroen Hofstee
2015-02-05 12:37   ` Guilherme Maciel Ferreira
2015-02-05 12:27 ` Guilherme Maciel Ferreira
2015-02-05 19:51   ` Jeroen Hofstee
2015-02-06  3:05     ` Simon Glass
2015-02-06 19:56       ` Jeroen Hofstee
2015-02-06 20:40         ` Andreas Bießmann
2015-02-06 21:00           ` Simon Glass
2015-02-07 10:04             ` Jeroen Hofstee
2015-02-07 15:10               ` Simon Glass
2015-02-07 16:23                 ` Andreas Bießmann
2015-02-07 16:29                   ` Simon Glass
2015-02-07 17:08                     ` Andreas Bießmann
2015-02-07 17:19                       ` Simon Glass
2015-02-07 21:19                       ` [U-Boot] [RFC PATCH] tools/imagetool: remove linker generated list Andreas Bießmann
2015-02-07 21:38                         ` Jeroen Hofstee
2015-02-08  0:05                         ` Guilherme Maciel Ferreira
2015-02-10 15:01                         ` Simon Glass
2015-02-07 20:17                 ` [U-Boot] recent tools on FreeBSD Jeroen Hofstee
2015-02-07 21:02                   ` Simon Glass
2015-02-08 10:03                     ` Jeroen Hofstee
2015-02-10 14:52                       ` Simon Glass
2015-02-09 23:20                 ` [U-Boot] sandbox " Jeroen Hofstee
2015-02-10 15:34                   ` Simon Glass [this message]

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='CAPnjgZ3t6tzhhMzNyvmOs8f61X3ChY6_sUZYiqnmcDh=q=djcg@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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.
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.