Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] Problems building SDL, SDL_image, SDL_ttf, SDL_gfx via buildroot-2013.11
Date: Thu, 9 Jan 2014 16:25:17 +0800	[thread overview]
Message-ID: <20140109162517.62cf0114@skate> (raw)
In-Reply-To: <CAGrGpJBkBcVq+N8X2z_mArrzM30Sbq0_m4T4B3hzDaoaZWtoWg@mail.gmail.com>

Hello Peter,

Le Wed, 8 Jan 2014 20:38:10 -0700,
Peter Thompson <peter.macleod.thompson@gmail.com> a ?crit :

> I used the following before cross-compiling my application.   I do have SDL
> on my host so for pkg-config to work, the felabs path has to appear first
> in the path list
> export CROSS_COMPILE=arm-linux-

Unneeded.

> export ARCH=arm

Unneeded.

> export PATH=/usr/local/xtools/arm-unknown-linux-uclibcgnueabi/bin:$PATH

Unneeded, and potentially harmful, as if the order of things in the
PATH is not correct, or the toolchain prefix you use is not correct,
you might end up using directly the external toolchain, instead of
using the toolchain wrappers that Buildroot creates in
output/host/usr/bin.

> export
> PATH=/home/peter/Documents/felabs/sysdev/buildsdl/buildroot-2013.11/output/host/usr/bin:$PATH

This is the only thing that is needed.

> the combo of SDL + SDL_image + SDL_ttf + SDL_gfx using
> arm-linux-g++  -o oz         \
>     /home/peter/Documents/oz3/display/main.cpp    \
>         ....(list of about 10 files)
>     /home/peter/Documents/oz4/keyboard/ttfopen.c        \
>     -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf                   \
>     $(pkg-config --libs --cflags sdl SDL_image SDL_gfx      \
>            SDL_ttf)
> 
> doesn't seem to work.
> 
> The dynamic .so cross-compiles ok

.so ? The command you show above certainly does *not* build a .so. It
builds an application, dynamically linked against the various SD
libraries.

Also, your command is kind of wrong: there is no need to pass -l<foo>
if you're also using pkg-config to get the necessary compiler and
linker flags.

> but has a seg fault part way through when
> running on IGEPv2.   The source is complex so I haven't figured out the
> point of error but I suspect a .so error.   I am preparing a simpler
> version for testing to track it down.

Isn't that a bug in your application? Please do:

	ulimit -c unlimited

on the target, before running your application. It will generate a core
file. Then use it with gdb to get a backtrace of when the segfault
occurred.

If you want us to help on this, then yes please provide a simple test
case that exhibits the problem.

> The static won't cross-compile because for some reason SDL_image.a is
> missing from
> /home/peter/Documents/felabs/sysdev/buildsdl/buildroot-2013.11/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib

Humm, that's a bug. For some reason, our sdl_image package passes
--disable-static. It has had this option passed since the sdl_image
package was introduced in 2008, for an unknown reason. It would worth
removing this --disable-static option and see if it causes a problem or
not (it should not). This would get you SDL_image.a.

> I tried copying SDL_image.a from a different library I had cross-compiled
> from-scratch but that didn't seem to help.

This is potentially dangerous: are you sure you've built this
SDL_image.a manually with the same toolchain? Same floating-point
strategy?

Just removing --disable-static from package/sdl_image/sdl_image.mk
seems like a better idea.

Best regards,

Thomas

-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-01-09  8:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09  3:38 [Buildroot] Problems building SDL, SDL_image, SDL_ttf, SDL_gfx via buildroot-2013.11 Peter Thompson
2014-01-09  8:25 ` Thomas Petazzoni [this message]
     [not found] ` <20140109153734.19dbd074@skate>
2014-01-14 18:29   ` Peter Thompson
2014-01-20 21:26     ` Peter Thompson
2014-01-29  7:39       ` Thomas Petazzoni
2014-01-29  9:08         ` Peter Thompson
2014-01-29  9:17           ` Thomas Petazzoni

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=20140109162517.62cf0114@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox