Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Undefined Reference Issue while compiling
« previous next »
  • Print
Pages: [1]

Author Topic: Undefined Reference Issue while compiling  (Read 4402 times)

Offline srawat_itpro

  • Member
  • *
  • Posts: 6
Undefined Reference Issue while compiling
« on: March 23, 2009, 01:55:14 PM »
Hi RockBoxers,

This is my first post and I'm looking for the resolution of an issue which is bugging me while compiling RockBox

The details are:
Dev Platform: Cygwin on Windows
Dev Tools : GCC 3.3.6 & GLIBC 2.3.2
Target Platform : Motorola EZX (unsupported ARM-LINUX)

I've done all the source changes required for my target. I'm able to compile everything successfully (see make result attached). But always getting some Undefined reference issue which I'm unable to comprehend. I'm using SDL library with RockBox and it seems some symbols are missing. I'm not sure why?

Attached is my MakeFile, conf-file and the result of make.

Any help/pointer in this regard would be helpful.
Note: Have tried excessive googling but found nothing helpful.

Rgds
Sandeep
* makeresult.txt (23.2 kB - downloaded 406 times.)
* Makefile.txt (4.39 kB - downloaded 162 times.)
* autoconf.h (0.42 kB - downloaded 166 times.)
Logged

Offline Domonoky

  • Developer
  • Member
  • *
  • Posts: 205
Re: Undefined Reference Issue while compiling
« Reply #1 on: March 23, 2009, 02:14:49 PM »

please try a "make V=1" this should give you a build output with much more Info. Especially the complete commands which are given to gcc and ld, so you can check if it really points to the right sdl lib.

Another question: This sdl library, has it been crosscompiled for your target ? Maybe something got wrong there, and thats why its missing this symbols ?
Logged

Offline srawat_itpro

  • Member
  • *
  • Posts: 6
Re: Undefined Reference Issue while compiling
« Reply #2 on: March 23, 2009, 02:38:24 PM »
Hi Domonoky,

Thanks for replying so quickly. You actually provided me a pointer.

I file'd one of my .o files and got this.

$ file sysfont.o
sysfont.o: ELF 32-bit LSB relocatable, ARM, version 1, not stripped


then I went into my SDL lib path, i.e. /usr/local/lib and then used ar to extract all .o files in libSDL.a. After doing this I file'd one of them and got this..

$ file SDL.o
SDL.o: MS Windows COFF Intel 80386 object file


Now ... is it that my library file objects in MS Window compat format but the actual so in ARM compat format? Pardon my question but you see I'm not a regular developer but just an enthusiast who want to port RockBox to my Motrola mobile phone...

Is their any place where I can readily downloadable and usable SDL libs?

Thanks & Rgds
Sandeep
Logged

Offline Domonoky

  • Developer
  • Member
  • *
  • Posts: 205
Re: Undefined Reference Issue while compiling
« Reply #3 on: March 23, 2009, 03:15:21 PM »
So the problem is, that your SDL isnt build for arm. So thats why it wont link together..

I dont if there is a ready made SDL lib for Target availiable. You have to search google for this :-)
Logged

Offline srawat_itpro

  • Member
  • *
  • Posts: 6
Re: Undefined Reference Issue while compiling
« Reply #4 on: March 23, 2009, 03:26:09 PM »
Got them here... http://www.crosscompile.org/static/pages/SDL.html  :)

Thanks Your pointer helped..
doing the make now... lets see what happens

Thanks & Rgds
Sandeep

Ooopppsss..my big mouth.... got this in the end

Quote
/opt/crosstool/gcc-3.3.6-glibc-2.3.2/arm-linux/lib/gcc-lib/arm-linux/3.3.6/../../../../arm-linux/bin/ld: ERROR: /opt/external_packages/lib/libSDL.so uses FPA instructions, whereas /work/rockbox/rockbox-20090307/build/rockbox.ezxe6 does not
/opt/crosstool/gcc-3.3.6-glibc-2.3.2/arm-linux/lib/gcc-lib/arm-linux/3.3.6/../../../../arm-linux/bin/ld: ERROR: /opt/external_packages/lib/libSDL.so uses hardware FP, whereas /work/rockbox/rockbox-20090307/build/rockbox.ezxe6 uses software FP
/opt/crosstool/gcc-3.3.6-glibc-2.3.2/arm-linux/lib/gcc-lib/arm-linux/3.3.6/../../../../arm-linux/bin/ld: failed to merge target specific data of file /opt/external_packages/lib/libSDL.so
/opt/crosstool/gcc-3.3.6-glibc-2.3.2/arm-linux/lib/gcc-lib/arm-linux/3.3.6/../../../../arm-linux/lib/crt1.o(.text+0x30): In function `_start':
: undefined reference to `main'

Any idea what is the issue here??

Rgds
Sandeep
« Last Edit: March 23, 2009, 03:32:23 PM by srawat_itpro »
Logged

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Undefined Reference Issue while compiling
« Reply #5 on: March 23, 2009, 04:08:52 PM »
Quote from: srawat_itpro on March 23, 2009, 03:26:09 PM
Any idea what is the issue here??
For ARM targets the recommended compiler is gcc 4.0.3. I could imagine that your older version has issues with that, thus I'd recommend updating to 4.0.3.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline srawat_itpro

  • Member
  • *
  • Posts: 6
Re: Undefined Reference Issue while compiling
« Reply #6 on: March 23, 2009, 04:16:00 PM »
I might be wrong here... but as long as my GCC 3.3.6 has the support for my cpu arch (iwmmxt), there shouldn't be any problems.

I think the iwmmxt arch doesn't support FPA but supports Software VFP. Thus my SDL downloaded from the link above may not help if its is compiled for FPA. Therefore I need to compile SDL with my compiler for my arch iwmmxt.

Let me see...

I'll keep things posted.

Rgds
Sandeep
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Undefined Reference Issue while compiling
« Reply #7 on: March 23, 2009, 04:24:33 PM »
It's not that simple. There are bug fixes and improvement to support over time. Sometimes "support" doesn't even mean "support fully."

We've seen very strange bugs happen (or disappear) by changing compiler versions for the very same target.
Logged

Offline srawat_itpro

  • Member
  • *
  • Posts: 6
Re: Undefined Reference Issue while compiling
« Reply #8 on: March 23, 2009, 04:35:59 PM »
ok...
So I compiled SDL libs for my cpu arch and used the new SDL libs and include in my makefile.

After this I fired the make. Now the previous mentioned error regarding FPA and software FP is gone :) but there is still one last error:
Quote
$ make
LD rockbox.ezxe6
/opt/crosstool/gcc-3.3.6-glibc-2.3.2/arm-linux/lib/gcc-lib/arm-linux/3.3.6/../../../../arm-linux/lib/crt1.o(.text+0x30): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [/work/rockbox/rockbox-20090307/build/rockbox.ezxe6] Error 1


The main() function is not being found. Any idea what needs to be done here?? My makefile is attached.

Rgds
Sandeep


EDIT

Can someone provide some pointers in this regards?

Rgds
Sandeep
* Makefile.txt (4.55 kB - downloaded 231 times.)
« Last Edit: March 24, 2009, 11:10:06 AM by srawat_itpro »
Logged

Offline Domonoky

  • Developer
  • Member
  • *
  • Posts: 205
Re: Undefined Reference Issue while compiling
« Reply #9 on: March 24, 2009, 01:36:37 PM »

This error means, there is no main() function in the code it compiled.
Run "make V=1" to get detailed build output, and check if it really compiles and links app/main.c
Logged

Offline srawat_itpro

  • Member
  • *
  • Posts: 6
Re: Undefined Reference Issue while compiling
« Reply #10 on: March 24, 2009, 04:09:19 PM »
Thanks Domonoky, your suggestion helped and with some more changes I'm able to create the output file.

I have a confusion... When the make enters the LD rockbox.ezxe6 section... it should be using arm-linux-ld for linking... but instead it tries to use arm-linux-gcc as a linker with a command like

Code: [Select]
arm-linux-gcc -o <output name> <object files> -lc -lpthread etc..

This is happening even when in my makefile I have specified

Code: [Select]
export LD=$(TOOLCHAIN_PATH)/bin/arm-linux-ld

Any idea why this starnge behaviour???

Rgds
Sandeep

Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Undefined Reference Issue while compiling
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.087 seconds with 16 queries.