* [ECOS] redefinition of `cyg_uint32'
@ 2006-05-17 15:07 Juergen Lambrecht
2006-05-17 15:58 ` Andrew Lunn
0 siblings, 1 reply; 8+ messages in thread
From: Juergen Lambrecht @ 2006-05-17 15:07 UTC (permalink / raw)
To: ecos-discuss
Hello,
I get compiler errors for all `cyg_uintxxx' types, e.g.
redefinition of `cyg_uint32'
This is because the build directory
ecos_ims/install/include/linux/types.h contains the following wrong code:
#include "cyg/infra/cyg_type.h"
#define uint8_t cyg_uint8
#define uint16_t cyg_uint16
#define uint32_t cyg_uint32
#define int8_t cyg_int8
#define int16_t cyg_int16
#define int32_t cyg_int32
The types above are redefined because "cyg/infra/cyg_type.h" already
defines them (ecos/packages/infra/current/include/cyg_type.h
Why is the linux types.h wrong?
Thanks,
Juergen Lambrecht
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] redefinition of `cyg_uint32'
2006-05-17 15:07 [ECOS] redefinition of `cyg_uint32' Juergen Lambrecht
@ 2006-05-17 15:58 ` Andrew Lunn
2006-05-18 2:59 ` [ECOS] error building ecos application for LEON Agus Ariffianto
2006-05-18 14:45 ` [ECOS] redefinition of `cyg_uint32' Jürgen Lambrecht
0 siblings, 2 replies; 8+ messages in thread
From: Andrew Lunn @ 2006-05-17 15:58 UTC (permalink / raw)
To: Juergen Lambrecht; +Cc: ecos-discuss
On Wed, May 17, 2006 at 05:03:53PM +0200, Juergen Lambrecht wrote:
> Hello,
>
> I get compiler errors for all `cyg_uintxxx' types, e.g.
>
> redefinition of `cyg_uint32'
>
> This is because the build directory
> ecos_ims/install/include/linux/types.h contains the following wrong code:
>
> #include "cyg/infra/cyg_type.h"
>
> #define uint8_t cyg_uint8
> #define uint16_t cyg_uint16
> #define uint32_t cyg_uint32
>
> #define int8_t cyg_int8
> #define int16_t cyg_int16
> #define int32_t cyg_int32
>
> The types above are redefined because "cyg/infra/cyg_type.h" already
> defines them (ecos/packages/infra/current/include/cyg_type.h
cyg_types.h only defines the cyg_* types. It does not define the onces
without cyg_ . Hence why the linux/types.h exists.
However i don't see how this can cause a problem. Please can you give
a real test case to reproduce the error.
Thanks
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ECOS] error building ecos application for LEON
2006-05-17 15:58 ` Andrew Lunn
@ 2006-05-18 2:59 ` Agus Ariffianto
2006-05-18 14:45 ` [ECOS] redefinition of `cyg_uint32' Jürgen Lambrecht
1 sibling, 0 replies; 8+ messages in thread
From: Agus Ariffianto @ 2006-05-18 2:59 UTC (permalink / raw)
To: ecos-discuss
Dear ALL,
Cuurently I'm trying to build ecos on LEON (which will be implemented on
Altera Stratix FPGA). The step was (if I'm wrong, please let me know):
1. Create ld file ($(BASE-WORK)/$(BASE-WORK)_install/lib/target.ld) using
configtool
=> succeeded
2. Create out file ($(BASE-WORK)/a.out)
=> failed
the command was:
cd /src/project/$(BASE-WORK)
sparc-rtems-gcc -I $(BASE-WORK)_install/include/ ../hello.c -L
$(BASE-WORK)_install/lib/ -Ttarget.ld -nostdlib
the error message was:
/gnutools/rtems-4.6/bin/../lib/gcc-lib/sparc-rtems/3.2.3/../../../../sparc-rtems/bin/ld:
waning: no memory region specified for section '.ram_vectors'
/gnutools/rtems-4.6/bin/../lib/gcc-lib/sparc-rtems/3.2.3/../../../../sparc-rtems/bin/ld:
warning: cannot find entry symbol start; defaulting to 40001300
The question is:
1. Am I using the right compiler? If it is not the right compiler, which
compiler should I use? Where can I find it
2. If I am using the right compiler, what should I do?
3. Thank you
Regards,
Agus
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] redefinition of `cyg_uint32'
2006-05-17 15:58 ` Andrew Lunn
2006-05-18 2:59 ` [ECOS] error building ecos application for LEON Agus Ariffianto
@ 2006-05-18 14:45 ` Jürgen Lambrecht
2006-05-18 14:54 ` Andrew Lunn
1 sibling, 1 reply; 8+ messages in thread
From: Jürgen Lambrecht @ 2006-05-18 14:45 UTC (permalink / raw)
To: Andrew Lunn; +Cc: eCos Discussion
I'm sorry, I confused #define with typedef.
This is the correct problem description:
The problem started by using the openbsd package.
In ecos/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h:
typedef unsigned int u_int32_t;
typedef unsigned int uint32_t;
But in ecos/packages/compat/linux/current/include/linux/types.h:
#define uint32_t cyg_uint32
So apparantly, the compiler replaces in bsdtypes.h the 'uint32_t' with
cyg_uint32, which becomes then redefined.
Apparantly, because it is not possible because the same file bdstypes.h
contains also:
#undef uint32_t
The compiler complains when compiling jffs2:
arm-elf-gcc -c ... ecos/packages/fs/jffs2/current/src/compr.c
And compr.h contains
#include <linux/types.h>
What happens when a typedefed "uint32_t" exists, follewed by #define'ing it??
Could that be the cause of problems?
Kind regards,
Juergen
Andrew Lunn wrote:
> On Wed, May 17, 2006 at 05:03:53PM +0200, Juergen Lambrecht wrote:
>
>>Hello,
>>
>>I get compiler errors for all `cyg_uintxxx' types, e.g.
>>
>>redefinition of `cyg_uint32'
>>
>>This is because the build directory
>>ecos_ims/install/include/linux/types.h contains the following wrong code:
>>
>>#include "cyg/infra/cyg_type.h"
>>
>>#define uint8_t cyg_uint8
>>#define uint16_t cyg_uint16
>>#define uint32_t cyg_uint32
>>
>>#define int8_t cyg_int8
>>#define int16_t cyg_int16
>>#define int32_t cyg_int32
>>
>>The types above are redefined because "cyg/infra/cyg_type.h" already
>>defines them (ecos/packages/infra/current/include/cyg_type.h
>
>
> cyg_types.h only defines the cyg_* types. It does not define the onces
> without cyg_ . Hence why the linux/types.h exists.
>
> However i don't see how this can cause a problem. Please can you give
> a real test case to reproduce the error.
>
> Thanks
> Andrew
>
>
>
--
Jürgen Lambrecht
Diksmuidse Heerweg 338
8200 Sint-Andries
Tel: +32 (0)50 842901
GSM: +32 (0)476 313389
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] redefinition of `cyg_uint32'
2006-05-18 14:45 ` [ECOS] redefinition of `cyg_uint32' Jürgen Lambrecht
@ 2006-05-18 14:54 ` Andrew Lunn
2006-05-18 21:40 ` Jurgen Lambrecht
2006-05-23 8:23 ` [ECOS] Patch for " Juergen Lambrecht
0 siblings, 2 replies; 8+ messages in thread
From: Andrew Lunn @ 2006-05-18 14:54 UTC (permalink / raw)
To: J?rgen Lambrecht; +Cc: eCos Discussion
On Thu, May 18, 2006 at 04:43:21PM +0200, J?rgen Lambrecht wrote:
> I'm sorry, I confused #define with typedef.
> This is the correct problem description:
>
> The problem started by using the openbsd package.
Ah, O.K. I've not compiled OpenBSD for a long time. Most people have
swapped to the FreeBSD stack.
> In ecos/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h:
>
> typedef unsigned int u_int32_t;
> typedef unsigned int uint32_t;
>
> But in ecos/packages/compat/linux/current/include/linux/types.h:
>
> #define uint32_t cyg_uint32
>
> So apparantly, the compiler replaces in bsdtypes.h the 'uint32_t' with
> cyg_uint32, which becomes then redefined.
> Apparantly, because it is not possible because the same file bdstypes.h
> contains also:
> #undef uint32_t
>
> The compiler complains when compiling jffs2:
> arm-elf-gcc -c ... ecos/packages/fs/jffs2/current/src/compr.c
> And compr.h contains
> #include <linux/types.h>
>
> What happens when a typedefed "uint32_t" exists, follewed by #define'ing
> it??
> Could that be the cause of problems?
Yes, this seems reasonable.
So the question is, why is sys/bsdtypes.h being included in compr.h?
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] redefinition of `cyg_uint32'
2006-05-18 14:54 ` Andrew Lunn
@ 2006-05-18 21:40 ` Jurgen Lambrecht
2006-05-23 8:23 ` [ECOS] Patch for " Juergen Lambrecht
1 sibling, 0 replies; 8+ messages in thread
From: Jurgen Lambrecht @ 2006-05-18 21:40 UTC (permalink / raw)
To: Andrew Lunn; +Cc: ecos-discuss
Andrew Lunn wrote:
> On Thu, May 18, 2006 at 04:43:21PM +0200, J?rgen Lambrecht wrote:
>
>> I'm sorry, I confused #define with typedef.
>> This is the correct problem description:
>>
>> The problem started by using the openbsd package.
>>
>
> Ah, O.K. I've not compiled OpenBSD for a long time. Most people have
> swapped to the FreeBSD stack.
>
I just need a ftp server, LWIP does not have it. I will also swap to
FreeBSD.
>
>> In ecos/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h:
>>
>> typedef unsigned int u_int32_t;
>> typedef unsigned int uint32_t;
>>
>> But in ecos/packages/compat/linux/current/include/linux/types.h:
>>
>> #define uint32_t cyg_uint32
>>
>> So apparantly, the compiler replaces in bsdtypes.h the 'uint32_t' with
>> cyg_uint32, which becomes then redefined.
>> Apparantly, because it is not possible because the same file bdstypes.h
>> contains also:
>> #undef uint32_t
>>
>> The compiler complains when compiling jffs2:
>> arm-elf-gcc -c ... ecos/packages/fs/jffs2/current/src/compr.c
>> And compr.h contains
>> #include <linux/types.h>
>>
>> What happens when a typedefed "uint32_t" exists, follewed by #define'ing
>> it??
>> Could that be the cause of problems?
>>
>
> Yes, this seems reasonable.
>
> So the question is, why is sys/bsdtypes.h being included in compr.h?
>
> Andrew
>
I followed the compiler trace, and this is the answer:
#if !defined(_POSIX_SOURCE)
# if CYGINT_ISO_BSDTYPES
# ifdef CYGBLD_ISO_BSDTYPES_HEADER
# include CYGBLD_ISO_BSDTYPES_HEADER
# endif
# endif
#endif // !defined(_POSIX_SOURCE)
From isoinfra/current/include/sys/types.h:112
This is the trace:
In file included from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/sys/bsdtypes.h:80,
->net/bsd_tcpip/current/include/sys/bsdtypes.h
from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/sys/types.h:112,
->isoinfra/current/include/sys/types.h
from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/sys/stat.h:69,
->isoinfra/current/include/sys/stat.h
from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/linux/stat.h:5,
->compat/linux/current/include/linux/stat.h
from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/linux/fs.h:4,
->compat/linux/current/include/linux/fs.h
from
/ecos-c/version/vcs/c/ims/std_ims/ecos/packages/fs/jffs2/current/src/compr.h:24,
->fs/jffs2/current/src/compr.h
from
/ecos-c/version/vcs/c/ims/std_ims/ecos/packages/fs/jffs2/current/src/compr.c:16:
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/machine/types.h:41:
redefinition of `cyg_int8'
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/cyg/infra/cyg_type.h:203:
`cyg_int8' previously declared here
Kind regards,
Juergen Lambrecht
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ECOS] Patch for Re: [ECOS] redefinition of `cyg_uint32'
2006-05-18 14:54 ` Andrew Lunn
2006-05-18 21:40 ` Jurgen Lambrecht
@ 2006-05-23 8:23 ` Juergen Lambrecht
2006-05-23 8:25 ` [ECOS] " Andrew Lunn
1 sibling, 1 reply; 8+ messages in thread
From: Juergen Lambrecht @ 2006-05-23 8:23 UTC (permalink / raw)
To: Andrew Lunn; +Cc: ecos-discuss
[-- Attachment #1: Type: text/plain, Size: 3306 bytes --]
Hello Andrew,
with FreeBDS, I have the same problem.
By realizing that only the signed types give a problem, and not the
unsigned ones, I found the solution: adding #undef's for the signed types.
The new file ecos/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h
is in attach, together with the diff file (from ExamDiff Pro)
diff_bsdtypes.h.txt
Kind regards,
Juergen Lambrecht
Andrew Lunn wrote:
> On Thu, May 18, 2006 at 04:43:21PM +0200, J?rgen Lambrecht wrote:
>
>> I'm sorry, I confused #define with typedef.
>> This is the correct problem description:
>>
>> The problem started by using the openbsd package.
>>
>
> Ah, O.K. I've not compiled OpenBSD for a long time. Most people have
> swapped to the FreeBSD stack.
>
I just need a ftp server, LWIP does not have it. I will also swap to
FreeBSD.
>
>> In ecos/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h:
>>
>> typedef unsigned int u_int32_t;
>> typedef unsigned int uint32_t;
>>
>> But in ecos/packages/compat/linux/current/include/linux/types.h:
>>
>> #define uint32_t cyg_uint32
>>
>> So apparantly, the compiler replaces in bsdtypes.h the 'uint32_t' with
>> cyg_uint32, which becomes then redefined.
>> Apparantly, because it is not possible because the same file bdstypes.h
>> contains also:
>> #undef uint32_t
>>
>> The compiler complains when compiling jffs2:
>> arm-elf-gcc -c ... ecos/packages/fs/jffs2/current/src/compr.c
>> And compr.h contains
>> #include <linux/types.h>
>>
>> What happens when a typedefed "uint32_t" exists, follewed by #define'ing
>> it??
>> Could that be the cause of problems?
>>
>
> Yes, this seems reasonable.
>
> So the question is, why is sys/bsdtypes.h being included in compr.h?
>
> Andrew
>
I followed the compiler trace, and this is the answer:
#if !defined(_POSIX_SOURCE)
# if CYGINT_ISO_BSDTYPES
# ifdef CYGBLD_ISO_BSDTYPES_HEADER
# include CYGBLD_ISO_BSDTYPES_HEADER
# endif
# endif
#endif // !defined(_POSIX_SOURCE)
From isoinfra/current/include/sys/types.h:112
This is the trace:
In file included from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/sys/bsdtypes.h:80,
->net/bsd_tcpip/current/include/sys/bsdtypes.h
from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/sys/types.h:112,
->isoinfra/current/include/sys/types.h
from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/sys/stat.h:69,
->isoinfra/current/include/sys/stat.h
from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/linux/stat.h:5,
->compat/linux/current/include/linux/stat.h
from
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/linux/fs.h:4,
->compat/linux/current/include/linux/fs.h
from
/ecos-c/version/vcs/c/ims/std_ims/ecos/packages/fs/jffs2/current/src/compr.h:24,
->fs/jffs2/current/src/compr.h
from
/ecos-c/version/vcs/c/ims/std_ims/ecos/packages/fs/jffs2/current/src/compr.c:16:
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/machine/types.h:41:
redefinition of `cyg_int8'
/ecos-c/version/vcs/c/ims/std_ims/build/ecos_ims/install/include/cyg/infra/cyg_type.h:203:
`cyg_int8' previously declared here
Kind regards,
Juergen Lambrecht
[-- Attachment #2: bsdtypes.h --]
[-- Type: text/plain, Size: 3223 bytes --]
//==========================================================================
//
// include/sys/bsdtypes.h
//
//==========================================================================
//####BSDCOPYRIGHTBEGIN####
//
// -------------------------------------------
//
// Portions of this software may have been derived from OpenBSD,
// FreeBSD or other sources, and are covered by the appropriate
// copyright disclaimers included herein.
//
// Portions created by Red Hat are
// Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
//
// -------------------------------------------
//
//####BSDCOPYRIGHTEND####
//==========================================================================
#ifndef _SYS_BSDTYPES_H_
#define _SYS_BSDTYPES_H_
#include <cyg/infra/cyg_type.h>
#include <cyg/hal/hal_arch.h>
#define __BIT_TYPES_DEFINED__
#undef uint8_t
#undef uint16_t
#undef uint32_t
#undef int8_t
#undef int16_t
#undef int32_t
typedef __signed char int8_t;
typedef unsigned char u_int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short u_int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long u_int64_t;
typedef unsigned long long uint64_t;
// Types inherited from HAL
typedef CYG_ADDRESS vaddr_t;
typedef CYG_ADDRWORD vsize_t;
typedef CYG_ADDRESS paddr_t;
typedef CYG_ADDRWORD psize_t;
typedef CYG_ADDRESS vm_offset_t;
typedef CYG_ADDRWORD vm_size_t;
// No good HAL definition for this
typedef CYG_ADDRWORD register_t;
// From <arch/ansi.h>
/*
* Types which are fundamental to the implementation and may appear in
* more than one standard header are defined here. Standard headers
* then use:
* #ifdef _BSD_SIZE_T_
* typedef _BSD_SIZE_T_ size_t;
* #undef _BSD_SIZE_T_
* #endif
*/
#define _BSD_SSIZE_T_ int /* byte count or error */
#define _BSD_CLOCKID_T_ int
#define _BSD_TIMER_T_ int
#ifndef __time_t_defined // As defined/used by eCos libc
#define _BSD_CLOCK_T_ cyg_int64 /* clock() */
#define _BSD_TIME_T_ cyg_count32 /* time() */
#endif
#endif // _MACHINE_TYPES_H_
// Standard BSD types
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef char *caddr_t;
typedef u_int64_t u_quad_t; /* quads */
typedef int64_t quad_t;
typedef quad_t * qaddr_t;
/*
* XPG4.2 states that inclusion of <netinet/in.h> must pull these
* in and that inclusion of <sys/socket.h> must pull in sa_family_t.
* We put there here because there are other headers that require
* these types and <sys/socket.h> and <netinet/in.h> will indirectly
* include <sys/types.h>. Thus we are compliant without too many hoops.
*/
typedef u_int32_t in_addr_t; /* base type for internet address */
typedef u_int16_t in_port_t; /* IP port type */
typedef u_int8_t sa_family_t; /* sockaddr address family type */
typedef u_int32_t socklen_t; /* length type for network syscalls */
[-- Attachment #3: diff_bsdtypes.h.txt --]
[-- Type: text/plain, Size: 60 bytes --]
31a32,34
> #undef int8_t
> #undef int16_t
> #undef int32_t
[-- Attachment #4: Type: text/plain, Size: 148 bytes --]
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ECOS] Re: Patch for Re: [ECOS] redefinition of `cyg_uint32'
2006-05-23 8:23 ` [ECOS] Patch for " Juergen Lambrecht
@ 2006-05-23 8:25 ` Andrew Lunn
0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2006-05-23 8:25 UTC (permalink / raw)
To: Jurgen.Lambrecht; +Cc: Andrew Lunn, ecos-discuss
> I just need a ftp server, LWIP does not have it. I will also swap to
> FreeBSD.
BTW: eCos does not have a FTP server, only client.
You will have to write your own.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-05-23 8:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-17 15:07 [ECOS] redefinition of `cyg_uint32' Juergen Lambrecht
2006-05-17 15:58 ` Andrew Lunn
2006-05-18 2:59 ` [ECOS] error building ecos application for LEON Agus Ariffianto
2006-05-18 14:45 ` [ECOS] redefinition of `cyg_uint32' Jürgen Lambrecht
2006-05-18 14:54 ` Andrew Lunn
2006-05-18 21:40 ` Jurgen Lambrecht
2006-05-23 8:23 ` [ECOS] Patch for " Juergen Lambrecht
2006-05-23 8:25 ` [ECOS] " Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).