Cross compiler header problem

Posted by: TheAmigo

Cross compiler header problem - 27/01/2002 20:08

Can someone point out what I'm missing here? I'm using mlord's pre-compiled tool-chain. I have the following program (this is the whole thing):
#include <asm/semaphore.h>

main(){}
and when I compile it, I get the following errors (these are just the first of many)
In reply to:

compiler error][root@linuxbox source]# gcc z.c
In file included from z.c:1:
/usr/local/armtools-empeg/lib/gcc-lib/arm-empeg-linux/2.95.3/../../../../arm-empeg-linux/include/asm/semaphore.h:17: parse error before `wait_queue_head_t'
/usr/local/armtools-empeg/lib/gcc-lib/arm-empeg-linux/2.95.3/../../../../arm-empeg-linux/include/asm/semaphore.h:17: warning: no semicolon at end of struct or union
/usr/local/armtools-empeg/lib/gcc-lib/arm-empeg-linux/2.95.3/../../../../arm-empeg-linux/include/asm/semaphore.h: In function `sema_init':
/usr/local/armtools-empeg/lib/gcc-lib/arm-empeg-linux/2.95.3/../../../../arm-empeg-linux/include/asm/semaphore.h:46: dereferencing pointer to incomplete type




(using code blocks makes the errors too long)
Posted by: wfaulk

Re: Cross compiler header problem - 27/01/2002 20:16

That would tend to mean that wait_queue_head_t wasn't defined, but it's defined in <linux/wait.h>, which is included from <asm/semaphore.h>. Odd. Maybe you can make sure that <linux/wait.h> exists and has that definition in it?
Posted by: TheAmigo

Re: Cross compiler header problem - 27/01/2002 20:55

Nevermind, figured it out. I had to define __KERNEL__ for the necessary section of code to be included.

Posted by: mlord

Re: Cross compiler header problem - 28/01/2002 07:26

Funny.. my toolchain does NOT have a command called "gcc" in it.

Or perhaps you've added aliases/symlinks or just renamed things. If not, then you're using the wrong compiler.

Cheers
Posted by: TheAmigo

Re: Cross compiler header problem - 28/01/2002 20:20

Yeah, I symlinked it because my fingers are too used to typing gcc
Posted by: mlord

Re: Cross compiler header problem - 28/01/2002 21:23

Okay. Just be careful that this isn't the source of your woes..

When building binaries like this, I sometimes create symlinks for EVERYTHING in the ?????/bin directory, and dump it at the head of the PATH.

Cheers
Posted by: TheAmigo

Re: Cross compiler header problem - 29/01/2002 17:48

Yep, I made symlinks for all of 'em. I have an alias called "empeg" that prepends the armtools bin dir to my path. I have another alias called "tivo" that prepends my ppc toolchain's bin dir to my path. Having them as aliases, by default "gcc" runs my native compiler.

Right now, what I'm interested in doing is setting up a working IrCOMM connection to the empeg. I've got IrCOMM set up on my Win98 box through an external IR dongle. I can run a terminal program to COM4 (the virtual com port provided by my Windows IrCOMM driver) and point the dongle at the empeg (currently about 4 inches away). But I still have some work to do on the empeg side. Do you have IrCOMM support already compiled into hijack or do I need to compile my own modules and load them? I noticed that I don't have a /proc/modules so I can't tell what modules are loaded.
Posted by: mlord

Re: Cross compiler header problem - 29/01/2002 19:18

No irda in hijack.

No modules support in the kernel.

Cheers