Re: Problems building xnu-792
Re: Problems building xnu-792
- Subject: Re: Problems building xnu-792
- From: Kim-Thomas Moeller <email@hidden>
- Date: Sat, 07 May 2005 18:36:28 +0200
Hi Jake,
recently, I have compiled parts from xnu 7.6 on GNU/Linux i386 using gcc
3.3.5 and have run into similar issues.
It seems that your problem has to do with underscore prepending. By
default, gcc (unlike other C compilers) does not prepend underscores to
symbols [1]. Darwin, in contrast, is compiled with leading underscores
[2], although I have not found where that behavior is defined in the
Makefiles.
Now xnu/libkern/Makefile defines _OSCompareAndSwap, _OSDequeueAtomic and
_OSEnqueueAtomic as linker aliases (note the prepended underscore). I
suspect the solution is to add "-fleading-underscore" to CFLAGS (which
is defined in xnu/makedefs/MakeInc.def).
I also encountered the problem that you reported yesterday: My gcc
explicitly needed the "-Wno-pmf-conversions" flag, which enables
pointer-to-member function calls [3]. In other words, the flag is needed
by the IOKit workloop mechanism for calling a method via a pointer to
the object.
Please correct me if I'm wrong. I have not yet tried to compile xnu
under Darwin 8.0 by myself.
Kim
[1] http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
[2] xnu/libsa/c++rem3.c
[3] http://gcc.gnu.org/onlinedocs/gcc/Bound-member-functions.html
Jake Luck wrote:
>
> Got further with the 792 build. It turns out that xnu doesn't like the
> default gcc 4.0, you need to switch to 3.3 using "gcc_select". It is
> nearly working with the compiler binary tool posted here yesterday.
> Good luck. jake
>
> /usr/bin/gcc-3.3 -c -static -g -nostdinc -nostdlib -no-cpp-precomp
> -fno-builtin -finline -fno-keep-inline-functions -msoft-float
> -fsigned-bitfields -arch ppc -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED -O2
> -mcpu=750 -mmultiple -fschedule-insns -DAPPLE -DNeXT -DKERNEL
> -DKERNEL_PRIVATE -DXNU_KERNEL_PRIVATE -DPRIVATE -D__MACHO__=1
> -Dvolatile=__volatile -I. -I/Src/xnu-792/.
> -I/Src/xnu-792/BUILD/obj/EXPORT_HDRS/.
> -I/Src/xnu-792/BUILD/obj/EXPORT_HDRS/osfmk
> -I/Src/xnu-792/BUILD/obj/EXPORT_HDRS/bsd
> -I/Src/xnu-792/BUILD/obj/EXPORT_HDRS/iokit
> -I/Src/xnu-792/BUILD/obj/EXPORT_HDRS/pexpert
> -I/Src/xnu-792/BUILD/obj/EXPORT_HDRS/libkern
> -I/Src/xnu-792/BUILD/obj/EXPORT_HDRS/libsa
> -I/Src/xnu-792/BUILD/obj/EXTERN_HDRS -I/Src/xnu-792/EXTERNAL_HEADERS
> -I/Src/xnu-792/EXTERNAL_HEADERS/bsd
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/version.c -o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/version.o
> /usr/bin/g++-3.3 -nostdlib -static -force_cpusubtype_ALL -Wl,-e,__start
> -Wl,-segalign,0x1000 -Wl,-sectalign,__TEXT,__text,0x1000
> -Wl,-sectalign,__DATA,__common,0x1000 -Wl,-sectalign,__DATA,__bss,0x1000
> -Wl,-sectcreate,__PRELINK,__text,/dev/null
> -Wl,-sectcreate,__PRELINK,__symtab,/dev/null
> -Wl,-sectcreate,__PRELINK,__info,/dev/null -arch ppc
> -Wl,-segaddr,__VECTORS,0x0 -Wl,-segaddr,__HIB,0x7000
> -Wl,-segaddr,__TEXT,0xe000
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./osfmk/RELEASE/osfmk.o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./bsd/RELEASE/bsd.o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./iokit/RELEASE/iokit.o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./pexpert/RELEASE/pexpert.o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./libkern/RELEASE/libkern.o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./libsa/RELEASE/libsa.o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/version.o -o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./mach_kernel.sys -lcc_kext; \
> /usr/bin/strip -S -x
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./mach_kernel.sys -o
> /Src/xnu-792/BUILD/obj/RELEASE_PPC/./mach_kernel;
> ld: Undefined symbols:
> _OSCompareAndSwap
> _OSDequeueAtomic
> _OSEnqueueAtomic
> make[2]: *** [do_build_mach_kernel] Error 1
> make[1]: *** [build_all] Error 2
> make: *** [all] Error 2
> _______________________________________________
> 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
_______________________________________________
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