Re: #define __linux__

Kenneth Johansson (ken@canit.se)
Mon, 24 Aug 1998 01:31:05 +0200


Geert Uytterhoeven wrote:

> > Anyway if I change the spec file and some minor things in the kernel source it at
> > least compiles and builds a vmlinux object. Its probably a few weeks before I can
> > say if it really works. Have to write some boot code first.
>
> Last time I used my PPC cross compiler on the Pentium, I didn't have to add
> anything special. The compiler is called ppc-linux-elf-gcc and works without
> twiddling with any config files. Just don't forget to add `ARCH=ppc' to all
> your make commands, e.g.
>
> make ARCH=ppc zImage
>
> What kernel version were you trying to compile? For Linux/PPC, the tree at
> vger.rutgers.edu is your friend.
>

I use the vger verison. Is there any easy way to spot the difference apart from doing a
diff and trying to figure it out ?
I compile for CONFIG_MBX and I had to change one line in ppc/setup.c, Inside an ifdef
config_mbx is a declaration of an extern thats not extern anymore. shell script offset
an size is not working with a cross compiling environment.The included mbx_defconfig
hasCONFIG_VGA_CONSOLE=y. That can't be right. And the last stage of zImage creation
breaks.

this is how it looks when it breaks. I don't now were to start looking for this error.

----------------------------------------

make[1]: Entering directory `/home/ken/src/vger/linux/arch/ppc/coffboot'
powerpc-eabi-objcopy -S -O binary /home/ken/src/vger/linux/vmlinux vmlinux
gzip -vf9 vmlinux
vmlinux: 58.3% -- replaced with vmlinux.gz
make[1]: Leaving directory `/home/ken/src/vger/linux/arch/ppc/coffboot'
make[1]: Entering directory `/home/ken/src/vger/linux/arch/ppc/boot'
ppc-linux-elf-ld -T ../vmlinux.lds -Ttext 0x00100000 -o zvmlinux.tmp head.o misc.o
../coffboot/zlib.o mbxtty.o
ppc-linux-elf-objcopy -O elf32-powerpc -R .comment
--add-section=image=../coffboot/vmlinux.gz \
zvmlinux.tmp zvmlinux
ppc-linux-elf-gcc -D__KERNEL__ -I/home/ken/src/vger/linux/include -O2 -DSTDC_HEADERS
-fno-builtin -I/home/ken/src/vger/linux/include -DCONFIG_MBX -DINITRD_OFFSET=0
-DINITRD_SIZE=0 \
-DZIMAGE_OFFSET=`sh offset zvmlinux image` \
-DZIMAGE_SIZE=`sh size zvmlinux image` -DKERNELBASE= \
-c -o misc.o misc.c
ppc-linux-elf-ld -T ../vmlinux.lds -Ttext 0x00100000 -o zvmlinux.tmp head.o misc.o
../coffboot/zlib.o mbxtty.o
ppc-linux-elf-objcopy -O elf32-powerpc -R .comment
--add-section=image=../coffboot/vmlinux.gz \
zvmlinux.tmp zvmlinux
rm zvmlinux.tmp
ppc-linux-elf-gcc -D__KERNEL__ -I/home/ken/src/vger/linux/include -O2 -DSTDC_HEADERS
-fno-builtin -I/home/ken/src/vger/linux/include -DCONFIG_MBX mkprep.c -o mkprep
/usr/local/ppc-linux-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to
01800074
/tmp/ccQSMG5s.o: In function `main':
/tmp/ccQSMG5s.o(.text+0x72): undefined reference to `stderr'
/tmp/ccQSMG5s.o(.text+0x76): undefined reference to `stderr'
/tmp/ccQSMG5s.o(.text+0x88): undefined reference to `fprintf'
/tmp/ccQSMG5s.o(.text+0x94): undefined reference to `exit'
/tmp/ccQSMG5s.o(.text+0xa8): undefined reference to `strcmp'
/tmp/ccQSMG5s.o(.text+0xd0): undefined reference to `strcmp'
/tmp/ccQSMG5s.o(.text+0xf8): undefined reference to `strcmp'
... more of the same
-------------------------------

I hope Iam not supposed to link to a c library. Whats the deal with making all boot
images when one is needed. I don't really need this I guess as long as the vmlinuz image
is OK. I have to write my own bootstrap anyway its just easier to copy from already
working stuff.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html