Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-ppc-dev
Navigation:
Lists: gentoo-ppc-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentooppc-dev@g.o
From: felix <felixs@...>
Subject: Cross Compilation Problem !!!
Date: Wed Jul 3 03:12:01 2002
I devellop a system based on PPC405 architecture and I have a cross
compilation problem.
I am a novice in programmation and I cant resolve a library problem (
I think ).

I compiled a kernel with a cross compiler and now I want compil a
program to write on a ISA bus.


When I compile my program, the cross-compiler doesnt found the
fonction "readb" on my libraries.
 I think I find the good library but when I add the directory , the
result is the same.

My cross-compiler name is "p405-gcc", the error message is :

>[mip405@archi2 isa1]$ p405-gcc -o testisa -s sebisa.c
>sebisa.c: In function `main':
>sebisa.c:57: warning: return type of `main' is not `int'
>/home/mip405/tmp/ccwoA8Pi.o: In function `main':
>/home/mip405/tmp/ccwoA8Pi.o(.text+0x1c): undefined reference to
`readb'
>/home/mip405/tmp/ccwoA8Pi.o(.text+0x1c): relocation truncated to fit:
R_PPC_REL24 readb
>collect2: ld returned 1 exit status
>[mip405@archi2 isa1]$


I doesnt know if my problem is really a library problem but I cant
continue the devellopement.

The program " sebisa.c " is :


>#include <asm/page.h>
>#include <linux/ioport.h>
>#include <asm/io.h>
>#include  <stdio.h>
>#include  <stdlib.h>
>#include  <string.h>
>#include  <unistd.h>
>#include  <sys/mman.h>
>#include  <sys/types.h>
>#include  <sys/stat.h>
>#include  <fcntl.h>
>#include  <errno.h>
>#include <asm/ibm4xx.h>
>
>
>#define isa_mem_base 0xe0000000
>#define isa_readb(a)                    readb((a)+isa_mem_base)
>#define isa_readw(a)                    readw((a)+isa_mem_base)
>#define isa_writeb(b,a)                 writeb(b,(a)+isa_mem_base)
>#define isa_writew(b,a)                 writew(b,(a)+isa_mem_base)
>#define isa_memcpy_fromio(a,b,c)       
memcpy_fromio((a)+isa_mem_base,b,c)
>#define isa_memcpy_toio(a,b,c)         
memcpy_toio(a,(b)+isa_mem_base,c)
>
>void main()
>{
>  unsigned long j; /* compteur de tempo */
>  unsigned short isa;
>
>  isa =isa_readb( 0xD4000 );
>
>  for (j=0;j<10000;j+=1) {
>    printf("==> %08lx fois  = 0x%08lx\n", j , isa);
>  }
>}

For your information, the function "ioremap" doesnt work too.

Thank you for the caused disturbance but I am really wedged.


S├ębastien FELIX

sebfelix@...


"sebisa.c" 68L, 1874C

Navigation:
Lists: gentoo-ppc-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Portage Rescue For PPC Released.
Next by thread:
kportagemaster
Previous by date:
Portage Rescue For PPC Released.
Next by date:
kportagemaster


Updated Jun 17, 2009

Summary: Archive of the gentoo-ppc-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.