php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72953 src/ext/standard/dns.c:328:2: error: unknown type name 'HEADER'
Submitted: 2016-08-27 15:18 UTC Modified: 2016-09-14 12:24 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: subins2000 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Compile Failure
PHP Version: 7.0.10 OS: Ubuntu 16.04 Xenial Xerus
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: subins2000 at gmail dot com
New email:
PHP Version: OS:

 

 [2016-08-27 15:18 UTC] subins2000 at gmail dot com
Description:
------------
This bug is similar to https://bugs.php.net/bug.php?id=51706

But (^) it has been closed. The bug exists for fresh versions of PHP 5.6.25 & PHP 7.0.10

I tried to simply cross compile PHP with this :

./configure --host=arm-linux-androideabi --disable-all

Before doing the above, I set the environment variables :

export ARCH=arm
export TOOLCHAINROOT="/media/simsu/hello/Android/toolchain"
export PATH=$PATH:$TOOLCHAINROOT/bin/
export CC="arm-linux-androideabi-gcc --sysroot=$TOOLCHAINROOT/sysroot"
export CXX="arm-linux-androideabi-g++ --sysroot=$TOOLCHAINROOT/sysroot"

As you can see, I'm using the Android toolchain.

Expected result:
----------------
PHP should compile

Actual result:
--------------
http://pastebin.com/uv7B4tes

Patches

nameser_compat_hack (last revision 2016-08-30 14:05 UTC by cmb@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-30 14:05 UTC] cmb@php.net
struct HEADER and the other missing macros are supposed to be
declared in arpa/nameser_compat.h, which again is supposed to be
included from arpa/nameser.h. However, the Android SDK keeps
arpa/nameser.h intentionally blank[1].

I have some doubts that this is a good idea, and I don't know how
to solve this issue properly for PHP, but for a start you may try
to also include arpa/nameser_compat.h (see the attached patch
nameser_compat_hack).

[1] <https://android.googlesource.com/platform/prebuilts/ndk/+/6d8fd94e317c06e91e93c161bc7da0ca0ffeffb2/5/platforms/android-3/arch-arm/usr/include/arpa/nameser.h>
 [2016-08-30 14:05 UTC] cmb@php.net
The following patch has been added/updated:

Patch Name: nameser_compat_hack
Revision:   1472565957
URL:        https://bugs.php.net/patch-display.php?bug=72953&patch=nameser_compat_hack&revision=1472565957
 [2016-08-30 14:49 UTC] subins2000 at gmail dot com
I applied the patch. But the nameser_compat.h file is not found :

ext/standard/dns.c:51:33: fatal error: arpa/nameser_compat.h: No such file or directory

The Android toolchain doesn't have the nameser_compat.h header file[1]

[1] https://android.googlesource.com/platform/prebuilts/ndk/+/6d8fd94e317c06e91e93c161bc7da0ca0ffeffb2/5/platforms/android-3/arch-arm/usr/include/arpa/
 [2016-09-01 13:06 UTC] cmb@php.net
> The Android toolchain doesn't have the nameser_compat.h header
> file

Then, I'm afraid, we can't do much. :-(
 [2016-09-01 14:19 UTC] subins2000 at gmail dot com
Hey,
   I have decided to not compile using Android toolchain. I have successfully compiled PHP on arm with arm-linux-gnueabi.

One thing, while compiling with it I got an error :

sapi/phpdbg/phpdbg_prompt.o: In function `phpdbg_load_module_or_extension': sapi/phpdbg/phpdbg_prompt.c:1046: undefined reference to `DL_LOAD

It got fixed with this patch : https://patchwork.ozlabs.org/patch/657181/

Should I make a new bug report ?
 [2016-09-01 14:40 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem -Package: Unknown/Other Function +Package: Compile Failure -Assigned To: +Assigned To: cmb
 [2016-09-01 14:40 UTC] cmb@php.net
> I have successfully compiled PHP on arm with arm-linux-gnueabi.

Fine! So I'm marking this as documentation issue.

> Should I make a new bug report ?

Yes, please.
 [2016-09-14 12:24 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=340035
Log: Fix #72953: src/ext/standard/dns.c:328:2: error: unknown type name 'HEADER'
 [2016-09-14 12:24 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2020-02-07 06:06 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=152b2c8aa7997b73343ac61d4610d99deb847391
Log: Fix #72953: src/ext/standard/dns.c:328:2: error: unknown type name 'HEADER'
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC