# GCC troubles in FreeBSD 9



## Roxpace (Oct 29, 2012)

Hi,

I have an installation of GCC on FreeBSD 9 which I suspect is broken somewhere, it all happend after I installed a webalizer package which started to install a new compiler.

I can compile most ports but with anything that is related with PHP I can not compile at all.

I am getting errors like the following here:

*For PHP5-Session:*

```
gcc46 -I. -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session -DPHP_ATOM_INC -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session/include -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session/main -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c  -fPIC -DPIC -o .libs/session.o
 gcc46 -I. -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session -DPHP_ATOM_INC -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session/include -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session/main -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/www/php5-session/work/php-5.4.7/ext/session/mod_mm.c  -fPIC -DPIC -o .libs/mod_mm.o
 gcc46 -I. -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session -DPHP_ATOM_INC -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session/include -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session/main -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/www/php5-session/work/php-5.4.7/ext/session/mod_user.c  -fPIC -DPIC -o .libs/mod_user.o
 gcc46 -I. -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session -DPHP_ATOM_INC -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session/include -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session/main -I/usr/ports/www/php5-session/work/php-5.4.7/ext/session -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/www/php5-session/work/php-5.4.7/ext/session/mod_files.c  -fPIC -DPIC -o .libs/mod_files.o
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c: In function 'php_session_cache_limiter':
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1129:39: warning: initialization makes pointer from integer without a cast [enabled by default]
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c: In function 'php_session_send_cookie':
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1169:39: warning: initialization makes pointer from integer without a cast [enabled by default]
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c: In function 'zif_session_set_save_handler':
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1599:3: error: unknown type name 'php_shutdown_function_entry'
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1634:27: error: request for member 'arg_count' in something not a structure or union
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1635:27: error: request for member 'arguments' in something not a structure or union
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1639:27: error: request for member 'arguments' in something not a structure or union
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1644:5: error: request for member 'arguments' in something not a structure or union
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c: In function 'zif_session_register_shutdown':
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1930:2: error: unknown type name 'php_shutdown_function_entry'
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1940:25: error: request for member 'arg_count' in something not a structure or union
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1941:25: error: request for member 'arguments' in something not a structure or union
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1945:25: error: request for member 'arguments' in something not a structure or union
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:1949:3: error: request for member 'arguments' in something not a structure or union
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c: In function 'zm_startup_session':
/usr/ports/www/php5-session/work/php-5.4.7/ext/session/session.c:2185:2: error: too many arguments to function 'zend_register_auto_global'
/usr/local/include/php/Zend/zend_compile.h:605:14: note: declared here
*** Error code 1
1 error
```

*For ROUNDCUBE (which also using PHP5-Session):*

```
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:213:1: error: unknown type name 'php_output_handler'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:214:53: error: unknown type name 'php_output_context'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:327:1: error: unknown type name 'php_output_handler'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: In function 'php_iconv_output_handler_init':
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:329:76: error: 'php_iconv_output_handler' undeclared (first use in this function)
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:329:76: note: each undeclared identifier is reported only once for each function it appears in
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: At top level:
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:332:53: error: unknown type name 'php_output_context'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: In function '_php_iconv_appendl':
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:401:4: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: In function 'php_iconv_string':
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:569:3: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: In function '_php_iconv_strlen':
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:683:3: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: In function '_php_iconv_substr':
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:804:3: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: In function '_php_iconv_strpos':
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:936:3: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: In function '_php_iconv_mime_encode':
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:1185:6: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:1285:6: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c: In function 'php_iconv_stream_filter_append_bucket':
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:2558:4: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
/usr/ports/converters/php5-iconv/work/php-5.4.7/ext/iconv/iconv.c:2637:6: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
/usr/local/include/iconv.h:83:15: note: expected 'const char **' but argument is of type 'char **'
*** Error code 1
1 error
```

Does anyone have any clue how to solve this? The most works perfectly to compile, but PHP is no no anymore


----------



## xibo (Nov 4, 2012)

Probably it can be fixed by using the base system's GCC instead of port's one. The error messages look like they are indicating poor code in the php package rather then a gcc bug, and more recent GCC versions became "stricter" about it than the historic one that is part of FreeBSD.


----------



## Roxpace (Nov 7, 2012)

Did what you told me and used the old original compiler of FreeBSD 9 but still same problems with libiconv and more.


----------

