Re: Link errors on dyld_stub_binding_helper, multiple definitions of __start
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