Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Compiling Ogg
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Maik Merten  
View profile  
 More options Mar 9 2008, 12:06 pm
From: Maik Merten <maikmer...@googlemail.com>
Date: Sun, 09 Mar 2008 17:06:41 +0100
Local: Sun, Mar 9 2008 12:06 pm
Subject: Compiling Ogg
Hello,

I'm trying to port some Ogg multimedia codecs to Java with the help of
Cibyl. The first step would be to compile libogg. I'm using following
script to set up crosscompiling:

PATH="/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/bin:$PATH ";
export PATH
CC=mips-unknown-linux-gnu-gcc; export CC
CXX=mips-unknown-linux-gnu-g++; export CXX
AS=mips-unknown-linux-gnu-as; export AS
AR=mips-unknown-linux-gnu-ar; export AR
LD=mips-unknown-linux-gnu-ld; export LD
RANLIB=mips-unknown-linux-gnu-ranlib; export RANLIB
CFLAGS="-Wall -mips1 -mno-check-zero-division -Os -fno-pic -mno-abicalls
-I$CIBYL_BASE/include -I/mnt/data/mips/include"; export CFLAGS
CXXFLAGS="-Wall -mips1 -mno-check-zero-division -Os -fno-pic
-mno-abicalls -I$CIBYL_BASE/include -I/mnt/data/mips/include"; export
CXXFLAGS
LDFLAGS="-march=mips1 -L$CIBYL_BASE/lib/ -L/mnt/data/mips/lib/ -nostdlib
-T$CIBYL_BASE/build/linker.lds --static"; export LDFLAGS

With these things set the configure script for libogg will complete
successfully. The actual build doesn't work that nicely (see build
messages at the end of this mail).

Those undefined reference errors seem to stem from not using the
standard libraries. I very much assume that the standard libraries
cannot be used together with Cibyl, so I wonder how to get around those
errors. Is this caused by e.g. Cibyl not implementing those functions or
by some error on my part?

bye,

Maik

mips-unknown-linux-gnu-gcc -D_V_SELFTEST -O20 -fsigned-char -Wall -mips1
-mno-check-zero-division -Os -fno-pic -mno-abicalls
-I/mnt/data/builds/cibyl-15/include -I/mnt/data/mips/include
-march=mips1 -nostdlib -T/mnt/data/builds/cibyl-15/build/linker.lds
--static -o test_bitwise test_bitwise-bitwise.o
-L/mnt/data/builds/cibyl-15/lib/ -L/mnt/data/mips/lib/
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/bin/ld:
warning: cannot find entry symbol __start; defaulting to 0000000001000000
test_bitwise-bitwise.o(.text+0x14): In function `oggpack_writeinit':
: undefined reference to `memset'
test_bitwise-bitwise.o(.text+0x1c): In function `oggpack_writeinit':
: undefined reference to `malloc'
test_bitwise-bitwise.o(.text+0x118): In function `oggpack_write':
: undefined reference to `realloc'
test_bitwise-bitwise.o(.text+0x278): In function `oggpackB_write':
: undefined reference to `realloc'
test_bitwise-bitwise.o(.text+0x4a4): In function `oggpack_writecopy_helper':
: undefined reference to `realloc'
test_bitwise-bitwise.o(.text+0x4c4): In function `oggpack_writecopy_helper':
: undefined reference to `memmove'
test_bitwise-bitwise.o(.text+0x5f8): In function `oggpack_writeclear':
: undefined reference to `free'
test_bitwise-bitwise.o(.text+0x614): In function `oggpack_writeclear':
: undefined reference to `memset'
test_bitwise-bitwise.o(.text+0x648): In function `oggpack_readinit':
: undefined reference to `memset'
test_bitwise-bitwise.o(.text+0xca4): In function `report':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0xca8): In function `report':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0xcac): In function `report':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0xcb4): In function `report':
: undefined reference to `exit'
test_bitwise-bitwise.o(.text+0xdc0): In function `cliptest':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0xdc8): In function `cliptest':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0xdd8): In function `cliptest':
: undefined reference to `fprintf'
test_bitwise-bitwise.o(.text+0x10fc): In function `cliptestB':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1104): In function `cliptestB':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1114): In function `cliptestB':
: undefined reference to `fprintf'
test_bitwise-bitwise.o(.text+0x193c): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1370): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1378): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1554): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x13a8): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x13ac): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1348): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x13b4): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x13bc): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x13e8): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x13ec): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x13f4): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x13fc): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1428): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x142c): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1434): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x143c): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1510): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1518): In function `main':
: undefined reference to `fprintf'
test_bitwise-bitwise.o(.text+0x1564): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1568): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x156c): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1574): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x157c): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x15a8): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x15ac): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x15b4): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x15bc): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x15e4): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x15e8): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x15f0): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x15f8): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1624): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1628): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1630): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x163c): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1744): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x174c): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x175c): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1764): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1790): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1794): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x179c): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x17a4): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x17d0): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x17d4): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x17dc): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x17e4): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x180c): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1810): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1818): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1820): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x18f8): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1900): In function `main':
: undefined reference to `fprintf'
test_bitwise-bitwise.o(.text+0x194c): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1950): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1954): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x195c): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1964): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x1990): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x1994): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x199c): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x19a4): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x19cc): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x19d0): In function `main':
: undefined reference to `fputs'
test_bitwise-bitwise.o(.text+0x19d8): In function `main':
: undefined reference to `stderr'
test_bitwise-bitwise.o(.text+0x19e0): In function `main':
:
...

read more »


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Kagstrom  
View profile  
 More options Mar 9 2008, 12:22 pm
From: Simon Kagstrom <simon.kagst...@gmail.com>
Date: Sun, 9 Mar 2008 17:22:59 +0100
Local: Sun, Mar 9 2008 12:22 pm
Subject: Re: Compiling Ogg
On Sun, 09 Mar 2008 17:06:41 +0100

Maik Merten <maikmer...@googlemail.com> wrote:
> Those undefined reference errors seem to stem from not using the
> standard libraries. I very much assume that the standard libraries
> cannot be used together with Cibyl, so I wonder how to get around
> those errors. Is this caused by e.g. Cibyl not implementing those
> functions or by some error on my part?

They should all, unless I missed something, be implemented by Cibyl (or
more correctly: the implementation comes from uClibc, NetBSD and some
other sources). The solution is simple: add

  -lc

to the linker command line. I saw you had

> LDFLAGS="-march=mips1 -L$CIBYL_BASE/lib/ -L/mnt/data/mips/lib/ -nostdlib
> -T$CIBYL_BASE/build/linker.lds --static"; export LDFLAGS

and adding it here should do the trick. Just watch out so that there is
no libc.a in /mnt/data/mips/lib/ (I'm not sure what parts are there).

// Simon


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maik Merten  
View profile  
 More options Mar 9 2008, 1:04 pm
From: Maik Merten <maikmer...@googlemail.com>
Date: Sun, 09 Mar 2008 18:04:09 +0100
Local: Sun, Mar 9 2008 1:04 pm
Subject: Re: Compiling Ogg
Simon Kagstrom schrieb:

> They should all, unless I missed something, be implemented by Cibyl (or
> more correctly: the implementation comes from uClibc, NetBSD and some
> other sources). The solution is simple: add

>   -lc

> to the linker command line.

Thanks. This apparently does solve something but will give different
errors (end of this mail). Hmmm... does it try to link to the libc
provided by the mips-unknown-linux-gnu setup?

Once I get a working setup I should better document it on the wiki :)

> Just watch out so that there is
> no libc.a in /mnt/data/mips/lib/ (I'm not sure what parts are there).

Oh, /mnt/data/mips is just the prefix for all MIPS-compiled libraries I
need to cross compile actual applications. There's nothing in there yet.

Maik

mips-unknown-linux-gnu-gcc -D_V_SELFTEST -O20 -fsigned-char -Wall -mips1
-mno-check-zero-division -Os -fno-pic -mno-abicalls
-I/mnt/data/builds/cibyl-15/include -I/mnt/data/mips/include
-march=mips1 -nostdlib -T/mnt/data/builds/cibyl-15/build/linker.lds
--static -o test_bitwise test_bitwise-bitwise.o
-L/mnt/data/builds/cibyl-15/lib/ -L/mnt/data/mips/lib/ -lc
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/bin/ld:
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(exit.o) :
warning: linking PIC files with non-PIC files
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/bin/ld:
warning: cannot find entry symbol __start; defaulting to 0000000001000000
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(exit.o) (.text+0x0):
In function `exit':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(cxa_ate xit.o)(.text+0x0):
In function `__new_exitfn':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(cxa_ate xit.o)(.text+0x164):
In function `__cxa_atexit':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(fprintf .o)(.text+0x0):
In function `fprintf':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(iofputs .o)(.text+0x0):
In function `_IO_fputs':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(malloc. o)(.text+0x0):
In function `malloc_init_state':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(malloc. o)(.text+0x11c):
In function `ptmalloc_lock_all':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(malloc. o)(.text+0x2a0):
In function `ptmalloc_unlock_all':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(malloc. o)(.text+0x3d4):
In function `ptmalloc_unlock_all2':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(malloc. o)(.text+0x510):
In function `munmap_chunk':
: relocation truncated to fit: R_MIPS_HI16 _gp_disp
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(malloc. o)(.text+0x564):
In function `new_heap':
: additional relocation overflows omitted from the output
collect2: ld returned 1 exit status
make[2]: *** [test_bitwise] Error 1
make[2]: Leaving directory `/mnt/data/builds/ogg/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/data/builds/ogg'
make: *** [all] Error 2


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Kagstrom  
View profile  
 More options Mar 9 2008, 1:40 pm
From: Simon Kagstrom <simon.kagst...@gmail.com>
Date: Sun, 9 Mar 2008 18:40:55 +0100
Local: Sun, Mar 9 2008 1:40 pm
Subject: Re: Compiling Ogg
Cool project by the way!

I forgot one thing in the last mail: Also link with -ljava, which is
used by the Cibyl libc.

On Sun, 09 Mar 2008 18:04:09 +0100

Maik Merten <maikmer...@googlemail.com> wrote:
> Thanks. This apparently does solve something but will give different
> errors (end of this mail). Hmmm... does it try to link to the libc
> provided by the mips-unknown-linux-gnu setup?

It looks like it's trying to do that since you have:

> /opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(exit.o) :

which looks like the system libc. Try linking with ld instead, linking
with gcc will typically include some "magic" behind the scenes (compare
to when you link C++ applications with g++, which will automatically
link with libstdc++ and some other needed libraries). ld will not do
this.

You can look in $CIBYL_PATH/build/Rules.mk for how the Cibyl examples
are built (or just build one and look at the output).

> mips-unknown-linux-gnu-gcc -D_V_SELFTEST -O20 -fsigned-char -Wall
> -mips1 -mno-check-zero-division -Os -fno-pic -mno-abicalls
> -I/mnt/data/builds/cibyl-15/include -I/mnt/data/mips/include
> -march=mips1 -nostdlib -T/mnt/data/builds/cibyl-15/build/linker.lds
> --static -o test_bitwise test_bitwise-bitwise.o
> -L/mnt/data/builds/cibyl-15/lib/ -L/mnt/data/mips/lib/ -lc
> /opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/bin/ld:
> /opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(exit.o) :
> warning: linking PIC files with non-PIC files

This is the libc for Linux from your cross-compiler. It's built as
position-independent code ("PIC") and that's why you get those warnings
(Cibyl uses -fno-pic).

> /opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/bin/ld:
> warning: cannot find entry symbol __start; defaulting to
> 0000000001000000 /opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-

__start is defined in $CIBYL_BASE/libs/crt0.o, you should also include
that to get a working binary (again you can take a look in Rules.mk).

> linux-gnu/lib/libc.a(exit.o)(.text+0x0):
> In function `exit':
> : relocation truncated to fit: R_MIPS_HI16 _gp_disp
> /opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/lib/gcc/mips-un known-linux-gnu/3.4.5/../../../../mips-unknown-linux-gnu/lib/libc.a(cxa_ate xit.o)(.text+0x0):

