dyld 2 questions
dyld 2 questions
- Subject: dyld 2 questions
- From: "mm w" <email@hidden>
- Date: Fri, 7 Mar 2008 17:06:33 -0800
#include <stdio.h>
/*
cc -ansi -Wall -O3 -arch i386 -DARCH_X86_64=0 main.c -o main-i386
cc -ansi -Wall -O2 -arch x86_64 -DARCH_X86_64=1 main.c -o main-x86_64
lipo -create -arch i386 main-i386 -arch x86_64 main-x86_64 -o main
*/
/* main.c */
int main(void) {
#if ARCH_X86_64
puts("hello world 64!");
#else
puts("hello world!");
#endif
return 0;
}
/* EOF */
$ ./main-i386
hello world!
$ ./main-x86_64
hello world 64!
$ ./main
hello world 64!
1 - is there a way to know which arch/img has been loaded?
2 - is it possible to force one arch to be loaded rather than the default one?
--
-mmw
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden