ppc crosscompilation, missing headers
Hi all,
I'm trying to crosscompile xenomai 2.3.1 for the ppc-architecture. My commands are like this: (using latest denx ELDK)
export ARCH=ppc
export CROSS_COMPILE=ppc_8xx-
scripts/prepare-kernel.sh --arch=ppc --linux=/home/piie/toolchains/ppc-4.1/ppc_8xx/usr/src/linux/ --adeos=ksrc/arch/powerpc/patches/adeos-ipipe-2.6.18-ppc-1.5-01.patch
cd bla/usr/src/linux/
make TQM8260_defconfig
make menuconfig
make uImage
Everything is working so far and the kernel with built in xenomai boots flawless. (dmesg reports xenomai is working)
When trying to crosscompile the xenomai libs and so on, the configure step is working correctly.
./configure -host=ppc-linux
But the make fails because of missing headers:
[..]
error: asm/errno.h: No such file or directory
[..]
error: asm/param.h: No such file or directory
[..]
I took a look at the kernel/include/asm-ppc/ folder and actually these headers are missing. But they do exist for the "powerpc" architecture. So I just copied all missing headers from asm-powerpc/ to asm-ppc/ to try if the xenomai userspace things can be compiled. It worked. But I think that is not the way it has to be done.
Does anybody know why these headers are missing in asm-ppc? Do I have to install some kind of BSP-kernel-patch for my specific board? Why are these headers available for powerpc?
And btw, maybe someone of you knows, why are there 2 architectures for the powerpc architecture in the kernel tree?
thanks for your help,
--peter
Quoted 7 lines · Peter Feuerer
Hi all,
I'm trying to crosscompile xenomai 2.3.1 for the ppc-architecture. My commands are like this: (using latest denx ELDK)
export ARCH=ppc
export CROSS_COMPILE=ppc_8xx-
Quoted 6 lines
scripts/prepare-kernel.sh--arch=ppc --linux=/home/piie/toolchains/ppc-4.1/ppc_8xx/usr/src/linux/ --adeos=ksrc/arch/powerpc/patches/adeos-ipipe-2.6.18-ppc-1.5-01.patchcd bla/usr/src/linux/
makeTQM8260_defconfig
Hm, ppc_8xx is not the right tool-chain for this board. Please use ppc_6xx instead.
Quoted 18 lines
make menuconfig
make uImageEverything is working so far and the kernel with built in xenomai boots flawless. (dmesg reports xenomai is working)
When trying to crosscompile the xenomai libs and so on, the configure step is working correctly.
./configure -host=ppc-linux
But the make fails because of missing headers:
[..]
error:asm/errno.h: No such file or directory
[..]
error:asm/param.h: No such file or directory
[..]
Quoted 5 lines
I took a look at the
kernel/include/asm-ppc/folder and actually these headers are missing. But they do exist for the "powerpc" architecture. So I just copied all missing headers from asm-powerpc/ to asm-ppc/ to try if the xenomai userspace things can be compiled. It worked. But I think that is not the way it has to be done.
Of course not and I'm also surprised that it fixed your problem.
Quoted 3 lines
Does anybody know why these headers are missing in asm-ppc? Do I have to install some kind of BSP-kernel-patch for my specific board? Why are these headers available for powerpc?
No, when compiling for "ppc", the include files in "asm-powerpc" are included as well.
Quoted 2 lines
And btw, maybe someone of you knows, why are there 2 architectures for the powerpc architecture in the kernel tree?
Traditionally, there was the "arch/ppc" tree for 32-bit PowerPC and "arch/ppc64" for 64-bit PowerPC. Both are merged already since a while into the new tree "arch/powerpc" ... and the old trees will become obsolete sooner than later.
Concerning your problem, I'm unable to reproduce it on my setup. What exact version of the ELDK do you use.
Wolfgang.
Hi Wolfgang,
Quoted 3 lines · Wolfgang Grandegger
Hm,
ppc_8xxis not the right tool-chain for this board. Please useppc_6xxinstead.
Yes, you are right, i was using the wrong one. Now I installed the toolchain for 6xx and use the env-variable:
export CROSS_COMPILE=ppc_82xx-
- kernel compiled as before and is booting (again configured with the xenomai prepare script and the adeos patch)
But when compiling xenomai, still the same issue.
Quoted 15 lines
Quoted 9 lines
./configure -host=ppc-linux
But the make fails because of missing headers:
[..]
error:asm/errno.h: No such file or directory
[..]
error:asm/param.h: No such file or directory
[..]Quoted 5 lines
I took a look at the
kernel/include/asm-ppc/folder and actually these headers are missing. But they do exist for the "powerpc" architecture. So I just copied all missing headers from asm-powerpc/ to asm-ppc/ to try if the xenomai userspace things can be compiled. It worked. But I think that is not the way it has to be done.
Quoted 8 lines
Of course not and I'm also surprised that it fixed your problem.
Quoted 3 lines
Does anybody know why these headers are missing in asm-ppc? Do I have to install some kind of BSP-kernel-patch for my specific board? Why are these headers available for powerpc?
No, when compiling for "ppc", the include files in "asm-powerpc" are included as well.
it does not seem like that :-(
Quoted 8 lines
Quoted 3 lines
And btw, maybe someone of you knows, why are there 2 architectures for the powerpc architecture in the kernel tree?
Traditionally, there was the "
arch/ppc" tree for 32-bit PowerPC and "arch/ppc64" for 64-bit PowerPC. Both are merged already since a while into the new tree "arch/powerpc" ... and the old trees will become obsolete sooner than later.
Thanks for this information having ppc and powerpc is little confusing.
Quoted 2 lines
Concerning your problem, I'm unable to reproduce it on my setup. What exact version of the ELDK do you use.
I'm using the ELDK 4.1 Toolchain (ppc-2007-01-19.iso)
The complete log is attached.
--peter
mount -o loop ppc-2007-01-19.iso /mnt/tmp
cd ppc_6/mnt/tmp/install ppc_6xx
export CROSS_COMPILE=ppc_82xx-
export ARCH=ppc
PATH=$PATH:$(pwd)/usr/bin:$(pwd)/bin
cd ppc_82xx/usr/src/
tar xfj ~/linux-2.6.19.tar.bz2
rm linux
ln -s linux-2.6.19 linux
cd linux
make TQM8260_defconfig
make menuconfig #(nothing changed, just saved and exited)
cd ..
tar xfj ~/xenomai-2.3.1.tar.bz2
cd xenomai-2.3.1scripts/prepare-kernel.sh --arch=ppc --linux=../linux/ --adoes=ksrc/arch/powerpc/patches/adeos-ipipe-2.6.19-ppc-1.5-01.patch cd ../linux
make menuconfig #(checked if xenomai is enabled to be built in, saved and exited)
make uImage
cd ../xenomai-2.3.1
./configure --host=ppc-linux
make
crosscompile:~/toolchains/ppc_6/ppc_82xx/usr/src/xenomai-2.3.1 # make
Making all in src
make[1]: Entering directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src'
Making all in include
make[2]: Entering directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src/include'
make all-am
make[3]: Entering directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src/include'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src/include'
make[2]: Leaving directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src/include'
Making all in skins
make[2]: Entering directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src/skins'
Making all in native
make[3]: Entering directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src/skins/native'
if /bin/sh ../../../libtool --tag=CC --mode=compile ppc-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../../../src/include -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../../include -MT libnative_la-alarm.lo -MD -MP -MF ".deps/libnative_la-alarm.Tpo" -c -o libnative_la-alarm.lo test -f 'alarm.c' || echo './'alarm.c; \
then mv -f ".deps/libnative_la-alarm.Tpo" ".deps/libnative_la-alarm.Plo"; else rm -f ".deps/libnative_la-alarm.Tpo"; exit 1; fi
ppc-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../../../src/include -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../../include -MT libnative_la-alarm.lo -MD -MP -MF .deps/libnative_la-alarm.Tpo -c alarm.c -fPIC -DPIC -o .libs/libnative_la-alarm.o
In file included from /root/toolchains/ppc_6/usr/../ppc_82xx/usr/include/bits/errno.h:25,
from /root/toolchains/ppc_6/usr/../ppc_82xx/usr/include/errno.h:36,
from ../../../include/nucleus/types.h:32,
from ../../../include/nucleus/queue.h:24,
from ../../../include/nucleus/timer.h:23,
from ../../../include/native/alarm.h:25,
from alarm.c:20:
/root/toolchains/ppc_6/usr/../ppc_82xx/usr/include/linux/errno.h:4:23: error: asm/errno.h: No such file or directory
In file included from ../../../src/include/asm/xenomai/system.h:145,
from ../../../include/nucleus/types.h:39,
from ../../../include/nucleus/queue.h:24,
from ../../../include/nucleus/timer.h:23,
from ../../../include/native/alarm.h:25,
from alarm.c:20:../../../include/nucleus/system.h:25:23: error: asm/param.h: No such file or directory make[3]: *** [libnative_la-alarm.lo] Error 1
make[3]: Leaving directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src/skins/native' make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src/skins' make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/toolchains/ppc_6/ppc_6xx/usr/src/xenomai-2.3.1/src'
make: *** [all-recursive] Error 1 crosscompile:~/toolchains/ppc_6/ppc_82xx/usr/src/xenomai-2.3.1 #
Dear Peter,
Quoted 2 lines · in message <[email protected]> you wrote:
But when compiling xenomai, still the same issue.
Please see FAQ 14.1.4. ELDK Include Files Missing
http://www.denx.de/wiki/view/DULG/ELDKIncludeFilesMissing
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Another dream that failed. There's nothing sadder. -- Kirk, "This side of Paradise", stardate 3417.3
Quoted 39 lines · Peter Feuerer
Hi Wolfgang,
Quoted 1 line · Wolfgang Grandegger
Hm,
ppc_8xxis not the right tool-chain for this board. Please useppc_6xxinstead.Yes, you are right, i was using the wrong one. Now I installed the toolchain for 6xx and use the env-variable:
export CROSS_COMPILE=ppc_82xx-- kernel compiled as before and is booting (again configured with the xenomai prepare script and the adeos patch)
But when compiling xenomai, still the same issue.
Quoted 14 lines
Quoted 9 lines
./configure -host=ppc-linux
But the make fails because of missing headers:
[..]
error:asm/errno.h: No such file or directory
[..]
error:asm/param.h: No such file or directory
[..]Quoted 5 lines
I took a look at the
kernel/include/asm-ppc/folder and actually these headers are missing. But they do exist for the "powerpc" architecture. So I just copied all missing headers from asm-powerpc/ to asm-ppc/ to try if the xenomai userspace things can be compiled. It worked. But I think that is not the way it has to be done.Quoted 6 lines
Of course not and I'm also surprised that it fixed your problem.
Quoted 3 lines
Does anybody know why these headers are missing in asm-ppc? Do I have to install some kind of BSP-kernel-patch for my specific board? Why are these headers available for powerpc?
No, when compiling for "ppc", the include files in "asm-powerpc" are included as well.
it does not seem like that :-(
Quoted 2 lines
Quoted 2 lines
And btw, maybe someone of you knows, why are there 2 architectures for the powerpc architecture in the kernel tree?
Quoted 7 lines
Quoted 1 line
Traditionally, there was the "
arch/ppc" tree for 32-bit PowerPC and "arch/ppc64" for 64-bit PowerPC. Both are merged already since a while into the new tree "arch/powerpc" ... and the old trees will become obsolete sooner than later.Thanks for this information having ppc and powerpc is little confusing.
Quoted 1 line
Concerning your problem, I'm unable to reproduce it on my setup. What exact version of the ELDK do you use.
I'm using the ELDK 4.1 Toolchain (ppc-2007-01-19.iso)
OK, in the meantime I know that the problem is known with ELDK 4.x as described http://www.denx.de/wiki/view/DULG/ELDKIncludeFilesMissing.
Wolfgang.
Dear Wolfgang * 2,
thank you very much for the help, its compiling now.
Have a nice day :)
kind regards,
--peter
Hi,
History:
https://mail.gna.org/public/xenomai-help/2007-05/msg00260.html
Quoted 2 lines
Please see FAQ 14.1.4. ELDK Include Files Missing
http://www.denx.de/wiki/view/DULG/ELDKIncludeFilesMissing
After doing this workaround, I'm able to compile the userspace part of Xenomai, but now I can't compile any little kernelmodule using the xenomai api. I attached the Makefile and the sourcecode of my little example.
When trying to compile it cannot find headers like asm/param.h or asm/types.h (because they are not in krnsrc/include/asm-ppc/ and the workaround just added the userspace/libc headers). I guess there must be something wrong with the Makefile, but I cannot find the problem.
regards,
--peter
### List of modules to be build
MODULES = krn
### Default to sources of currently running kernel KSRC:=../../usr/src/linux
OBJS := ${patsubst %, %.o, $(MODULES)}
CLEANMOD := ${patsubst %, .%*, $(MODULES)}
PWD := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
obj-m := $(OBJS)EXTRA_CFLAGS := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix
all::
$(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules
clean::
$(RM) $(CLEANMOD) *.o *.ko *.mod.c Module*.symvers $(RM) -R .tmp*
#include <linux/module.h>
#include <native/task.h>
MODULE_LICENSE("GPL");RT_TASK task;
void foo_task(void *cookie) {
int i=0;
rt_task_set_periodic(NULL, TM_NOW, 50000000);
while(1)
{
rt_task_wait_period(NULL);
printk("foo %d\n",i++); }
}
int init_module(void)
{
rt_task_create(&task, "foo_task", 0, 99, 0);
rt_task_start(&task, &foo_task,NULL);
printk("krn module loaded\n");
return 0;
}void cleanup_module(void)
{
rt_task_delete(&task);
printk("krn module unloaded\n");
}Quoted 13 lines · Peter Feuerer
Hi,
History:
https://mail.gna.org/public/xenomai-help/2007-05/msg00260.htmlQuoted 2 lines
Please see FAQ 14.1.4. ELDK Include Files Missing
http://www.denx.de/wiki/view/DULG/ELDKIncludeFilesMissingAfter doing this workaround, I'm able to compile the userspace part of Xenomai, but now I can't compile any little kernelmodule using the xenomai api. I attached the
Makefileand the sourcecode of my little example.
Quoted 4 lines
When trying to compile it cannot find headers like
asm/param.horasm/types.h(because they are not in krnsrc/include/asm-ppc/ and the workaround just added the userspace/libc headers). I guess there must be something wrong with theMakefile, but I cannot find the problem.
Just add ARCH=ppc to you make command.
Wolfgang.
Quoted 14 lines · Wolfgang Grandegger
Quoted 13 lines · Peter Feuerer
Hi,
History:
https://mail.gna.org/public/xenomai-help/2007-05/msg00260.htmlQuoted 2 lines
Please see FAQ 14.1.4. ELDK Include Files Missing
http://www.denx.de/wiki/view/DULG/ELDKIncludeFilesMissingAfter doing this workaround, I'm able to compile the userspace part of Xenomai, but now I can't compile any little kernelmodule using the xenomai api. I attached the
Makefileand the sourcecode of my little example.
Quoted 6 lines
Quoted 4 lines
When trying to compile it cannot find headers like
asm/param.horasm/types.h(because they are not in krnsrc/include/asm-ppc/ and the workaround just added the userspace/libc headers). I guess there must be something wrong with theMakefile, but I cannot find the problem.Just add ARCH=ppc to you make command.
ARCH=ppc is already set as environment variable, nevertheless I tried to compile it using "make ARCH=ppc" and to add it to Makefile's make line. Still the same Problem.
--peter
Quoted 18 lines · Peter Feuerer
Quoted 17 lines · Wolfgang Grandegger
Quoted 16 lines · Peter Feuerer
Hi,
History:
https://mail.gna.org/public/xenomai-help/2007-05/msg00260.htmlQuoted 2 lines
Please see FAQ 14.1.4. ELDK Include Files Missing
http://www.denx.de/wiki/view/DULG/ELDKIncludeFilesMissingAfter doing this workaround, I'm able to compile the userspace part of Xenomai, but now I can't compile any little kernelmodule using the xenomai api. I attached the
Makefileand the sourcecode of my little example.When trying to compile it cannot find headers like
asm/param.horasm/types.h(because they are not in krnsrc/include/asm-ppc/ and the workaround just added the userspace/libc headers). I guess there must be something wrong with theMakefile, but I cannot find the problem.
Quoted 5 lines
Quoted 1 line
Just add ARCH=ppc to you make command.
ARCH=ppc is already set as environment variable, nevertheless I tried to compile it using "make ARCH=ppc" and to add it to Makefile's make line. Still the same Problem.
Hm, it works for me. You moved around header files in your kernel include path. Have you already cleaned up? And add V=1 to the make command to check the compile command.
Wolfgang.
Quoted 21 lines · Wolfgang Grandegger
Quoted 20 lines · Peter Feuerer
Quoted 18 lines · Wolfgang Grandegger
Quoted 12 lines · Peter Feuerer
Hi,
History:
https://mail.gna.org/public/xenomai-help/2007-05/msg00260.htmlQuoted 2 lines
Please see FAQ 14.1.4. ELDK Include Files Missing
http://www.denx.de/wiki/view/DULG/ELDKIncludeFilesMissingAfter doing this workaround, I'm able to compile the userspace part of Xenomai, but now I can't compile any little kernelmodule using the xenomai api. I attached the
Makefileand the sourcecode of my little example.Quoted 4 lines
When trying to compile it cannot find headers like
asm/param.horasm/types.h(because they are not in krnsrc/include/asm-ppc/ and the workaround just added the userspace/libc headers). I guess there must be something wrong with theMakefile, but I cannot find the problem.Just add ARCH=ppc to you make command.
Quoted 7 lines
Quoted 3 lines
ARCH=ppc is already set as environment variable, nevertheless I tried to compile it using "make ARCH=ppc" and to add it to Makefile's make line. Still the same Problem.
Hm, it works for me. You moved around header files in your kernel include path. Have you already cleaned up? And add V=1 to the make command to check the compile command.
This is a complete new installation of denx ELDK 4.1 and a complete fresh kernel, just patched with the adeos patch and compiled, no hacks, or workarounds here. I sent the log how I installed everything some emails ago.
Got it, the V=1 told me to make a "make oldconfig && make prepare" in the kernel src then I was able to compile it. What ever that made, it made it working.
thanks for your help!
--peter
Quoted 26 lines · Peter Feuerer
Quoted 19 lines · Wolfgang Grandegger
Quoted 18 lines · Peter Feuerer
Quoted 17 lines · Wolfgang Grandegger
Quoted 16 lines · Peter Feuerer
Hi,
History:
https://mail.gna.org/public/xenomai-help/2007-05/msg00260.htmlQuoted 2 lines
Please see FAQ 14.1.4. ELDK Include Files Missing
http://www.denx.de/wiki/view/DULG/ELDKIncludeFilesMissingAfter doing this workaround, I'm able to compile the userspace part of Xenomai, but now I can't compile any little kernelmodule using the xenomai api. I attached the
Makefileand the sourcecode of my little example.When trying to compile it cannot find headers like
asm/param.horasm/types.h(because they are not in krnsrc/include/asm-ppc/ and the workaround just added the userspace/libc headers). I guess there must be something wrong with theMakefile, but I cannot find the problem.Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Just add ARCH=ppc to you make command.
ARCH=ppc is already set as environment variable, nevertheless I tried to compile it using "make ARCH=ppc" and to add it to Makefile's make line. Still the same Problem.
Hm, it works for me. You moved around header files in your kernel include path. Have you already cleaned up? And add V=1 to the make command to check the compile command.
Quoted 8 lines
This is a complete new installation of denx ELDK 4.1 and a complete fresh kernel, just patched with the adeos patch and compiled, no hacks, or workarounds here. I sent the log how I installed everything some emails ago.
Got it, the V=1 told me to make a "make oldconfig && make prepare" in the kernel src then I was able to compile it. What ever that made, it made it working.
Good, it makes some required header files.
Wolfgang.