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




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
| | |-+  "LD rockboxui" makes "bad magic number (not a Mach-O file)"
« previous next »
  • Print
Pages: [1]

Author Topic: "LD rockboxui" makes "bad magic number (not a Mach-O file)"  (Read 2325 times)

Offline totoetlititi

  • Member
  • *
  • Posts: 4
"LD rockboxui" makes "bad magic number (not a Mach-O file)"
« on: September 03, 2006, 02:15:07 PM »
Hi,

I have lot of problems with compiling Rockbox...
I'm using a mac (Os 10.4.7).
I can cross compile Rockbox for my ipod mini 2g, I have no problem, but when I want compile for UIsimulator, I have :

Code: [Select]
LD rockboxui
/usr/bin/ld:~/rockbox-devel/buil-dir/apps/lang.o bad magic number (not a Mach-O file)
/usr/bin/ld: ~/rockbox-devel/buil-dir/apps/language.o bad magic number (not a Mach-O file)
/usr/bin/ld: archive: ~/rockbox-devel/buil-dir/libbitmapsnative.a has no table of contents, add one with ranlib(1) (can't load from it)
/usr/bin/ld: warning multiple definitions of symbol _memset


Why ?
What does it mean ?
(I'm using powerpc-apple-darwin8-gcc-4.0.1)

Thanks !
Logged

Offline Bagder

  • Global Moderator
  • Member
  • *
  • Posts: 1683
    • Daniel's site
Re: "LD rockboxui" makes "bad magic number (not a Mach-O file)"
« Reply #1 on: September 03, 2006, 04:51:32 PM »
It means your ld is very odd, or possibly that you have some sort of mixed build. Have you tried doing a 'make clean' first0
Logged

Offline totoetlititi

  • Member
  • *
  • Posts: 4
Re: "LD rockboxui" makes "bad magic number (not a Mach-O file)"
« Reply #2 on: September 04, 2006, 05:27:53 AM »
Thanks, that's right. A "make clean" solves this problem.

But now I have this :
Code: [Select]
powerpc-apple-darwin8-gcc-4.0.1: unrecognized option '-shared'
/usr/bin/ld: warning multiple definitions of symbol _memset
~/rockbox-devel/buil-dir/libcodec.a(codeclib.o) definition of _memset in section (__TEXT,__text)
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../libSystem.dylib(memset.So) definition of _memset


damned...
Logged

Offline Bagder

  • Global Moderator
  • Member
  • *
  • Posts: 1683
    • Daniel's site
Re: "LD rockboxui" makes "bad magic number (not a Mach-O file)"
« Reply #3 on: September 04, 2006, 05:43:50 AM »
I find it odd that others have managed to do this in the past...

Cut out the -shared option from the Makefile (we need to make configure detect darwin and do this automatically) and remove the definition of memset in the codeclib and retry.
Logged

Offline barrywardell

  • Developer
  • Member
  • *
  • Posts: 119
Re: "LD rockboxui" makes "bad magic number (not a Mach-O file)"
« Reply #4 on: September 04, 2006, 05:45:39 AM »
There's a patch here. It will allow you to build the ui simulator on a mac.
Logged

Offline totoetlititi

  • Member
  • *
  • Posts: 4
Re: "LD rockboxui" makes "bad magic number (not a Mach-O file)"
« Reply #5 on: September 04, 2006, 09:46:25 AM »
It's very strange...
I have applied the patch, and all Makefile which use the flag "-shared" is modified by:
Code: [Select]
ifeq ($(UNAME), Darwin)
SHARED_FLAG=-dynamiclib -Wl,-single_module
else
SHARED_FLAG=-shared
endif


and... I have always this error :
Code: [Select]
powerpc-apple-darwin8-gcc-4.0.1: unrecognized option '-shared'
 ???

The error "multiple definitions of symbol" is for:
_memset
_memcpy
_memmove
_strcmp
_strlen
_memchr
_strcat
_strcpy
_memcmp
in libcodec.a...

I tried to remove all this function in codeclib.c, and now I have :
Code: [Select]
/usr/bin/ld: Undefined symbols:
_main


re-damned... :'(
Logged

Offline totoetlititi

  • Member
  • *
  • Posts: 4
Re: "LD rockboxui" makes "bad magic number (not a Mach-O file)"
« Reply #6 on: September 04, 2006, 11:02:24 AM »
Ok, I finally find the mistake...
Barry, your patch fails to patching the Hunk#3 of apps/codec/Makefile:

Code: [Select]

patching file apps/codecs/Makefile
Hunk #1 succeeded at 12 with fuzz 1.
Hunk #2 succeeded at 85 (offset 1 line).
Hunk #3 FAILED at 101.


I manually modified the line 101, and it works like a charm !

But perhaps you can add in your patch this patch:
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2006-05/0102.shtml
This solves the crashs when exiting uisimulator.

Thanks for all !
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  "LD rockboxui" makes "bad magic number (not a Mach-O file)"
 

  • SMF 2.0.4 | SMF © 2013, Simple Machines
  • XHTML
  • RSS
  • WAP2

Page created in 0.233 seconds with 25 queries.