Я пытаюсь собрать PHP 5.6.17 из исходного кода на FreeBSD 10 с включенной libmcrypt-2.5.8, согласно http://php.net/manual/en/mcrypt.requirements.php . Сборка libmcrypt, кажется, идет нормально, используя make EXTRACFLAGS=-fPIC
:
root@dev% dir /usr/local/lib/*mcry*
-rw-r--r-- 1 root wheel 1033370 Jan 14 11:30 /usr/local/lib/libmcrypt.a
-rwxr-xr-x 1 root wheel 746 Jan 14 11:30 /usr/local/lib/libmcrypt.la
После :
./configure --with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/etc \
--enable-bcmath --without-cdb \
--with-gd --with-mysql=/usr/local/mysql \
--without-iodbc --enable-inline-optimization \
--without-gdbm --with-ndbm --without-db2 \
--without-dbm --without-readline --without-recode \
--with-openssl --without-db3 --enable-dba \
--with-curl --with-jpeg-dir=/usr/local/lib --enable-calendar \
--with-mhash --enable-mbstring=all --with-png-dir=/usr/local/libpng \
--with-zlib --with-freetype-dir=/usr/local/lib \
--with-pdo-mysql=mysqlnd --enable-exif --with-libxml-dir=/usr/local/lib \
--enable-zip \
--with-imap=/usr/local/imap-2007f \
--with-mcrypt
Сконфигурируйте вывод, относящийся к mcrypt:
checking for mcrypt support... yes
checking for libmcrypt version... >= 2.5.6
checking for mcrypt_module_open in -lmcrypt... no
checking for mcrypt_module_open in -lmcrypt... yes
Я получаю эту ошибку, когда делаю
/usr/bin/ld: /usr/local/lib/libmcrypt.a(mcrypt_extra.o): relocation R_X86_64_32 against `mps' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmcrypt.a: could not read symbols: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
Stop.
make: stopped in /usr/local/dev_build_sources/php-5.6.17
Ранее я был в состоянии построить с помощью этих шагов в PHP 5.6.6
Этот вопрос https://serverfault.com/questions/357020/how-can-i-install-enable-mcrypt-without-re-installing-php предложил сделать расширение mcrypt (почему не libmcrypt?), но make mcrypt продолжал работать
EDIT — добавление в результате попытки сделать расширение в PHP-5.6.17 / внутр / Mcrypt кажется, что не в состоянии сказать, что ему нужно -fPI
флаги, но они уже были поставлены ..
root@dev% make EXTRACFLAGS=-fPIC
/bin/sh /usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/libtool --mode=compile cc -I. -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -DPHP_ATOM_INC -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/include -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/main -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/mcrypt.c -o mcrypt.lo
mkdir .libs
cc -I. -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -DPHP_ATOM_INC -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/include -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/main -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/mcrypt.c -fPIC -DPIC -o .libs/mcrypt.o
/bin/sh /usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/libtool --mode=compile cc -I. -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -DPHP_ATOM_INC -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/include -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/main -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/mcrypt_filter.c -o mcrypt_filter.lo
cc -I. -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -DPHP_ATOM_INC -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/include -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/main -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/mcrypt_filter.c -fPIC -DPIC -o .libs/mcrypt_filter.o
/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/mcrypt_filter.c:210:37: warning: passing 'const char *' to
parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
mcrypt_module = mcrypt_module_open(cipher, algo_dir, mode, mode_dir);
^~~~~~
/usr/local/include/mutils/mcrypt.h:38:34: note: passing argument to parameter 'algorithm' here
MCRYPT mcrypt_module_open(char *algorithm,
^
1 warning generated.
/bin/sh /usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/include -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/main -I/usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -o ./mcrypt.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/dev_build_sources/TEMP_PHP/php-5.6.17/ext/mcrypt/modules mcrypt.lo mcrypt_filter.lo -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lmcrypt
cc -shared .libs/mcrypt.o .libs/mcrypt_filter.o -L/usr/local/lib /usr/local/lib/libmcrypt.a -Wl,-rpath -Wl,/usr/local/lib -Wl,-soname -Wl,mcrypt.so -o ./.libs/mcrypt.so
/usr/bin/ld: /usr/local/lib/libmcrypt.a(mcrypt_extra.o): relocation R_X86_64_32 against `mps' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmcrypt.a: could not read symbols: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
Получил это работает:
В исходном каталоге libmcrypt-2.5.8
./configure --disable-posix-threads --with-pic
затем make
без каких-либо флагов
Сборка PHP прошла хорошо с приведенной выше командой настройки и простым make
Других решений пока нет …