php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79266 Extern C template error during xmldiff build
Submitted: 2020-02-12 16:55 UTC Modified: 2021-09-19 04:22 UTC
Votes:4
Avg. Score:3.8 ± 1.6
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: matt dot brister at sterlingts dot com Assigned: cmb (profile)
Status: No Feedback Package: xdiff (PECL)
PHP Version: 7.3.14 OS: Ubuntu 18.04
Private report: No CVE-ID: None
 [2020-02-12 16:55 UTC] matt dot brister at sterlingts dot com
Description:
------------
xmldiff version(s): xmldiff 1.1.2, 1.1.1, 1.1.0
PHP 7.3.14-6+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb  5 2020 16:51:32) ( NTS )
Modules installed: calendar Core ctype date dom exif fileinfo filter ftp gettext hash iconv json libxml openssl pcntl pcre PDO Phar posix readline Reflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zlib

**Seems related to: https://bugs.php.net/bug.php?id=76685**

Repro (on a clean install of 18.04):
1. apt update && apt dist-upgrade -y
2. add-apt-repository ppa:ondrej/php
3. apt update && apt install php7.3 php7.3-dev phpxml -y
4. pecl channel-upgrade pecl.php.net
5. pecl install xmldiff -> "recipe for target 'xmldiff.lo' failed"

To confirm, I downloaded the tgz package and tried to manually build:
1. wget https://pecl.php.net/get/xmldiff-1.1.2.tgz
2. tar -xvzf xmldiff-1.1.2.tgz
3. cd xmldiff-1.1.2
4. phpize
5. ./configure
6. make -> "recipe for target 'xmldiff.lo" failed"

I have the full compiler output from the manual build if you would like (it's about 300k, and there is no obvious place to attach it here.)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-02-12 17:57 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2020-02-12 17:57 UTC] nikic@php.net
Please provide the compile error that is printed, there should be something before the "recipe failed", which is just a message from "make".

If you would like to post the full log, I'd suggest https://gist.github.com/
 [2020-02-12 18:05 UTC] matt dot brister at sterlingts dot com
-Status: Feedback +Status: Open
 [2020-02-12 18:05 UTC] matt dot brister at sterlingts dot com
Thanks Nikic! Last 17 lines of output:
In file included from /usr/include/unicode/localpointer.h:45:0,
                 from /usr/include/unicode/uenum.h:23,
                 from /usr/include/unicode/ucnv.h:53,
                 from /usr/include/libxml2/libxml/encoding.h:31,
                 from /usr/include/libxml2/libxml/parser.h:810,
                 from /usr/include/libxml2/libxml/globals.h:18,
                 from /usr/include/libxml2/libxml/threads.h:35,
                 from /usr/include/libxml2/libxml/xmlmemory.h:218,
                 from /usr/include/libxml2/libxml/tree.h:1307,
                 from /usr/include/php/20180731/ext/libxml/php_libxml.h:39,
                 from /home/ubuntu/xmldiff-1.1.2/php_xmldiff.h:67,
                 from /home/ubuntu/xmldiff-1.1.2/xmldiff.cpp:36:
/usr/include/c++/7/memory:135:1: error: template with C linkage
 template <typename _Tp>
 ^~~~~~~~
Makefile:214: recipe for target 'xmldiff.lo' failed
make: *** [xmldiff.lo] Error 1

I see a lot of these, so I am also making the output available here. https://bitbucket.org/snippets/Calvarymatt/6n8BqR
 [2020-08-17 16:16 UTC] antonio at seltzlab dot com
I'm experiencing the same issue on Ubuntu 20.04 and PHP 7.4.3 (cli) (built: May 26 2020 12:24:22) ( NTS )

xmldiff version(s): xmldiff 1.1.2

Running make I got plenty of this error:

/usr/include/unicode/localpointer.h:371:1: error: template with C linkage
  371 | template<typename T>
      | ^~~~~~~~
In file included from /home/antonio/Downloads/xmldiff-1.1.2/xmldiff.cpp:36:
/home/antonio/Downloads/xmldiff-1.1.2/php_xmldiff.h:36:1: note: ‘extern "C"’ linkage started here
   36 | extern "C" {
      | ^~~~~~~~~~
In file included from /usr/include/unicode/uenum.h:23,
                 from /usr/include/unicode/ucnv.h:53,
                 from /usr/include/libxml2/libxml/encoding.h:31,
                 from /usr/include/libxml2/libxml/parser.h:810,
                 from /usr/include/libxml2/libxml/globals.h:18,
                 from /usr/include/libxml2/libxml/threads.h:35,
                 from /usr/include/libxml2/libxml/xmlmemory.h:218,
                 from /usr/include/libxml2/libxml/tree.h:1307,
                 from /usr/include/php/20190902/ext/libxml/php_libxml.h:39,
                 from /home/antonio/Downloads/xmldiff-1.1.2/php_xmldiff.h:67,
                 from /home/antonio/Downloads/xmldiff-1.1.2/xmldiff.cpp:36:
/usr/include/unicode/ucnv.h:585:1: error: conflicting declaration of C function ‘void icu_66::swap(icu_66::LocalUConverterPointer&, icu_66::LocalUConverterPointer&)’
  585 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUConverterPointer, UConverter, ucnv_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/uenum.h:68:1: note: previous declaration ‘void icu_66::swap(icu_66::LocalUEnumerationPointer&, icu_66::LocalUEnumerationPointer&)’
   68 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:212: xmldiff.lo] Error 1
 [2020-11-16 13:40 UTC] cmb@php.net
-Package: Compile Failure +Package: xdiff
 [2021-09-09 13:34 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-09 13:34 UTC] cmb@php.net
Is this still an issue with latest xdiff (2.1.0)?
 [2021-09-19 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 23:01:26 2024 UTC