【已解决】cygwin下编译crosstool-ng在Installing C library的Building C library出错:rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

【问题】

折腾:

【已解决】cygwin下编译crosstool-ng在Building C library时出错:../wcsmbs/uchar.h:47:5: error: #error "<uchar.h> requires ISO C11 mode"

期间,已经解决了该问题了,但是接着又出错:

[INFO ]  =================================================================
[INFO ]  Installing C library
[EXTRA]    Configuring C library
[EXTRA]    Building C library
[ERROR]    rpc/types.h:73:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_char'
[ERROR]    rpc/types.h:74:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_short'
[ERROR]    rpc/types.h:75:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_int'
[ERROR]    rpc/types.h:76:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_long'
[ERROR]    rpc/types.h:77:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'quad_t'
[ERROR]    rpc/types.h:78:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_quad_t'
[ERROR]    rpc/types.h:79:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fsid_t'
[ERROR]    rpc/types.h:83:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'daddr_t'
[ERROR]    rpc/types.h:84:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'caddr_t'
[ERROR]    make[3]: *** [/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o] Error 1
[ERROR]    make[2]: *** [sunrpc/others] Error 2
[ERROR]    make[1]: *** [all] Error 2
[ERROR]  |
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing C library'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_libc_backend_once[scripts/build/libc/glibc-eglibc.sh-common@441]
[ERROR]  >>        called from: do_libc_backend[scripts/build/libc/glibc-eglibc.sh-common@143]
[ERROR]  >>        called from: do_libc[scripts/build/libc/glibc-eglibc.sh-common@65]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]

如图:

Installing C library rpc types.h 73 18 error expected asm or __attribute__ before u_char

 

log文件:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\build.log

详细内容如下:

[ALL  ]    gcc rpc_parse.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o
[ALL  ]    gcc rpc_scan.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o
[ALL  ]    In file included from rpc_parse.c:39:0:
[ERROR]    rpc/types.h:73:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_char'
[ERROR]    rpc/types.h:74:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_short'
[ERROR]    rpc/types.h:75:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_int'
[ERROR]    rpc/types.h:76:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_long'
[ERROR]    rpc/types.h:77:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'quad_t'
[ERROR]    rpc/types.h:78:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_quad_t'
[ERROR]    rpc/types.h:79:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fsid_t'
[ERROR]    rpc/types.h:83:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'daddr_t'
[ERROR]    rpc/types.h:84:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'caddr_t'
[ERROR]    make[3]: *** [/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o] Error 1
[ALL  ]    make[3]: *** Waiting for unfinished jobs....
[ALL  ]    make[3]: Leaving directory `/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/eglibc-2_15/sunrpc'
[ERROR]    make[2]: *** [sunrpc/others] Error 2
[ALL  ]    make[2]: Leaving directory `/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/eglibc-2_15'
[ERROR]    make[1]: *** [all] Error 2
[ALL  ]    make[1]: INTERNAL: Exiting with 3 jobserver tokens available; should be 4!
[ALL  ]    make[1]: Leaving directory `/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final'
[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing C library'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_libc_backend_once[scripts/build/libc/glibc-eglibc.sh-common@441]
[ERROR]  >>        called from: do_libc_backend[scripts/build/libc/glibc-eglibc.sh-common@143]
[ERROR]  >>        called from: do_libc[scripts/build/libc/glibc-eglibc.sh-common@65]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]

即:

rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

 

【折腾过程】

1.此问题,刚一开始,以为和之前的:

【已解决】cygwin中编译crosstool-ng在eglibc 2.17中的rpc_parse.c出错:rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

是一样的,所以去手动修改:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

为:

(注意:之前的解决办法中,修改错了,把#endif放到最后了,实际上应该是放到APPLE后面即可)

#ifndef makedev /* ie, we haven't already included it */
#include <sys/types.h>
#endif

//#ifndef __u_char_defined
/*
 * OS X and Cygwin already has these <sys/types.h>
 */
#ifndef __CYGWIN__ //add for check for __CYGWIN__
#ifndef __APPLE__
# ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
//# define __u_char_defined
//#endif
#  define __u_char_defined
# endif
 
#ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
//# define __daddr_t_defined
//#endif
#  define __daddr_t_defined
# endif

#endif /* __APPLE__ */
#endif /* __CYGWIN__ */

#include <sys/time.h>
#include <sys/param.h>

然后继续用exit 2继续编译试试,结果错误依旧:

 

Re-trying last command.

[ERROR]  make[3]: *** [/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpcgen] Error 1
[ERROR]  make[2]: *** [sunrpc/others] Error 2
[ERROR]  make[1]: *** [all] Error 2
[ERROR]  /
[ERROR]  >>
[ERROR]  >>  Build failed in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_libc_backend_once[scripts/build/libc/glibc-eglibc.sh-common@441]
[ERROR]  >>        called from: do_libc_backend[scripts/build/libc/glibc-eglibc.sh-common@143]
[ERROR]  >>        called from: do_libc[scripts/build/libc/glibc-eglibc.sh-common@65]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]
         /

Current command:
  'make' '-j4' '-l' 'all'
exited with error code: 2
Please fix it up and finish by exiting the shell with one of these values:
    1  fixed, continue with next build command
    2  repeat this build command
    3  abort build

ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final>

去看log:

[ALL  ]    gcc rpc_parse.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o
[ALL  ]    gcc rpc_scan.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o
[ALL  ]    In file included from rpc_parse.c:39:0:
[ERROR]    rpc/types.h:73:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_char'
[ERROR]    rpc/types.h:74:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_short'
[ERROR]    rpc/types.h:75:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_int'
[ERROR]    rpc/types.h:76:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_long'
[ERROR]    rpc/types.h:77:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'quad_t'
[ERROR]    rpc/types.h:78:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'u_quad_t'
[ERROR]    rpc/types.h:79:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fsid_t'
[ERROR]    rpc/types.h:83:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'daddr_t'
[ERROR]    rpc/types.h:84:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'caddr_t'
[ERROR]    make[3]: *** [/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o] Error 1
[ALL  ]    make[3]: *** Waiting for unfinished jobs....
[ALL  ]    make[3]: Leaving directory `/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/eglibc-2_15/sunrpc'
[ERROR]    make[2]: *** [sunrpc/others] Error 2
[ALL  ]    make[2]: Leaving directory `/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/eglibc-2_15'
[ERROR]    make[1]: *** [all] Error 2
[ALL  ]    make[1]: INTERNAL: Exiting with 3 jobserver tokens available; should be 4!
[ALL  ]    make[1]: Leaving directory `/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final'
[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing C library'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_libc_backend_once[scripts/build/libc/glibc-eglibc.sh-common@441]
[ERROR]  >>        called from: do_libc_backend[scripts/build/libc/glibc-eglibc.sh-common@143]
[ERROR]  >>        called from: do_libc[scripts/build/libc/glibc-eglibc.sh-common@65]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]

很明显,没有解决此问题,还是同样错误。

没有解决此处问题。

2.再次去试试:

把:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

改为:

//#ifndef __u_char_defined
/*
 * OS X and Cygwin already has these <sys/types.h>
 */
#ifndef __CYGWIN__ //add for check for __CYGWIN__
#ifndef __APPLE__
# ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
//# define __u_char_defined
//#endif
#  define __u_char_defined
# endif
 
#ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
//# define __daddr_t_defined
//#endif
#  define __daddr_t_defined
# endif

#endif /* __APPLE__ */

#include <sys/time.h>
#include <sys/param.h>

#include <netinet/in.h>

#ifndef INADDR_LOOPBACK
#define       INADDR_LOOPBACK         (u_long)0x7F000001
#endif
#ifndef MAXHOSTNAMELEN
#define        MAXHOSTNAMELEN  64
#endif

#endif /* rpc/types.h */

#endif /* __CYGWIN__ */

再去exit 2试试结果:

结果错误还是依旧。

3.此刻,才注意到,此处的问题,是在:

Installing C library的Building C library出现的:

rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

和之前:

【已解决】cygwin中编译crosstool-ng在eglibc 2.17中的rpc_parse.c出错:rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

的,在:

Installing C library headers & start files

Installing C library headers

中出现的:

rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

错误现象是一样,但是出现的阶段是不一样的。

即,还不是同一个错误的。

4.此处,怀疑是:

gcc去编译:rpc_parse.c去生成:

.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_parse.o

时,此处只去修改rpc_parse.c内部所包含的rpc/types.h,但是gcc是找不到的。

因为不是makefile中所指定了:

rpc_parse.c

所依赖

rpc/types.h

所以,还是用的是就的rpc_parse.c

但是突然发现,此处,还是要去include最新的

rpc/types.h

的,所以,如果修改后,应该可以找到的。

5.此处,故意先把:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

改错,比如:

//#ifndef __u_char_defined
/*
 * OS X and Cygwin already has these <sys/types.h>
 */
# if nd ef __CYGWIN__ //add for check for __CYGWIN__

看看是否会报此76行出错。

结果的确报错了:

[ERROR]  ../sunrpc/rpc/types.h:76:9: error: missing binary operator before token "ef"

说明此处的确是调用的此:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

6.还是改为:

//#ifndef __u_char_defined
/*
 * OS X and Cygwin already has these <sys/types.h>
 */
#ifndef __CYGWIN__ //add for check for __CYGWIN__
#ifndef __APPLE__
# ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
//# define __u_char_defined
//#endif
#  define __u_char_defined
# endif
 
#ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
//# define __daddr_t_defined
//#endif
#  define __daddr_t_defined
# endif

#endif /* __APPLE__ */
#endif /* __CYGWIN__ */

#include <sys/time.h>
#include <sys/param.h>

#include <netinet/in.h>

#ifndef INADDR_LOOPBACK
#define       INADDR_LOOPBACK         (u_long)0x7F000001
#endif
#ifndef MAXHOSTNAMELEN
#define        MAXHOSTNAMELEN  64
#endif

#endif /* rpc/types.h */

看看结果:

结果错误依旧。

7.去搜:

__u_char_defined

而找到:

(1)

http://enduser.subsignal.org/~trondah/tree/toolchain/eglibc/patches/2.15/100-fix_cross_rpcgen.patch

其中有:

--- a/libc/sunrpc/rpc/types.h
+++ b/libc/sunrpc/rpc/types.h
@@ -70,18 +70,23 @@ typedef unsigned long rpcport_t;
 #endif
 
 #ifndef __u_char_defined
-typedef __u_char u_char;
-typedef __u_short u_short;
-typedef __u_int u_int;
-typedef __u_long u_long;
-typedef __quad_t quad_t;
-typedef __u_quad_t u_quad_t;
-typedef __fsid_t fsid_t;
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#if __WORDSIZE == 64
+typedef long int quad_t;
+typedef unsigned long int u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+typedef long long int quad_t;
+typedef unsigned long long int u_quad_t;
+#endif
+typedef u_quad_t fsid_t;
 # define __u_char_defined
 #endif
-#ifndef __daddr_t_defined
-typedef __daddr_t daddr_t;
-typedef __caddr_t caddr_t;
+#if !defined(__daddr_t_defined) && defined(linux)
+typedef long int daddr_t;
+typedef char *caddr_t;
 # define __daddr_t_defined
 #endif
 

所以,对照着,先去看看,我此处是否有此patch:

看到:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0\patches\eglibc\2_15

下面只有:

100-Remove-test-for-__builtin_expect.patch

所以是没有改patch的。

(2)另外,找到很多eglibc的mailinglist,结果却都打不开:

http://www.eglibc.org/archives/patches/msg01116.html

http://www.eglibc.org/archives/patches/msg01118.html

http://www.eglibc.org/archives/patches/msg01117.html

 

所以,打算把上述的内容手动合并到此处。

不过又从:

http://enduser.subsignal.org/~trondah/tree/toolchain/eglibc/patches/2.15/

发现,原来不止一个patch:

001-fix_autoconf_macro.patch                       07-Jun-2012 15:02                1539
050-all_glibc-2.14-leak-revert-crash.patch         26-Jun-2013 01:22                3826
100-fix_cross_rpcgen.patch                         07-Jun-2012 15:02                2090
110-fix_cross_zic.patch                            07-Jun-2012 15:02                 708
120-use_host_cflags.patch                          31-Oct-2012 08:26                 885
200-add-dl-search-paths.patch                      07-Jun-2012 15:02                 367

 

注:

另外也发现,eglibc的其他版本的patch的:

http://enduser.subsignal.org/~trondah/tree/toolchain/eglibc/patches/2.16/

http://enduser.subsignal.org/~trondah/tree/toolchain/eglibc/patches/2.17/

8.所以,干脆,把上面一堆的patch,都下载下来,然后拷贝到:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0\patches\eglibc\2_15

中,这样就有了:

001-fix_autoconf_macro.patch

050-all_glibc-2.14-leak-revert-crash.patch

100-fix_cross_rpcgen.patch

100-Remove-test-for-__builtin_expect.patch

110-fix_cross_zic.patch

120-use_host_cflags.patch

200-add-dl-search-paths.patch

然后再重新ct-ng clean:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng clean
  CLEAN config
  CLEAN config.gen
  CLEAN log

后,重新编译,看看是否可以彻底的解决此问题。

正在编译。

但是貌似刚才忘了删除:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\.eglibc-2_15.extracted

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\.eglibc-2_15.patched

所以,估计到时候还是会出错,所以:

如果出错,则去:

删除:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15

再删除

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\.eglibc-2_15.extracted

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\.eglibc-2_15.patched

然后exit 2,重新编译,试试,

然后,看了对应的log是:

[ALL  ]    arm-arm920t-linux-gnueabi-gcc     rpc_sample.c -c -std=gnu99 -fgnu89-inline -O -O2 -U_FORTIFY_SOURCE -Wall -Winline -Wwrite-strings -fmerge-all-constants -march=armv4t -mlittle-endian -msoft-float -mtune=arm920t -Wstrict-prototypes        -I../include -I/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc -I/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final -I../ports/sysdeps/arm/elf -I../ports/sysdeps/unix/sysv/linux/arm/eabi/nptl -I../ports/sysdeps/unix/sysv/linux/arm/eabi -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/eabi -I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports  -I.. -I../libio -I. -nostdinc -isystem /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/include -isystem /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/include-fixed -isystem /home/develop/crosstool-ng/x-tools/arm-arm920t-linux-gnueabi/arm-arm920t-linux-gnueabi/sysroot/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h   -DNOT_IN_libc=1    -D_RPC_THREAD_SAFE_ -o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_sample.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_sample.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_sample.o
[ALL  ]    gcc rpc_main.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_main.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_main.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_main.o
[ALL  ]    gcc rpc_hout.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_hout.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_hout.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_hout.o
[ALL  ]    gcc rpc_cout.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_cout.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_cout.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_cout.o
[ALL  ]    gcc rpc_parse.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_parse.o
[ALL  ]    gcc rpc_scan.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_scan.o
[ALL  ]    gcc rpc_util.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_util.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_util.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_util.o
[ALL  ]    gcc rpc_svcout.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_svcout.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_svcout.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_svcout.o
[ALL  ]    gcc rpc_clntout.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_clntout.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_clntout.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_clntout.o
[ALL  ]    gcc rpc_tblout.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_tblout.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_tblout.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_tblout.o
[ALL  ]    gcc rpc_sample.c -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ 		-o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_sample.o -MD -MP -MF /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_sample.o.dt -MT /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_sample.o
[ALL  ]    arm-arm920t-linux-gnueabi-gcc     -nostdlib -nostartfiles -o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpcgen  -Wl,-dynamic-linker=/lib/ld-linux.so.3   -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/csu/crt1.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/csu/crti.o `arm-arm920t-linux-gnueabi-gcc      --print-file-name=crtbegin.o` /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_main.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_hout.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_cout.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_parse.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_scan.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_util.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_svcout.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_clntout.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_tblout.o /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/rpc_sample.o  -Wl,-rpath-link=/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/math:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/elf:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/dlfcn:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/nss:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/nis:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/rt:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/resolv:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/crypt:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/nptl /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/libc.so.6 /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/libc_nonshared.a -Wl,--as-needed /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed `arm-arm920t-linux-gnueabi-gcc      --print-file-name=crtend.o` /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/csu/crtn.o

感觉好像是解决了此问题了。

但是还是要去确认一下:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

中的内容,结果却是,的确就是之前手动修改的:

//#ifndef __u_char_defined
/*
 * OS X and Cygwin already has these <sys/types.h>
 */
#ifndef __CYGWIN__ //add for check for __CYGWIN__
#ifndef __APPLE__
# ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
//# define __u_char_defined
//#endif
#  define __u_char_defined
# endif
 
#ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
//# define __daddr_t_defined
//#endif
#  define __daddr_t_defined
# endif

#endif /* __APPLE__ */
#endif /* __CYGWIN__ */

而不是上面的打了补丁:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0\patches\eglibc\2_15\100-fix_cross_rpcgen.patch

后的内容。

感觉是:

还是重新编译,使得此处的:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

真正的生效了。

而之前的,貌似没有生效。

或者是对应的rpc_parse.o

或者是其他相关的文件,是用未修改

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

之前的版本,编译出来的,所以出错。

 

 

【总结】

此处,在Installing C library的Building C library出现:

rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

的错误,的原因是:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

是和之前:

遇到类似的,有问题的。

然后经过在crosstool-ng提供的active shell中用exit 2重新编译,结果还是不行的。

最终是

ct-ng clean

后,再重新编译,结果才可以的。

其中:

(1)E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15\sunrpc\rpc\types.h

是之前手动修改过的,为:

//#ifndef __u_char_defined
/*
 * OS X and Cygwin already has these <sys/types.h>
 */
#ifndef __CYGWIN__ //add for check for __CYGWIN__
#ifndef __APPLE__
# ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
//# define __u_char_defined
//#endif
#  define __u_char_defined
# endif
 
#ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
//# define __daddr_t_defined
//#endif
#  define __daddr_t_defined
# endif

#endif /* __APPLE__ */
#endif /* __CYGWIN__ */

(2)没有去删除:

文件夹:E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_15

两个文件:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\.eglibc-2_15.extracted

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\.eglibc-2_15.patched

 


无论如何,至少此处的确是可以正常编译下去了,虽然又出现其他错误:

【未解决】cygwin下编译crosstool-ng在Installing C library的Building C library阶段出错:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_main.o:rpc_main.c:(.text+0x537): undefined reference to `_libintl_gettext’



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量