Gentoo Archives: gentoo-ppc-dev

From: felix <felixs@×××××.fr>
To: gentooppc-dev@g.o
Subject: [gentooppc-dev] Cross Compilation Problem !!!
Date: Wed, 03 Jul 2002 03:11:01
Message-Id: 20020703081059.02EB549BEE@mail.esiee.fr
1 I devellop a system based on PPC405 architecture and I have a cross
2 compilation problem.
3 I am a novice in programmation and I cant resolve a library problem (
4 I think ).
5
6 I compiled a kernel with a cross compiler and now I want compil a
7 program to write on a ISA bus.
8
9
10 When I compile my program, the cross-compiler doesnt found the
11 fonction "readb" on my libraries.
12 I think I find the good library but when I add the directory , the
13 result is the same.
14
15 My cross-compiler name is "p405-gcc", the error message is :
16
17 >[mip405@archi2 isa1]$ p405-gcc -o testisa -s sebisa.c
18 >sebisa.c: In function `main':
19 >sebisa.c:57: warning: return type of `main' is not `int'
20 >/home/mip405/tmp/ccwoA8Pi.o: In function `main':
21 >/home/mip405/tmp/ccwoA8Pi.o(.text+0x1c): undefined reference to
22 `readb'
23 >/home/mip405/tmp/ccwoA8Pi.o(.text+0x1c): relocation truncated to fit:
24 R_PPC_REL24 readb
25 >collect2: ld returned 1 exit status
26 >[mip405@archi2 isa1]$
27
28
29 I doesnt know if my problem is really a library problem but I cant
30 continue the devellopement.
31
32 The program " sebisa.c " is :
33
34
35 >#include <asm/page.h>
36 >#include <linux/ioport.h>
37 >#include <asm/io.h>
38 >#include <stdio.h>
39 >#include <stdlib.h>
40 >#include <string.h>
41 >#include <unistd.h>
42 >#include <sys/mman.h>
43 >#include <sys/types.h>
44 >#include <sys/stat.h>
45 >#include <fcntl.h>
46 >#include <errno.h>
47 >#include <asm/ibm4xx.h>
48 >
49 >
50 >#define isa_mem_base 0xe0000000
51 >#define isa_readb(a) readb((a)+isa_mem_base)
52 >#define isa_readw(a) readw((a)+isa_mem_base)
53 >#define isa_writeb(b,a) writeb(b,(a)+isa_mem_base)
54 >#define isa_writew(b,a) writew(b,(a)+isa_mem_base)
55 >#define isa_memcpy_fromio(a,b,c)
56 memcpy_fromio((a)+isa_mem_base,b,c)
57 >#define isa_memcpy_toio(a,b,c)
58 memcpy_toio(a,(b)+isa_mem_base,c)
59 >
60 >void main()
61 >{
62 > unsigned long j; /* compteur de tempo */
63 > unsigned short isa;
64 >
65 > isa =isa_readb( 0xD4000 );
66 >
67 > for (j=0;j<10000;j+=1) {
68 > printf("==> %08lx fois = 0x%08lx\n", j , isa);
69 > }
70 >}
71
72 For your information, the function "ioremap" doesnt work too.
73
74 Thank you for the caused disturbance but I am really wedged.
75
76
77 Sébastien FELIX
78
79 sebfelix@×××××××.fr
80
81
82 "sebisa.c" 68L, 1874C