[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] uClibc support
Hi Amruta,
On Fri, Jul 17, 2009 at 3:58 PM, Bhat, Amruta<Amruta.Bhat@xxxxxxx> wrote:
> If I enable uClibc support for petalinux then I get following errors while
> compiling. Any idea how to get around it? I want the uClibc support as one
> of my applications needs WCHAR support.
Just to clarify - the toolchain distributed with PetaLinux has uClibc
built-in - however if you want a non-standard uClibc configuration
then yes, it is necessary to enable uClibc build inside the PetaLinux
build process itself.
> -mno-xl-soft-div -mxl-barrel-shift -mcpu=v7.10.a -O2 -g -fomit-frame-pointer
> -pipe -fno-common -fno-builtin -Wall -mno-xl-soft-mul -mno-xl-soft-div
> -mxl-barrel-shift -mcpu=v7.10.a -DEMBED -fno-builtin -nostdinc -D_LIBC
> -I../../include -I. -isystem
> /home/ambhat/peta/petalinux-v0.40-rc3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/include
> -DNDEBUG -c ether_addr.c -o ether_addr.o
>
> In file included from ../../include/linux/posix_types.h:47,
I've just made some commits to the SVN repository that allows this
build to complete successfully - and the necessary patches are also
attached if you can please try them.
I've build and boot tested this, but obviously if you find any
problems please let us know.
Regards,
John
--
John Williams, PhD, B.Eng, B.IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663 f: +61-7-30090663
Index: software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h
===================================================================
--- software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h (revision 5589)
+++ software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h (working copy)
@@ -3,60 +3,57 @@
#ifndef _BITS_STAT_STRUCT_H
#define _BITS_STAT_STRUCT_H
-struct kernel_stat
-{
- __kernel_dev_t st_dev;
- __kernel_ino_t st_ino;
- __kernel_mode_t st_mode;
- __kernel_nlink_t st_nlink;
- __kernel_uid_t st_uid;
- __kernel_gid_t st_gid;
- __kernel_dev_t st_rdev;
- __kernel_off_t st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
- unsigned long __unused4;
- unsigned long __unused5;
+struct kernel_stat {
+ unsigned int st_dev;
+ unsigned long st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned int st_rdev;
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long __unused1; /* unsigned long st_atime_nsec */
+ unsigned long st_mtime;
+ unsigned long __unused2; /* unsigned long st_mtime_nsec */
+ unsigned long st_ctime;
+ unsigned long __unused3; /* unsigned long st_ctime_nsec */
+ unsigned long __unused4;
+ unsigned long __unused5;
};
-struct kernel_stat64
-{
- __kernel_dev_t st_dev;
- unsigned long __unused0;
- unsigned long __unused1;
+struct kernel_stat64 {
+ unsigned long long st_dev;
+ unsigned long __unused1;
- __kernel_ino64_t st_ino;
+ unsigned long long st_ino;
- __kernel_mode_t st_mode;
- __kernel_nlink_t st_nlink;
+ unsigned int st_mode;
+ unsigned int st_nlink;
- __kernel_uid_t st_uid;
- __kernel_gid_t st_gid;
+ unsigned int st_uid;
+ unsigned int st_gid;
- __kernel_dev_t st_rdev;
- unsigned long __unused2;
- unsigned long __unused3;
+ unsigned long long st_rdev;
+ unsigned long __unused3;
- __kernel_loff_t st_size;
+ long long st_size;
unsigned long st_blksize;
- unsigned long __unused4; /* future possible st_blocks high bits */
- unsigned long st_blocks; /* Number 512-byte blocks allocated. */
+ unsigned long st_blocks; /* No. of 512-byte blocks allocated */
+ unsigned long __unused4; /* future possible st_blocks high bits */
unsigned long st_atime;
- unsigned long __unused5;
+ unsigned long st_atime_nsec;
unsigned long st_mtime;
- unsigned long __unused6;
+ unsigned long st_mtime_nsec;
unsigned long st_ctime;
- unsigned long __unused7; /* high 32 bits of ctime someday */
-};
+ unsigned long st_ctime_nsec;
+ unsigned long __unused8;
+};
#endif /* _BITS_STAT_STRUCT_H */
Index: software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_types.h
===================================================================
--- software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_types.h (revision 5589)
+++ software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_types.h (working copy)
@@ -13,26 +13,26 @@
* Microblaze port by John Williams
*/
-#ifndef __MICROBLAZE_POSIX_TYPES_H__
-#define __MICROBLAZE_POSIX_TYPES_H__
+#ifndef _ASM_MICROBLAZE_POSIX_TYPES_H
+#define _ASM_MICROBLAZE_POSIX_TYPES_H
-typedef unsigned int __kernel_dev_t;
typedef unsigned long __kernel_ino_t;
typedef unsigned long long __kernel_ino64_t;
typedef unsigned int __kernel_mode_t;
typedef unsigned int __kernel_nlink_t;
typedef long __kernel_off_t;
-typedef long long __kernel_loff_t;
typedef int __kernel_pid_t;
-typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned int __kernel_ipc_pid_t;
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
-typedef unsigned int __kernel_size_t;
-typedef int __kernel_ssize_t;
+typedef unsigned long __kernel_size_t;
+typedef long __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_suseconds_t;
typedef long __kernel_clock_t;
+typedef int __kernel_timer_t;
+typedef int __kernel_clockid_t;
typedef int __kernel_daddr_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
@@ -42,7 +42,8 @@
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
-typedef __kernel_dev_t __kernel_old_dev_t;
+typedef unsigned short __kernel_old_dev_t;
+typedef unsigned int __kernel_dev_t;
typedef struct {
#ifdef __USE_ALL
@@ -52,4 +53,4 @@
#endif
} __kernel_fsid_t;
-#endif /* __MICROBLAZE_POSIX_TYPES_H__ */
+#endif /* _ASM_MICROBLAZE_POSIX_TYPES_H */
Index: software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/crt0.S
===================================================================
--- software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/crt0.S (revision 5589)
+++ software/petalinux-dist/uClibc/libc/sysdeps/linux/microblaze/crt0.S (working copy)
@@ -32,8 +32,10 @@
add r7, r6, r3 // add to argv to get offset
// Load SDAs
+/*
la r2, r0, C_SYMBOL_NAME(_SDA_BASE_)
la r13, r0, C_SYMBOL_NAME(_SDA2_BASE_)
+*/
// tail-call uclibc's startup routine
brid C_SYMBOL_NAME(__uClibc_main)