php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80425 MessageFormatAdapter::getArgTypeList redefined
Submitted: 2020-11-26 14:18 UTC Modified: 2020-11-26 14:49 UTC
From: bjornar dot ness at gmail dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2020-11-26 14:18 UTC] bjornar dot ness at gmail dot com
Description:
------------
libicui18n.a(umsg.ao): In function `icu_68::MessageFormatAdapter::getArgTypeList(icu_68::MessageFormat const&, int&)':
umsg.cpp:(.text+0x20): multiple definition of `icu_68::MessageFormatAdapter::getArgTypeList(icu_68::MessageFormat const&, int&)'
ext/intl/msgformat/msgformat_helpers.o:/usr/src/php-build/install/icu-release-68-1/include/unicode/msgfmt.h:1076: first defined here
collect2: error: ld returned 1 exit status
Makefile:288: recipe for target 'sapi/cli/php' failed
make: *** [sapi/cli/php] Error 1


MessageFormatAdapter::getArgTypeList(icu_68::MessageFormat const&, int&) is defined in:

https://github.com/unicode-org/icu/blob/3d706fac426fe4b4ac5e84b21a8f3bcb4eb5953e/icu4c/source/i18n/umsg.cpp#L51

and

https://github.com/unicode-org/icu/blob/3d706fac426fe4b4ac5e84b21a8f3bcb4eb5953e/icu4c/source/i18n/unicode/msgfmt.h#L1075

(unless compiled with -DUCONFIG_NO_FORMATTING, which makes php not compile against it)

php-src for some reason redefines this function in:
https://github.com/php/php-src/blob/08006e8337ceb9e8d3e6294aa65fb3b4b42d4776/ext/intl/msgformat/msgformat_helpers.cpp#L58

This redefinition is mostly unnoticed unless linked against a static libicu


Patches

remove-duplicate-definition.patch (last revision 2020-11-26 14:22 UTC by bjornar dot ness at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-26 14:22 UTC] bjornar dot ness at gmail dot com
The following patch has been added/updated:

Patch Name: remove-duplicate-definition.patch
Revision:   1606400525
URL:        https://bugs.php.net/patch-display.php?bug=80425&patch=remove-duplicate-definition.patch&revision=1606400525
 [2020-11-26 14:49 UTC] nikic@php.net
Huh, that's a nifty hack. I think it would be better to rename these methods on the PHP side (give them a php prefix or so), so we're not at the mercy of these (entirely internal) methods being defined in icu or not.
 [2020-11-27 09:03 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5240f8391ff30a91a7c07e1611e749807bb14429
Log: Fixed bug #80425
 [2020-11-27 09:03 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 00:01:32 2024 UTC