Export to GitHub

iphone-dev - issue #145

lib1funcs.asm:670:garbage following instruction


Posted on Jul 11, 2008 by Happy Wombat

What steps will reproduce the problem?

Compile the toolchain against iPhone OS 2.0 mostly following instructions at http://wikee.iphwn.org/howto:toolchain_on_leopard_aspen. (see build-2.0.sh - attached)

What is the expected output? What do you see instead?

Expect a successful build (doesn't everyone :) ?)

I get the following error: ../../../llvm-gcc-4.0-iphone/gcc/config/arm/lib1funcs.asm:670:garbage following instruction -- bls 11f' ../../../llvm-gcc-4.0-iphone/gcc/config/arm/lib1funcs.asm:672:garbage following instruction --beq 12f' make[2]: * [libgcc/./_udivsi3_s.o] Error 1

What version of the product are you using? On what operating system? Running Ubuntu, compiling against iPhone 2.0.

Please provide any additional information below. I've attached a shell script that does all the steps so anyone who's keen to help can see exactly what I'm running.

Attachments

Comment #1

Posted on Jul 17, 2008 by Massive Ox

I have the exact problem! I'm not running on Ubuntu, i'm running on mac osx leopard. Please if anybody know the cause, help.

Comment #2

Posted on Jul 19, 2008 by Massive Kangaroo

The error goes away if branch targets 10f, 11f, 12f are replaced by 1f, 2f, ... (and corresponding 10:, 11:, 12: by 1:, 2:, 3:) Somehow current gcc does not like to jump to targets with two decimals??

With the changes attached as diff file compilation succeeds (did not test this toolchain yet):

Attachments

Comment #3

Posted on Jul 19, 2008 by Happy Wombat

Thanks a lot! That sorted it, the toolchain compiled with no trouble after making the changes.

Comment #4

Posted on Jul 19, 2008 by Massive Ox

thank you sunrise! i've been working on this error for 2 days! i knew it has something to do with this file but couldn't figure it out, i'm not so good with asm. thank you once more!

Comment #5

Posted on Jul 19, 2008 by Massive Kangaroo

You are welcome! - Just checked: gas (gnu assembler) manual "local labels" actually has a restriction for numeric local labels from 0 to 9 (at least for the version i looked into).

Comment #6

Posted on Jul 22, 2008 by Quick Hippo

Applying the patch file allowed me to continue the build. Many Thanks!

Comment #7

Posted on Aug 24, 2008 by Happy Ox

where did you all apply this patch? (as in file location)

Comment #8

Posted on Nov 8, 2008 by Grumpy Rhino

many thanks.

Comment #9

Posted on Jul 5, 2009 by Helpful Panda

I had this error and applied the patch. I got past the error but have arrived at another:

/usr/local/bin/arm-apple-darwin-ld: /usr/local/share/iphone-filesystem/usr/lib/libc.dylib unknown flags (type) of section 4 (__TEXT,__dof_magmalloc) in load command 0

I have no idea how to fix this at all :(

Comment #10

Posted on Sep 5, 2009 by Swift Wombat

Sorry, but i've never used anything like this before. (asm.diff) Can anybody tell me, how can i use it to fix this problem?

Comment #11

Posted on Oct 14, 2009 by Helpful Wombat

To apply the patch, go into the directory

[...etc...]/iphone-dev/llvm-gcc-4.0-iphone/gcc/config/arm

then issue command (assuming you saved the .diff file into /tmp)

patch -p0 < /tmp/lib1funcs.asm.diff

if it works, you will get a message like

patching file lib1funcs.asm

..however, after that, I'm at the same point as the poster above,

/usr/local/bin/arm-apple-darwin-ld: /usr/local/share/iphone-filesystem/usr/lib/libc.dylib unknown flags (type) of section 4 (__TEXT,__dof_magmalloc) in load command 0 collect2: ld returned 1 exit status make[2]: * [libgcc_s.dylib] Error 1 make[1]: * [stmp-multilib] Error 2 make: * [all-gcc] Error 2

I did notice that there was a newer toolchain llvm-gcc-4.2-iphone -- gonna try that one next.

Status: New

Labels:
Type-Defect Priority-Medium