• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Link errors on dyld_stub_binding_helper, multiple definitions of __start
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Link errors on dyld_stub_binding_helper, multiple definitions of __start


  • Subject: Re: Link errors on dyld_stub_binding_helper, multiple definitions of __start
  • From: Eric Albert <email@hidden>
  • Date: Fri, 24 Nov 2006 00:58:57 -0500

On Nov 24, 2006, at 12:44 AM, abstract water wrote:

Hi, I am using Tiger, Xcode 2.3, gcc 4.01 and I am porting some C
sources to OS X, except that I'm stuck at the link phase. Compilation
succeeds with the following:

gcc $(CFLAGS) -c main.c -o main.o
gcc $(CFLAGS) -fverbose-asm -S main.c -o main.S

CFLAGS = -s -Os -Wall -fprofile-arcs -fpack-struct -fno-common
-ffast-math -ffloat-store -fno-strict-aliasing -fno-align-functions
-fno-align-labels -fno-align-loops -fno-align-jumps
-fsingle-precision-constant
-F/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks

However, the link command fails with the error below

gcc -s -Os -Wall -fprofile-arcs -fpack-struct -fno-common  -ffast-math
-ffloat-store -fno-strict-aliasing -fno-align-functions
-fno-align-labels -fno-align-loops -fno-align-jumps
-fsingle-precision-constant -nostdlib -nodefaultlibs -nostartfiles
main.o -lpthread /Library/Frameworks/SDL.framework/Versions/A/SDL
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL -lgcc -o
intro

Unless you really, really, really know what you're doing and you're willing to change what you're doing for every different release of either Mac OS X or gcc, don't use -nostdlib, -nodefaultlibs, or - nostartfiles. If you use those flags, you have to know exactly which set of system libraries is required for your particular set of compiler options, developer tools, and OS target. That information isn't documented.


If you remove those flags (and don't use -lcrt1.o), you won't have any trouble with dyld_stub_binding_helper or _start.

Hope this helps,
Eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Re: Link errors on dyld_stub_binding_helper, multiple definitions of __start
      • From: "abstract water" <email@hidden>
References: 
 >Link errors on dyld_stub_binding_helper, multiple definitions of __start (From: "abstract water" <email@hidden>)

  • Prev by Date: Link errors on dyld_stub_binding_helper, multiple definitions of __start
  • Next by Date: Re: Re: Link errors on dyld_stub_binding_helper, multiple definitions of __start
  • Previous by thread: Link errors on dyld_stub_binding_helper, multiple definitions of __start
  • Next by thread: Re: Re: Link errors on dyld_stub_binding_helper, multiple definitions of __start
  • Index(es):
    • Date
    • Thread