OpenWrt Forum Archive

Topic: text2atm.c in svn don't compil...

The content of this topic has been archived on 15 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I am trying to compil the svn version for my ar7 router (D-Link DSL-G664T) but it fails:

/usr/src/CVS/trunk/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/src/CVS/trunk/openwrt/staging_dir_mipsel/usr/include -I../../src/include -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -Wall -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wp,-MD,.deps/text2atm.pp -c text2atm.c  -fPIC -DPIC -o .libs/text2atm.lo
In file included from ../../src/include/atm.h:11,
                 from text2atm.c:15:
/usr/src/CVS/trunk/openwrt/staging_dir_mipsel/lib/gcc/mipsel-linux-uclibc/3.4.4/../../../../mipsel-linux-uclibc/sys-include/linux/atm.h:211: error: parse error before "uint32_t"
/usr/src/CVS/trunk/openwrt/staging_dir_mipsel/lib/gcc/mipsel-linux-uclibc/3.4.4/../../../../mipsel-linux-uclibc/sys-include/linux/atm.h:213: error: parse error before '}' token
/usr/src/CVS/trunk/openwrt/staging_dir_mipsel/lib/gcc/mipsel-linux-uclibc/3.4.4/../../../../mipsel-linux-uclibc/sys-include/linux/atm.h:217: error: parameter `addr' has incomplete type
In file included from text2atm.c:16:
../../src/include/atmsap.h:43: error: parse error before "uint8_t"
../../src/include/atmsap.h:43: warning: function declaration isn't a prototype
text2atm.c: In function `do_try_nsap':
text2atm.c:97: error: dereferencing pointer to incomplete type
text2atm.c:98: error: dereferencing pointer to incomplete type
text2atm.c:99: error: dereferencing pointer to incomplete type
text2atm.c:104: error: dereferencing pointer to incomplete type
text2atm.c:105: error: dereferencing pointer to incomplete type
text2atm.c:109: error: dereferencing pointer to incomplete type
text2atm.c:119: error: dereferencing pointer to incomplete type
text2atm.c:120: error: dereferencing pointer to incomplete type
text2atm.c:132: error: dereferencing pointer to incomplete type
text2atm.c:143: error: dereferencing pointer to incomplete type
text2atm.c: In function `try_nsap':
text2atm.c:155: error: dereferencing pointer to incomplete type
text2atm.c:156: error: dereferencing pointer to incomplete type
text2atm.c: In function `try_e164':
text2atm.c:169: error: dereferencing pointer to incomplete type
text2atm.c:178: error: dereferencing pointer to incomplete type
text2atm.c:179: error: dereferencing pointer to incomplete type
text2atm.c:188: error: dereferencing pointer to incomplete type
text2atm.c: In function `text2atm':
text2atm.c:237: error: invalid application of `sizeof' to incomplete type `sockaddr_atmsvc'
make[8]: *** [text2atm.lo] Error 1
make[8]: Leaving directory `/usr/src/CVS/trunk/openwrt/build_mipsel/linux-atm-2.4.1/src/lib'
make[7]: *** [all-recursive] Error 1
make[7]: Leaving directory `/usr/src/CVS/trunk/openwrt/build_mipsel/linux-atm-2.4.1/src'
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory `/usr/src/CVS/trunk/openwrt/build_mipsel/linux-atm-2.4.1'
make[5]: *** [all-recursive-am] Error 2
make[5]: Leaving directory `/usr/src/CVS/trunk/openwrt/build_mipsel/linux-atm-2.4.1'
make[4]: *** [/usr/src/CVS/trunk/openwrt/build_mipsel/linux-atm-2.4.1/.built] Error 2
make[4]: Leaving directory `/usr/src/CVS/trunk/openwrt/package/linux-atm'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/usr/src/CVS/trunk/openwrt/package/linux-atm'
make[2]: *** [linux-atm-compile] Error 2
make[2]: Leaving directory `/usr/src/CVS/trunk/openwrt/package'
make[1]: *** [package/compile] Error 2
make[1]: Leaving directory `/usr/src/CVS/trunk/openwrt'
make: *** [world] Error 2

Any idea on how to fix it ?

Problems seems to be because I have /usr/include/stdint.h from my glibc and the automake creates wrong Makefiles :
build_mipsel/linux-atm-2.4.1/src/lib/Makefile
in which I have commented the first occurence of $(top_builddir)/src/include/stdint.h.

build_mipsel/linux-atm-2.4.1/src/include/Makefile
in which I have commented "noinst_HEADERS = stdint.h".

The file build_mipsel/linux-atm-2.4.1/src/include/stdint.h contains :

#include "/usr/include/stdint.h"
I have removed this build_mipsel/linux-atm-2.4.1/src/include/stdint.h and then all compils just fine.

Now it would be great if someone which really know the openwrt sources could give a look at this problem wink

And I have to find out how to "flash" my DSL-G664T with my brand new compiled firmware...

Hello,

maybe some more info an this: build_mipsel/linux-atm-2.4.1/src/include/stdint.h has these contents:

/* stdint.h - provides uintXX_t until glibc does */

#ifndef _STDINT_H

#include <features.h>

#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1

#include "/usr/include/stdint.h"

#elif __GLIBC__ >= 2

/* Works for i386 and Alpha */

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;

#else

#ifndef _LINUX_TYPES_H
#include <linux/types.h>
#endif

#endif

#ifndef _STDINT_H
#define _STDINT_H
#endif

#endif

On a gentoo-multilib system, /usr/include/stdint.h has these contents:

/* Autogenerated by create_ml_includes() in multilib.eclass */

#ifdef __i386__
# include <gentoo-multilib/x86/stdint.h>
#endif /* __i386__ */

#ifdef __x86_64__
# include <gentoo-multilib/amd64/stdint.h>
#endif /* __x86_64__ */

I'd claim that using /usr/include/stdint.h by doing '#include "/usr/include/stdint.h"' is a bad hack which should be removed. Is this part of linux-atm, or has it been added by OpenWRT?
by the way, I got linux-atm to compile by changing "#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1" to "#if 0 &&  __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1", which prevents /usr/include/stdint.h from being used. (yes, I hacked the hack, lol)

Regards,
Milan

The discussion might have continued from here.