Embedded Freaks..

November 25, 2010

Cross-Compiling ‘Disko-Demos’ for ARM926EJ-S

Filed under: ARM9, arm926ej-s, embedded-linux — Tags: , — kunilkuda @ 10:04 am

Yes..here we go again with disko-demos application to demonstrate Disko’s capability (See how it looks like for other platforms here, here, and here). Let’s build the ‘disko-demos’ using our cross-compiled libraries.

First download the ‘disko-demos’ application from disko’s GIT repository:

# git clone git://git.diskohq.com/disko-demos.git

Then create this Makefile to make your cross-compiling lifestyle easier (otherwise, there’ll be too much things to type)

# The top directory that contains all of the cross-libraries and tools
TOP_DIR    = $(HOME)/workspace/vicdist
# The directory that contains cross-libraries
HOST_DIR   = $(TOP_DIR)/host
# The installation directory..to be deployed in rootfs
TARGET_DIR = $(TOP_DIR)/target

CROSS_COMPILE ?= $(HOME)/workspace/codesourcery/bin/arm-none-linux-gnueabi-
CXX            = $(CROSS_COMPILE)g++
CXXFLAGS       = -mcpu=arm926ej-s
SCONS          = $(TOP_DIR)/bin/scons

disko-demos:
	CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) PKG_CONFIG_PATH=$(HOST_DIR)/lib/pkgconfig \
	LDFLAGS="-Wl,-rpath-link=$(HOST_DIR)/lib" \
	$(SCONS) prefix=$(TARGET_DIR) install

clean:
	CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) PKG_CONFIG_PATH=$(HOST_DIR)/lib/pkgconfig \
	LDFLAGS="-static -Wl,-rpath-link=$(HOST_DIR)/lib" \
	$(SCONS) -c

The ‘LDFLAGS=-Wl,-rpath=link=$(HOST_DIR)/lib’ is needed to tell the linker where it can find the dynamic libraries that disko framework depends on.

Then you can compile with

# make

The result is installed in $TARGET_DIR. The ‘Disko-Demos’ is installed in $TARGET_DIR/bin/demo. Let’s see what’s the dynamic libraries that it depends:

# arm-none-linux-gnueabi-readelf -d bin/demo |more

Dynamic section at offset 0x2d028 contains 37 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libdisko.so]
 0x00000001 (NEEDED)                     Shared library: [libxml2.so.2]
 0x00000001 (NEEDED)                     Shared library: [libsigc-2.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [libpng14.so.14]
 0x00000001 (NEEDED)                     Shared library: [libfreetype.so.6]
 0x00000001 (NEEDED)                     Shared library: [libcurl.so.4]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libsqlite3.so.0]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x0000000c (INIT)                       0xea0c
 0x0000000d (FINI)                       0x2ef2c
 .......

Ok..So now we can copy the ‘bin/demo’ into rootfs, and copy the dependency shared-libraries into rootfs/lib directory.

Now…let’s hope that it works…**crossing fingers**

About these ads

1 Comment »

  1. [...] See my previous post.. [...]

    Pingback by Testing ‘Disko-Demos’ in LPC3250 « Embedded Freaks.. — November 26, 2010 @ 4:48 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: