php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21346 Config fails: checking size of char
Submitted: 2003-01-02 13:39 UTC Modified: 2003-01-03 08:16 UTC
From: vlcc69jfbo001 at sneakemail dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4.3.0 OS: OpenBSD 3.1-stable
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vlcc69jfbo001 at sneakemail dot com
New email:
PHP Version: OS:

 

 [2003-01-02 13:39 UTC] vlcc69jfbo001 at sneakemail dot com
This error seemed to appear with 4.3.0 final - I compiled a 
new version just a few days ago without seeing this error 
during configure:

checking size of char... configure: error: cannot compute 
sizeof (char), 77

My configure command is:

./configure --with-apxs=/usr/sbin/apxs 
--with-mysql=/usr/local --with-pdflib --enable-exif 
--with-gd --with-jpeg-dir=/usr/local/bin --with-bz2 
--with-zlib --with-openssl --with-gettext --with-ldap 
--with-mhash --disable-overload --enable-sockets 
--with-mcrypt --enable-sysvshm --enable-pcntl 
--with-config-file-path=/var/www/conf/php43/ 
--enable-mbstring --with-pear=/usr/local/lib/php 
--enable-bcmath --with-imagick

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-02 20:53 UTC] iliaa@php.net
If you do not use the --with-imagick (how did you get it btw?) does it compile properly?
 [2003-01-03 03:05 UTC] vlcc69jfbo001 at sneakemail dot com
Taking --with-imagick off doesn't make any difference.
The imagick module is available through pear at:

http://pear.php.net/package-info.php?pacid=76

I've been using this configure line for several months with 
4.3.0-dev, though I recently removed --with-vpopmail from 
it as I read it's been moved. That shouldn't have anything 
to do with this error though.
 [2003-01-03 03:09 UTC] derick@php.net
Please show us the relevant parts of config.log which show the failure of the char size test.

Derick
 [2003-01-03 04:20 UTC] vlcc69jfbo001 at sneakemail dot com
This appears to be the relevant section:

long longval () { return (long) (sizeof (char)); }
unsigned long ulongval () { return (long) (sizeof (char)); 
}
#include <stdio.h>
#include <stdlib.h>
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (char))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (char))))
        exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (char))))
        exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
configure:58861: error: cannot compute sizeof (char), 77
 [2003-01-03 04:21 UTC] derick@php.net
Can you include the 20 lines above this fragment too? It should give us some more hints.

Derick
 [2003-01-03 04:26 UTC] vlcc69jfbo001 at sneakemail dot com
That was quick!

Here's a bit from above. The shared library message looks 
suspicious - /usr/libexec/ld.so exists, as does 
/usr/local/lib/libiconv.so.2.4. Could this be some kind of 
compiler flag/path problem?

configure:58518: checking for char
configure:58545: gcc -c -g -O2  -DDEV_RANDOM=/dev/arandom 
-DMOD_SSL=208108 -DEAPI -DUSE_EXPAT conftest.c >&5
configure:58548: $? = 0
configure:58551: test -s conftest.o
configure:58554: $? = 0
configure:58564: result: yes
configure:58567: checking size of char
configure:58845: gcc -o conftest -g -O2  
-DDEV_RANDOM=/dev/arandom -DMOD_SSL=208108 -DEAPI 
-DUSE_EXPAT  -R/usr/local/lib -L/usr/local/lib conftest.c 
-lmhash -lmcrypt -lltdl -lldap -llber -lintl -lpng -lz 
-ljpeg -lbz2 -lz -lssl -lcrypto -lm  >&5
configure:58848: $? = 0
configure:58850: ./conftest
/usr/libexec/ld.so: conftest: libiconv.so.2.4: No such file 
or directory
configure:58853: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 58803 "configure"
#include "confdefs.h"
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
#  include <stdint.h>
# endif
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
 [2003-01-03 04:28 UTC] derick@php.net
Can you check if both are in your PATH and if that path is listed in /etc/ld.so.conf? You might also want to run 'ldconfig'.
 [2003-01-03 04:46 UTC] vlcc69jfbo001 at sneakemail dot com
There are no library directories listed in my path (nor 
have there ever been, IIRC); I don't have an 
/etc/ld.so.conf at all; ldconfig runs with no errors, but 
makes no difference.
Hm. I just got a similar error when trying to use something 
else that accessed a different shared library. Looks more 
like it's a config problem at my end, though I have no idea 
why this should suddenly have started happening.
 [2003-01-03 07:05 UTC] vlcc69jfbo001 at sneakemail dot com
Managed to fix this - issuing a bare ldconfig makes it 
forget all library directories except the system default 
(/usr/lib). Issuing an ldconfig earlier had broken access 
to libraries that configure needed. I can't seem to find 
where the system sets up ldconfig at boot time - it's not 
in any of my rc files - but I added /usr/local/lib manually 
and it now works.
Whatever, bug closed, thanks for all your timely help.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 15:01:36 2025 UTC