This is once more related to position-independence (or how MIPS
binaries work). MIPS typically assigns a register to use as base for
global data, "GP" as in "Global Pointer". Cibyl again does not use
this, if I remember correctly it comes from -fno-pic.

So to summarise: your build errors are with all likelyhood caused by
linking with gcc :-)

// Simon


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maik Merten  
View profile  
 More options Mar 9 2008, 2:59 pm
From: Maik Merten <maikmer...@googlemail.com>
Date: Sun, 09 Mar 2008 19:59:05 +0100
Local: Sun, Mar 9 2008 2:59 pm
Subject: Re: Compiling Ogg
Hello Simon,

thanks again for your support. This is highly appreciated!

My current setup:

PATH="/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/bin:$PATH ";
export PATH
CC=mips-unknown-linux-gnu-gcc; export CC
CXX=mips-unknown-linux-gnu-g++; export CXX
AS=mips-unknown-linux-gnu-as; export AS
AR=mips-unknown-linux-gnu-ar; export AR
LD="ld"; export LD
RANLIB=mips-unknown-linux-gnu-ranlib; export RANLIB
CFLAGS="-Wall -mips1 -mno-check-zero-division -Os -fno-pic -mno-abicalls
-I$CIBYL_BASE/include -I/mnt/data/mips/include"; export CFLAGS
CXXFLAGS="-Wall -mips1 -mno-check-zero-division -Os -fno-pic
-mno-abicalls -I$CIBYL_BASE/include -I/mnt/data/mips/include"; export
CXXFLAGS
LDFLAGS="-march=mips1 $CIBYL_BASE/libs/crt0.o -L$CIBYL_BASE/libs
-L$CIBYL_BASE/libs/lib -L/mnt/data/mips/lib/ -nostdlib
-T$CIBYL_BASE/build/linker.lds --static -lc -ljava -lcrt0"; export LDFLAGS

Apart from the missing -ljava and -lcrt0 the -L$CIBYL_BASE/lib/ was of
course wrong (it's libs, not lib - perhaps the Hello World example in
the wiki is outdated?).

I think the $CIBYL_BASE/libs/crt0.o is misplaced in LDFLAGS (but
inspired from both the Hello World wiki example and Rules.mk) -
apparently it tries to generate libogg from crt0.o (?), which of course
can only fail. Just using -lcrt0 will result in __start not being found.

As you can easily see my skills with the usual C toolchains are utterly
underdeveloped. How I wished "javac *.java" would work ;-)

Maik

/bin/bash ../libtool --tag=CC   --mode=link mips-unknown-linux-gnu-gcc
-O20 -fsigned-char -Wall -mips1 -mno-check-zero-division -Os -fno-pic
-mno-abicalls -I/mnt/data/builds/cibyl-15/include
-I/mnt/data/mips/include -no-undefined -version-info 5:3:5 -march=mips1
/mnt/data/builds/cibyl-15/libs/crt0.o -L/mnt/data/builds/cibyl-15/libs
-L/mnt/data/builds/cibyl-15/libs/lib -L/mnt/data/mips/lib/ -nostdlib
-T/mnt/data/builds/cibyl-15/build/linker.lds --static -lc -ljava -lcrt0
-o libogg.la -rpath /mnt/data/mips//lib framing.lo bitwise.lo
mkdir .libs
libtool: link: cannot build libtool library `libogg.la' from non-libtool
objects on this host: /mnt/data/builds/cibyl-15/libs/crt0.o
make[2]: *** [libogg.la] Error 1
make[2]: Leaving directory `/mnt/data/builds/ogg/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/data/builds/ogg'
make: *** [all] Error 2


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Kagstrom  
View profile  
 More options Mar 9 2008, 4:44 pm
From: Simon Kagstrom <simon.kagst...@gmail.com>
Date: Sun, 9 Mar 2008 21:44:53 +0100
Local: Sun, Mar 9 2008 4:44 pm
Subject: Re: Compiling Ogg
On Sun, 09 Mar 2008 19:59:05 +0100

Maik Merten <maikmer...@googlemail.com> wrote:
> My current setup:
> LDFLAGS="-march=mips1 $CIBYL_BASE/libs/crt0.o -L$CIBYL_BASE/libs
> -L$CIBYL_BASE/libs/lib -L/mnt/data/mips/lib/ -nostdlib
> -T$CIBYL_BASE/build/linker.lds --static -lc -ljava -lcrt0"; export
> LDFLAGS

Looks good, but as you said crt0.o should perhaps not be in LDFLAGS
(just on the command line where you invoke ld). --static should not be
needed - it's implicit.

> Apart from the missing -ljava and -lcrt0 the -L$CIBYL_BASE/lib/ was of
> course wrong (it's libs, not lib - perhaps the Hello World example in
> the wiki is outdated?).

You're right, that's a bug on the wiki.

