php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66907 Solaris 10 is missing strcasestr and needs substitute
Submitted: 2014-03-14 15:34 UTC Modified: 2014-05-04 19:37 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dam at opencsw dot org Assigned: ab
Status: Closed Package: Compile Failure
PHP Version: 5.6.0alpha3 OS: Solaris
Private report: No CVE-ID:
 [2014-03-14 15:34 UTC] dam at opencsw dot org
Description:
------------
The compilation on Solaris 10 Sparc with Sun Studio 12 is failing with the following link error:

ompile /opt/SUNWspro/bin/cc  -Iext/mysqli/ -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/ext/mysqli-5.6.0alpha3/ext/date/lib -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/ext/ereg/regex -I/opt/csw/include/libxml2 -I/opt/csw/include -I/opt/csw/X11 -I/opt/csw/include/freetype2 -I/opt/csw/include/imap -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/ext/mbstring/oniguruma -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/ext/mbstring/libmbfl -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/ext/mbstring/libmbfl/mbfl -I/opt/csw/include/mysql -I/opt/csw/include/pspell -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5nstall cp ext/tokenizer/tokenizer.la /home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/modules
/bin/bash /home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/libtool --silent --preserve-dup-deps --mode=compile /opt/SUNWspro/bin/cc  -Iext/wddx/ -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/ext/wddx/ -DPHP_ATOM_INC -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/include -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/main -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3 -I/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/ext/date/lib -I/homegformat/msgformat_format.lo ext/intl/msgformat/msgformat_helpers.lo ext/intl/msgformat/msgformat_parse.lo ext/intl/grapheme/grapheme_string.lo ext/intl/grapheme/grapheme_util.lo ext/intl/resourcebundle/resourcebundle.lo ext/intl/resourcebundle/resourcebundle_class.lo ext/intl/resourcebundle/resourcebundle_iterator.lo ext/intl/transliterator/transliterator.lo ext/intl/transliterator/transliterator_class.lo ext/intl/transliterator/transliterator_methods.lo ext/intl/timezone/timezone_class.lo ext/intl/timezone/timezone_methods.lo ext/intl/calendar/calendar_class.lo ext/intl/calendar/calendar_methods.lo ext/intl/calendar/gregoriancalendar_methods.lo ext/intl/breakiterator/breakiterator_class.lo ext/intl/breakiterator/breakiterator_iterators.lo ext/intl/breakiterator/breakiterator_methods.lo ext/intl/breakiterator/rulebasedbreakiterator_methods.lo ext/intl/breakiterator/codepointiterator_internal.lo ext/intl/breakiterator/codepointiterator_methods.lo ext/intl/idn/idn.lo ext/intl/spoofchecker/spoofchecker_class.lo ext/intl/spoofchecker/spoofchecker.lo ext/intl/spoofchecker/spoofchecker_create.lo ext/intl/spoofchecker/spoofchecker_main.lo ext/reflection/php_reflection.lo ext/simplexml/simplexml.lo ext/simplexml/sxe.lo ext/spl/php_spl.lo ext/spl/spl_functions.lo ext/spl/spl_engine.lo ext/spl/spl_iterators.lo ext/spl/spl_array.lo ext/spl/spl_directory.lo ext/spl/spl_exceptions.lo ext/spl/spl_observer.lo ext/spl/spl_dllist.lo ext/spl/spl_heap.lo ext/spl/spl_fixedarray.lo ext/standard/crypt_freesec.lo ext/standard/crypt_blowfish.lo ext/standard/crypt_sha512.lo ext/standard/crypt_sha256.lo ext/standard/php_crypt_r.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/sha1.lo ext/standard/user_filters.lo ext/standard/uuencode.lo ext/standard/filters.lo ext/standard/proc_open.lo ext/standard/streamsfuncs.lo ext/standard/http.lo ext/standard/password.lo ext/xml/xml.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/fopen_wrappers.lo main/alloca.lo main/php_scandir.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/network.lo main/php_open_temporary_file.lo main/output.lo main/getopt.lo main/streams/streams.lo main/streams/cast.lo main/streams/memory.lo main/streams/filter.lo main/streams/plain_wrapper.lo main/streams/userspace.lo main/streams/transports.lo main/streams/xp_socket.lo main/streams/mmap.lo main/streams/glob_wrapper.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_dtrace.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_vm_opcodes.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_gc.lo Zend/zend_closures.lo Zend/zend_float.lo Zend/zend_string.lo Zend/zend_signal.lo Zend/zend_generators.lo Zend/zend_virtual_cwd.lo Zend/zend_ast.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo main/internal_functions_cli.lo sapi/cli/php_cli.lo sapi/cli/php_http_parser.lo sapi/cli/php_cli_server.lo sapi/cli/ps_title.lo sapi/cli/php_cli_process_title.lo -lcrypt -lexpat -lresolv -lstdc++ -lz -lrt -lm -lnsl -lsocket -lxml2 -lz -liconv -lm -lsocket -lnsl -lm -licui18n -licuuc -licudata -lm -licuio -lxml2 -lz -liconv -lm -lsocket -lnsl -lcrypt  -o sapi/cli/php
Undefined                       first referenced
 symbol                             in file
