-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
errors in dns.c while compiling PHP #1
Comments
Read this : https://github.com/LobbyOS/android-standalone/blob/master/compile/php/README.md It has the solution to the dns.c problem |
Includes seem to be defined between line 23 and line 119 in current ext/standard/dns.c. I'm assuming |
I added it here after including dns.h : https://github.com/php/php-src/blob/master/ext/standard/dns.c#L59 |
Still not working for some reason. Here's the outcome /home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:328:2: error: unknown type name 'HEADER'
HEADER qb1;
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c: In function 'zif_dns_check_record':
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:363:13: error: 'T_MX' undeclared (first use in this function)
int type = T_MX, i;
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:363:13: note: each undeclared identifier is reported only once for each function it appears in
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:383:45: error: 'T_A' undeclared (first use in this function)
if (!strcasecmp("A", rectype)) type = T_A;
^
In file included from /home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:77:0:
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:416:39: error: 'C_IN' undeclared (first use in this function)
i = php_dns_search(handle, hostname, C_IN, type, ans, sizeof(ans));
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/php_dns.h:41:22: note: in definition of macro 'php_dns_search'
res_search(dname, class, type, answer, anslen)
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c: In function 'php_parserr':
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:459:23: error: 'T_ANY' undeclared (first use in this function)
if (type_to_fetch != T_ANY && type != type_to_fetch) {
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c: In function 'zif_dns_get_record':
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:783:2: error: unknown type name 'HEADER'
HEADER *hp;
^
In file included from /home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:77:0:
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:910:41: error: 'C_IN' undeclared (first use in this function)
n = php_dns_search(handle, hostname, C_IN, type_to_fetch, answer.qb2, sizeof answer);
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/php_dns.h:41:22: note: in definition of macro 'php_dns_search'
res_search(dname, class, type, answer, anslen)
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:936:10: error: 'HEADER' undeclared (first use in this function)
hp = (HEADER *)&answer;
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:936:18: error: expected expression before ')' token
hp = (HEADER *)&answer;
^
In file included from /home/jason/android-ndk-r13b/platforms/android-16/arch-arm/usr/include/endian.h:31:0,
from /home/jason/android-ndk-r13b/platforms/android-16/arch-arm/usr/include/sys/stat.h:36,
from /home/jason/git-reps/android-standalone/compile/php/src/Zend/zend_stream.h:28,
from /home/jason/git-reps/android-standalone/compile/php/src/Zend/zend.h:41,
from /home/jason/git-reps/android-standalone/compile/php/src/main/php.h:35,
from /home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:24:
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:937:17: error: request for member 'qdcount' in something not a structure or union
qd = ntohs(hp->qdcount);
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:938:17: error: request for member 'ancount' in something not a structure or union
an = ntohs(hp->ancount);
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:939:17: error: request for member 'nscount' in something not a structure or union
ns = ntohs(hp->nscount);
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:940:17: error: request for member 'arcount' in something not a structure or union
ar = ntohs(hp->arcount);
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c: In function 'zif_dns_get_mx':
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:1006:2: error: unknown type name 'HEADER'
HEADER *hp;
^
In file included from /home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:77:0:
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:1044:39: error: 'C_IN' undeclared (first use in this function)
i = php_dns_search(handle, hostname, C_IN, DNS_T_MX, (u_char *)&ans, sizeof(ans));
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/php_dns.h:41:22: note: in definition of macro 'php_dns_search'
res_search(dname, class, type, answer, anslen)
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:1051:8: error: 'HEADER' undeclared (first use in this function)
hp = (HEADER *)&ans;
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:1051:16: error: expected expression before ')' token
hp = (HEADER *)&ans;
^
In file included from /home/jason/android-ndk-r13b/platforms/android-16/arch-arm/usr/include/endian.h:31:0,
from /home/jason/android-ndk-r13b/platforms/android-16/arch-arm/usr/include/sys/stat.h:36,
from /home/jason/git-reps/android-standalone/compile/php/src/Zend/zend_stream.h:28,
from /home/jason/git-reps/android-standalone/compile/php/src/Zend/zend.h:41,
from /home/jason/git-reps/android-standalone/compile/php/src/main/php.h:35,
from /home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:24:
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:1054:37: error: request for member 'qdcount' in something not a structure or union
for (qdc = ntohs((unsigned short)hp->qdcount); qdc--; cp += i + QFIXEDSZ) {
^
/home/jason/git-reps/android-standalone/compile/php/src/ext/standard/dns.c:1060:34: error: request for member 'ancount' in something not a structure or union
count = ntohs((unsigned short)hp->ancount);
^
Makefile:558: recipe for target 'ext/standard/dns.lo' failed
make: *** [ext/standard/dns.lo] Error 1
jason@dev:~/git-reps/android-standalone/compile$ Testing on a fresh install of Ubuntu Server 16.04.1 LTS. Fresh copy of android-ndk-r13b-linux-x86_64, fresh copy of php-7.1.1. Not building with any extensions at this time, just vanilla PHP with
Also, I noticed that setenv.sh has includes for crystax. Are you using Google's Android NDK or CrystaX NDK? Thanks |
|
Nope, not working. I've spent around 30 hours trying to get this to build to the same result. Please let me know if there is more information that I can give you to help resolve this. What Linux distro are you using to successfully compile this? What NDK version? Can you post a copy of the PHP Makefile from the php/SRC dir of your working build tree, and a copy of the working dns.c file that you use? It has to be something simple, but I'm at a loss at this point. |
I understand the frustation. I also spent more than 30 hours for compiling PHP.
|
Compiling using Ubuntu and new NDK. Complaining about unrecognized vars/functions (HEAD, TX, etc). I get this issue every way that I try compiling PHP for Android and I know that it's due to how NDK/Bionic handles DNS compared to glibc but was hoping your build process would fix the issue. Am I doing something wrong? let me know if your not familiar with this issue and I'll post a copy of the result compiler.
The text was updated successfully, but these errors were encountered: