Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12596 Discussions

Compiling problems with uclibc ...

Altera_Forum
Honored Contributor II
1,248 Views

All, 

 

When I compile my application with uclibc, I got the following error message. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

C:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/include/linux/byteorder/little_en 

ian.h:45: error: `__le64&#39; undeclared (first use in this function)[/b] 

--- Quote End ---  

 

 

After using the "-E" instead of "-c", I find out the root cause of this problem. 

 

The include directory is 

"C:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/include/". 

 

In the file <linux/byteorder/little_endian.h>, I got the "undefined 

error message" for the symbol "__le64", but it was defined in 

<linux/types.h>. But unfortunately, only if we do not define 

"__KERNEL_STRICT_NAMES", "__le64" will be defined as expected. And the 

"__KERNEL_STRICT_NAMES" is defined in <features.h>, since the 

"_LOOSE_KERNEL_NAMES" is not defined. 

 

And, I also checked the uclibc.org about the uclibc file. It seems they do not have the <linux/types.h> file. They using default types.h file.  

 

I grapped mazur&#39;s version 2.6.9.1 linux/byteorder/little_endian.h for __le64, 

and this was what I got: 

 

./linux/byteorder/little_endian.h:#define __le64_to_cpu(x) ((__u64)(x)) 

./linux/byteorder/little_endian.h:#define __le64_to_cpup(x) (*(__u64*)(x)) 

./linux/byteorder/little_endian.h:#define __le64_to_cpus(x) do {} while (0) 

 

__u64 is defined in your architecture&#39;s asm file, in my case: 

 

./asm-i386/types.h:typedef unsigned long long __u64; 

 

So, is there anyone can help me step out of this problem? 

 

Thanks, 

Neo
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
296 Views

Who can help me solve this problem?

0 Kudos
Altera_Forum
Honored Contributor II
296 Views

well, my recommendation is, check the source code of your application to see if <asm/byteorder.h> is being included somewhere, and try removing it if. If this doesn&#39;t remove the problem, can you post more details about the error message?

0 Kudos
Altera_Forum
Honored Contributor II
296 Views

Thank you for your response. In fact, I am going to port the application to uclinux. And it uses the header file as  

# ifdef LINUX# include <asm/byteorder.h># endif 

 

And the LINUX is defined. Why do I need to remove this header files? And I found there is much difference between the uclibc header files and the header files in the following link. 

 

http://ep09.pld-linux.org/~mmazur/linux-libc-headers/ (http://ep09.pld-linux.org/~mmazur/linux-libc-headers/). 

 

Could you explain the difference for me?
0 Kudos
Altera_Forum
Honored Contributor II
296 Views

This header file is intended for kernel use only, and it mainly defines the byte order of the target machine, along with some helper functions. If I were you, I would try to remove the including of that file, put a "#define __LITTLE_ENDIAN 1234" in the same location, and give the compiler a run. If the application needs more than that, just copy them from that header file ...

0 Kudos
Reply