php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50358 Compile failure compiling ext/phar/util.lo
Submitted: 2009-12-02 11:19 UTC Modified: 2010-03-06 15:46 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: yatessc at telkom dot co dot za Assigned: cellog (profile)
Status: Closed Package: PHAR related
PHP Version: 5.3.1 OS: Solaris 9 sparc
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: yatessc at telkom dot co dot za
New email:
PHP Version: OS:

 

 [2009-12-02 11:19 UTC] yatessc at telkom dot co dot za
Description:
------------
Using Sun ONE Studio compiler, not gcc - error output is:

"/usr/local/php-5.3.1/ext/phar/tar.h", line 52: syntax error before or at: (
"/usr/local/php-5.3.1/ext/phar/tar.h", line 52: warning: "typedef" valid only for function declaration
"/usr/local/php-5.3.1/ext/phar/tar.h", line 52: warning: old-style declaration or incorrect type for: old_tar_header
"/usr/local/php-5.3.1/ext/phar/tar.h", line 92: syntax error before or at: (
"/usr/local/php-5.3.1/ext/phar/tar.h", line 92: warning: "typedef" valid only for function declaration
"/usr/local/php-5.3.1/ext/phar/tar.h", line 92: identifier redefined: __attribute__
        current : function() returning struct _tar_header {array[100] of char name, array[8] of char mode, array[8] of char uid, arr
ay[8] of char gid, array[12] of char size, array[12] of char mtime, array[8] of char checksum, char typeflag, array[100] of char lin
kname, array[6] of char magic, array[2] of char version, array[32] of char uname, array[32] of char gname, array[8] of char devmajor
, array[8] of char devminor, array[155] of char prefix, array[12] of char padding}
        previous: function() returning struct _old_tar_header {array[100] of char name, array[8] of char mode, array[8] of char uid,
 array[8] of char gid, array[12] of char size, array[12] of char mtime, array[8] of char checksum, char link, array[100] of char lin
kname} : "/usr/local/php-5.3.1/ext/phar/tar.h", line 52
"/usr/local/php-5.3.1/ext/phar/tar.h", line 92: warning: old-style declaration or incorrect type for: tar_header
cc: acomp failed for /usr/local/php-5.3.1/ext/phar/util.c
*** Error code 1

This appears to be related to #46072, but the fix for that does not work directly on Solaris.  It appears to be due to the
# define PHAR_TAR_PACK __attribute__((__packed__))
in line 28 of ext/phar/tar.h - all other uses of __attribute__ in various PHP sources are wrapped with
#if defined(__GNUC__) && __GNUC__ >= 4
and reproducing that here also allows compilation to succeed.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-02 12:10 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-12-02 15:39 UTC] yatessc at telkom dot co dot za
Unfortunately till fails with the same errors (using snapshot php5.3-200912021330).

I can get it to compile by changing the define in tar.h from:

#ifdef PHP_WIN32
#pragma pack(1)
# define PHAR_TAR_PACK
#elif defined(__sgi)
# define PHAR_TAR_PACK
#else
# define PHAR_TAR_PACK __attribute__((__packed__))
#endif

to

#ifdef PHP_WIN32
#pragma pack(1)
# define PHAR_TAR_PACK
#elif defined(__sgi)
# define PHAR_TAR_PACK
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHAR_TAR_PACK __attribute__((__packed__))
#else
# define PHAR_TAR_PACK
#endif

although I have not yet tested the functioning of the PHAR extension (busy running the tests).
 [2010-03-06 15:46 UTC] felipe@php.net
-Status: Assigned +Status: Closed
 [2010-03-06 15:46 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC