php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65653 Doesn't seem to compile under _x86_64
Submitted: 2013-09-11 13:19 UTC Modified: 2013-09-12 13:09 UTC
From: ingwie2000 at googlemail dot com Assigned: jimjag (profile)
Status: Closed Package: gnupg (PECL)
PHP Version: 5.5.3 OS: MacOS 10.8.4
Private report: No CVE-ID: None
 [2013-09-11 13:19 UTC] ingwie2000 at googlemail dot com
Description:
------------
I am unable to build the extension under listed PHP version. I am getting the 
following error:

Undefined symbols for architecture x86_64:
 "_gpg_strerror", referenced from:
     _zim_gnupg_keylistiterator_rewind in gnupg_keylistiterator.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cli/php] Error 1

It happens when the complete php-binary is being built. My config flags are:

./configure \
	--prefix=$PREFIX \
	--bindir=$PREFIX/bin \
	--sbindir=$EPREFIX/sbin \
	--libexecdir=$EPREFIX/local/libexec \
	--sysconfdir=$PREFIX/etc \
	--sharedstatedir=$EPREFIX/com \
	--localstatedir=$PREFIX/var \
	--libdir=$PREFIX/lib \
	--includedir=$EPREFIX/local/include \
	--oldincludedir=$PREFIX/local/include \
	--datarootdir=$EPREFIX/local/share \
	--infodir=$EPREFIX/local/share/info \
	--localedir=$EPREFIX/local/share/locale \
	--mandir=$EPREFIX/local/share/man \
	--docdir=$PREFIX/doc/plain \
	--htmldir=$PREFIX/doc/html \
	--dvidir=$PREFIX/doc/dvi \
	--pdfdir=$PREFIX/doc/pdf \
	--psdir=$PREFIX/doc/ps \
	--enable-embed=static \
	--enable-static=yes \
	--with-config-file-path="" \
	--with-config-file-scan-dir="" \
	--enable-maintainer-zts \
	--enable-pthreads \
	--with-ssh2 \
	--enable-mbstring \
	--enable-sockets \
	--enable-ftp \
	--enable-soap \
	--enable-zip \
	--enable-opcache \
	--with-tidy \
	--with-libedit \
	--with-curl=/usr/local \
	--with-mcrypt \
	--with-gd \
	--with-pear \
	--with-libedit \
	--enable-intl \
	--enable-soap \
	--enable-libxml

pthreads can be found on github if interested.

Test script:
---------------
cd php-5.5.3/ext
mkdir gnupg
curl -O {download link to latest version}
tar xvfz gnupg
rm *.xml
mv -Rv gnupg-1.3.3/* .
rm -Rvfd gnupg-1.3.3
cd ../../
rm configure
./buildconf --force
export PREFIX=...
./configure \
	--prefix=$PREFIX \
	--bindir=$PREFIX/bin \
	--sbindir=$EPREFIX/sbin \
	--libexecdir=$EPREFIX/local/libexec \
	--sysconfdir=$PREFIX/etc \
	--sharedstatedir=$EPREFIX/com \
	--localstatedir=$PREFIX/var \
	--libdir=$PREFIX/lib \
	--includedir=$EPREFIX/local/include \
	--oldincludedir=$PREFIX/local/include \
	--datarootdir=$EPREFIX/local/share \
	--infodir=$EPREFIX/local/share/info \
	--localedir=$EPREFIX/local/share/locale \
	--mandir=$EPREFIX/local/share/man \
	--docdir=$PREFIX/doc/plain \
	--htmldir=$PREFIX/doc/html \
	--dvidir=$PREFIX/doc/dvi \
	--pdfdir=$PREFIX/doc/pdf \
	--psdir=$PREFIX/doc/ps \
	--enable-embed=static \
	--enable-static=yes \
	--with-config-file-path="" \
	--with-config-file-scan-dir="" \
	--enable-maintainer-zts \
	--enable-pthreads \
	--with-ssh2 \
	--enable-mbstring \
	--enable-sockets \
	--enable-ftp \
	--enable-soap \
	--enable-zip \
	--enable-opcache \
	--with-tidy \
	--with-libedit \
	--with-curl=/usr/local \
	--with-mcrypt \
	--with-gd \
	--with-pear \
	--with-libedit \
	--enable-intl \
	--enable-soap \
	--enable-libxml && make

Expected result:
----------------
The php-binary should compile, but appearently it does not.

Actual result:
--------------
Compiling breaks at said point, at the cli-binary. Will most possibly fail on 
every other binary too.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-12 11:49 UTC] jimjag@php.net
gpg_strerror is part of the libgcrypt package, and as such you should have gpg-
error installed (http://www.gnupg.org/related_software/libgpg-error/)

You can check via the below:

% libgcrypt-config --libs
-L/usr/local/lib -lgcrypt -lgpg-error
 [2013-09-12 11:59 UTC] ingwie2000 at googlemail dot com
I did what you said and get the exact same output.

I am currently lurking thru gpgme.h, where i find a similar function name just 
named gpgme_strerror instead. I am trying to rename it, and re-try a compile.

Anything else I should test/try?
 [2013-09-12 12:32 UTC] ingwie2000 at googlemail dot com
Here is what I had in my env:


TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
CPPFLAGS=-I/usr/local/lib/gnupg
TMPDIR=/var/folders/r0/k8ytfc6j0fl13f3sh7jtkz440000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-2fQhRV/Render
TERM_PROGRAM_VERSION=309
OLDPWD=/Users/Ingwie/Work/drag0n-php/ext
TERM_SESSION_ID=A2288A4E-0202-4C8A-BB93-0E4E8AD880CC
USER=Ingwie
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-tDdcpg/Listeners
Apple_Ubiquity_Message=/tmp/launch-j2yaZQ/Apple_Ubiquity_Message
__CF_USER_TEXT_ENCODING=0x1F5:0:3
LIBS=-lgcrypt
PATH=/Applications/drag0n/drag0n.app/Contents/System/bin:/usr/bin:/bin:/usr/sbin:/
sbin:/usr/local/bin:/opt/X11/bin:/Users/Ingwie/Work/bin:/Users/Ingwie/Work/chromiu
m/depot_tools
PWD=/Users/Ingwie/Work/drag0n-php
LANG=de_DE.UTF-8
HOME=/Users/Ingwie
SHLVL=1
LOGNAME=Ingwie
DISPLAY=/tmp/launch-2zx52I/org.macosforge.xquartz:0
_=/usr/bin/printenv

in config.m4, the -lgcrypt wasnt included at all. It still doesnt work though
 [2013-09-12 12:50 UTC] ingwie2000 at googlemail dot com
So appearently, the config.m4 is really missleading :)
This solved my issues:

export LIBS="$(gpgme-config --libs) $(libgcrypt-config --libs)"

The returned string is:

-L/usr/local/lib -lgpgme -lassuan -lgpg-error -L/usr/local/lib -lgcrypt -lgpg-
error

And that actually links to the correct libraries.

Besides, the config.m4 tries to use a folder like /usr/local/include/lib - which 
is faulty in every manner. Using the little trickery above in the future update 
should work this out.
 [2013-09-12 13:09 UTC] jimjag@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: jimjag
 [2013-09-12 13:09 UTC] jimjag@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

That's what EXTRA_LIBS is for. Sure, config could be smarter in finding libs, but 
it's not a bug per se but is due to how gpgme is installed, etc.
 [2013-09-12 13:29 UTC] ingwie2000 at googlemail dot com
I didnt find that page before O.o must have overseen it.
Well at least it works now. will fork on github with my fixes.
Thanks for the support anyway!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC