Android4.0.3 source code build errors : [out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.o] Error 1

Question!

ENV : Ubuntu 14

STATIC_LIBRARIES/libext_intermediates/initext.c:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:9:28: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:16:24: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:27:24: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:40:27: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:45: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:45:23: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:53: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:53:26: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:57: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:57:23: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c: In function 'init_extensions':
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:73: error: 'libxt_CONNMARK' undeclared (first use in this function)
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:73: error: (Each undeclared identifier is reported only once
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:73: error: for each function it appears in.)
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:73:17: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:80: error: 'libxt_DSCP' undeclared (first use in this function)
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:80:13: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:91: error: 'libxt_MARK' undeclared (first use in this function)
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:91:13: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:104: error: 'libxt_rateest' undeclared (first use in this function)
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:104:16: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:109: error: 'libxt_SET' undeclared (first use in this function)
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:109:12: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:117: error: 'libxt_TCPMSS' undeclared (first use in this function)
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:117:15: error: invalid suffix "_init" on integer constant
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:121: error: 'libxt_TOS' undeclared (first use in this function)
out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.c:121:12: error: invalid suffix "_init" on integer constant
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.o] Error 1


Answers

I had the same issue as well, but find nothing in googling. Fortunately, I finally find the answer.

Solution: Rename every .c/.h file that end with -1, to its original name (delete -1) in directory external/iptables/extensions and extenal/iptables/include/linux/netfilter

Cause: This issue is quite corner one. I download a "packed" Android source code without .repo from Internet instead of painfully checking out from google. It is the source code package that cause the error. The source code was checked out to a case-insensitive filesystem, so "duplicated" filename which only differ by capital was renamed by git. For example, there is a xt_mark.h and a xt_MARK.h in the same directory. Git automatically rename the latter file to xt-MARTK-1.h to avoid overwritten, on a case insensitive filesystem.

The external/iptables/extension/libext project, there are many files such as

 libxt_set.c
 libxt_SET.c    => libxt_SET-1.c
 libxt_dscp.c
 libxt_DSCP.c   => libxt_DSCP-1.c

....

These duplicated file name that just with difference in case. It may work in most case, but the project's makefile enumerate every c file with libxt_xxx.c format and generate a init .c file for all them. So in the generated inittext.c, function entries like:

libxt_DSCP-1_init();
libxt_SET-1_init();

were generated. '-' was forbidden in function/variable name.

By : FSD


As you have mentioned html tag in your question, one solution is using jQuery like this:

$( elemement ).attr( "attribute" )  
By : mok


https://docs.python.org/2/library/datetime.html

The datetime module will parse dates, times, or combined date-time values into objects that can be compared.

By : J Earls


This video can help you solving your question :)
By: admin