> I think the $CIBYL_BASE/libs/crt0.o is misplaced in LDFLAGS (but
> inspired from both the Hello World wiki example and Rules.mk) -
> apparently it tries to generate libogg from crt0.o (?), which of
> course can only fail. Just using -lcrt0 will result in __start not
> being found.

Yes, crt0 should be linked in as a normal object (it's just a small
assembly function __start which calls main(), you have the source in
crt0.S).

> As you can easily see my skills with the usual C toolchains are
> utterly underdeveloped. How I wished "javac *.java" would work ;-)

:-)

OK, this part does not really make sense - I suppose it's from the
autoconf build of libogg. It depends a bit on what you want to do. If
you want to create a libogg.a which you can use from other C programs
translated with Cibyl, you can just use ar to create the archive:

   ar crs libogg.a a.o b.o ...

but I suppose that you in the long run would want to access the ogg
functionality from Java? Note that Cibyl always requires a ELF
executable to translate, i.e., you always have to link together a
"program" even if you just plan to use it as a library.

The second issue is how to call the C functions from Java. The most
reliable way of doing this is through the call table. You can then
provide a Java method which registers C function pointers which can
later be called by Java code through the call table (invoked with the
function address).

// Simon


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maik Merten  
View profile  
 More options Mar 11 2008, 10:25 am
From: Maik Merten <maikmer...@googlemail.com>
Date: Tue, 11 Mar 2008 15:25:41 +0100
Local: Tues, Mar 11 2008 10:25 am
Subject: Re: Compiling Ogg
Simon Kagstrom schrieb:

> On Sun, 09 Mar 2008 19:59:05 +0100
> Maik Merten <maikmer...@googlemail.com> wrote:
>> My current setup:

>> LDFLAGS="-march=mips1 $CIBYL_BASE/libs/crt0.o -L$CIBYL_BASE/libs
>> -L$CIBYL_BASE/libs/lib -L/mnt/data/mips/lib/ -nostdlib
>> -T$CIBYL_BASE/build/linker.lds --static -lc -ljava -lcrt0"; export
>> LDFLAGS

> Looks good, but as you said crt0.o should perhaps not be in LDFLAGS
> (just on the command line where you invoke ld). --static should not be
> needed - it's implicit.

Ah, that's good to know.

> It depends a bit on what you want to do. If
> you want to create a libogg.a which you can use from other C programs
> translated with Cibyl, you can just use ar to create the archive:

>    ar crs libogg.a a.o b.o ...

> but I suppose that you in the long run would want to access the ogg
> functionality from Java? Note that Cibyl always requires a ELF
> executable to translate, i.e., you always have to link together a
> "program" even if you just plan to use it as a library.

At first I only planned to compile libogg so I can satisfy the
requirements of libvorbis and libtheora (there's already a Java port of
libogg, which really is a very very small library).

However, now I think I should perhaps go through the whole "Java 'port'
with Cibyl, complete with Java access" story for libogg - mostly to
discover the interface generation process.

libogg comes with a small test executable, I guess that should qualify
as "program" :-)

> The second issue is how to call the C functions from Java. The most
> reliable way of doing this is through the call table. You can then
> provide a Java method which registers C function pointers which can
> later be called by Java code through the call table (invoked with the
> function address).

Once I actually have a working libogg I'll have a look at this. I was
expecting to have a convenient (set of) "wrapper" class(es) for the
translated libs anyway :-)

Maik


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Kagstrom  
View profile  
 More options Mar 11 2008, 4:33 pm
From: Simon Kagstrom <simon.kagst...@gmail.com>
Date: Tue, 11 Mar 2008 21:33:09 +0100
Local: Tues, Mar 11 2008 4:33 pm
Subject: Re: Compiling Ogg
On Tue, 11 Mar 2008 15:25:41 +0100

Maik Merten <maikmer...@googlemail.com> wrote:
> However, now I think I should perhaps go through the whole "Java
> 'port' with Cibyl, complete with Java access" story for libogg -
> mostly to discover the interface generation process.

Probably good to start small and see that the basics work - it will be
easier to debug that way :-)

Note that the interface generation only goes in the C->Java direction,
the other direction is less well supported.

> libogg comes with a small test executable, I guess that should
> qualify as "program" :-)

Sure. What I meant was just that you need to create an "Executable"
even if you just plan to use it as a library - that's the way Cibyl
works.

// Simon


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google