Weird link error "illegal text-relocation to pointer-to-literal-cstring"
Weird link error "illegal text-relocation to pointer-to-literal-cstring"
- Subject: Weird link error "illegal text-relocation to pointer-to-literal-cstring"
- From: Jens Alfke <email@hidden>
- Date: Fri, 02 Dec 2011 09:18:07 -0800
I’ve got a small new project that produces a Foundation-level framework. It builds and runs fine in debug mode, but when I use the Archive command to produce a release version, I get a link error I’ve never seen before: "illegal text-relocation to pointer-to-literal-cstring”. Anyone know what this means and how to fix it?
Ld build/ToyCouch/ArchiveIntermediates/Framework/IntermediateBuildFilesPath/ToyCouch.build/Release/ToyCouch.build/Objects-normal/i386/ToyCouch normal i386
cd /Volumes/HardDisk/Couchbase/ToyCouch
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Developer/usr/bin/clang -arch i386 -dynamiclib -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Volumes/HardDisk/Couchbase/ToyCouch/build/ToyCouch/ArchiveIntermediates/Framework/BuildProductsPath/Release -F/Volumes/HardDisk/Couchbase/ToyCouch/build/ToyCouch/ArchiveIntermediates/Framework/BuildProductsPath/Release -filelist /Volumes/HardDisk/Couchbase/ToyCouch/build/ToyCouch/ArchiveIntermediates/Framework/IntermediateBuildFilesPath/ToyCouch.build/Release/ToyCouch.build/Objects-normal/i386/ToyCouch.LinkFileList -install_name /Library/Frameworks/ToyCouch.framework/Versions/A/ToyCouch -mmacosx-version-min=10.7 -dead_strip -framework Foundation -lsqlite3 -single_module -compatibility_version 1 -current_version 1 -o /Volumes/HardDisk/Couchbase/ToyCouch/build/ToyCouch/ArchiveIntermediates/Framework/IntermediateBuildFilesPath/ToyCouch.build/Release/ToyCouch.build/Objects-normal/i386/ToyCouch
ld: illegal text-relocation to pointer-to-literal-cstring in /Volumes/HardDisk/Couchbase/ToyCouch/build/ToyCouch/ArchiveIntermediates/Framework/IntermediateBuildFilesPath/ToyCouch.build/Release/ToyCouch.build/Objects-normal/i386/ToyDB.o from -[ToyDB initWithPath:] in /Volumes/HardDisk/Couchbase/ToyCouch/build/ToyCouch/ArchiveIntermediates/Framework/IntermediateBuildFilesPath/ToyCouch.build/Release/ToyCouch.build/Objects-normal/i386/ToyDB.o for architecture i386
Command /Developer/usr/bin/clang failed with exit code 1
The method referred to in the error is an empty initializer that just calls super. Its disassembly looks like:
"-[ToyDB initWithPath:]": ## @"\01-[ToyDB initWithPath:]"
Ltmp2:
.cfi_startproc
Lfunc_begin0:
.loc 1 25 0 ## /Volumes/HardDisk/Couchbase/ToyCouch/Source/ToyDB.m:25:0
## BB#0:
pushl p
Ltmp3:
.cfi_def_cfa_offset 8
Ltmp4:
.cfi_offset p, -8
movl %esp, p
Ltmp5:
.cfi_def_cfa_register p
subl $24, %esp
##DEBUG_VALUE: -[ToyDB initWithPath:]:self <- EBP+4294967295
##DEBUG_VALUE: -[ToyDB initWithPath:]:_cmd <- EBP+4294967294
##DEBUG_VALUE: -[ToyDB initWithPath:]:path <- EBP+4294967293
movl 8(p), x
.loc 1 26 5 prologue_end ## /Volumes/HardDisk/Couchbase/ToyCouch/Source/ToyDB.m:26:5
Ltmp6:
movl x, -8(p)
movl L_OBJC_CLASS_ToyDB+4, x
movl x, -4(p)
movl L_OBJC_SELECTOR_REFERENCES_, x
movl x, 4(%esp)
leal -8(p), x
movl x, (%esp)
calll _objc_msgSendSuper
.loc 1 36 5 ## /Volumes/HardDisk/Couchbase/ToyCouch/Source/ToyDB.m:36:5
addl $24, %esp
popl p
ret
Ltmp7:
Lfunc_end0:
.file 12 "/Volumes/HardDisk/Couchbase/ToyCouch/vendor/fmdb/src/FMDatabase.h"
.file 13 "/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSSet.h"
Ltmp8:
.cfi_endproc
Leh_func_end0:
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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