strcasestr                          ext/fileinfo/libmagic/.libs/readcdf.o
ld: fatal: symbol referencing errors. No output written to sapi/cli/php
Makefile:347: recipe for target 'sapi/cli/php' failed
gmake: *** [sapi/cli/php] Error 1
gmake: Leaving directory '/home/dam/mgar/pkg/php5/branches/php-5.6.x/work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3'
/home/dam/mgar/pkg/.buildsys/v2/gar//gar.lib.mk:877: recipe for target 'build-work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/Makefile' failed
gmake[1]: *** [build-work/solaris10-sparc/build-isa-sparcv8plus-sapi-cgi/php-5.6.0alpha3/Makefile] Error 2

Solaris 10 does not have strcasestr and needs a substitute as described e.g. here:
  http://notmuchmail.org/pipermail/notmuch/2010/002232.html

Best regards -- Dago


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-06 18:55 UTC] rainer dot jung at kippdata dot de
Same problem here. Analysis is correct.

The problem is due to the libmagic update to version 5.17 in commit 967a6771d35791a1a094efbf61ff89c58e874d7f.

The upstream distribution of libmagic does contain a file file-5.17/src/strcasestr.c implementing the missing function.

Regards,

Rainer
 [2014-04-14 07:50 UTC] ab@php.net
-Assigned To: +Assigned To: ab
 [2014-04-15 17:25 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=aaf197180a47d3fe9dfc8a25acdf89c0a7bca059
Log: Fixed bug #66907 Solaris 10 is missing strcasestr and needs substitute
 [2014-04-15 17:25 UTC] ab@php.net
-Status: Assigned +Status: Closed
 [2014-04-15 17:26 UTC] ab@php.net
@ dam at opencsw dot org
@ rainer dot jung at kippdata dot de

Please test this on solaris as i still had no chance to test it there.

Thanks
 [2014-04-20 18:38 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=aaf197180a47d3fe9dfc8a25acdf89c0a7bca059
Log: Fixed bug #66907 Solaris 10 is missing strcasestr and needs substitute
 [2014-04-20 18:39 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=aaf197180a47d3fe9dfc8a25acdf89c0a7bca059
Log: Fixed bug #66907 Solaris 10 is missing strcasestr and needs substitute
 [2014-05-01 14:59 UTC] tyrael@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=aaf197180a47d3fe9dfc8a25acdf89c0a7bca059
Log: Fixed bug #66907 Solaris 10 is missing strcasestr and needs substitute
 [2014-05-03 08:58 UTC] rainer dot jung at kippdata dot de
Tested with PHP 5.6.0 beta 2.
Looks OK except for a minor bug in upstream code: strcasestr.c on Solaris needs stdint.h.

Reported upstream as

http://bugs.gw.com/view.php?id=350

Patch suggested there is:

--- src/strcasestr.c 2013-12-05 17:57:50.000000000 +0100
+++ src/strcasestr.c 2014-05-03 10:46:57.529254000 +0200
@@ -39,6 +39,9 @@

 #include <assert.h>
 #include <ctype.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
 #include <string.h>

 static int

I hope it will be included in file 5.19.
 [2014-05-04 19:37 UTC] ab@php.net
@ rainer dot jung at kippdata dot de

Thanks for staying tuned. I've pushed a fix for this, please test.

Thanks.
 [2014-05-04 20:56 UTC] rainer dot jung at kippdata dot de
Tested 031cafd4e2670992f5e45d281ab3a5eb666748c5, learned about php_stdint.h and the result looks good. Thanks for the fix!
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Wed Feb 22 06:01:36 2017 UTC