Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Error: /usr/local/lib/libmemcached.a: could not read symbols: Bad value #3

Closed
sethryder opened this issue Mar 17, 2016 · 4 comments

Comments

@sethryder
Copy link

Hello,

I am attempting to compile the aws-elasticache-cluster-client for PHP 7.0.4.

I have attempted to build it both on the Amazon Linux AMI (Latest) and a normal CentOS 6.7 image and it errors with:

*** Warning: Linking the shared library memcached.la against the
*** static library /usr/local/lib/libmemcached.a is not portable!
libtool: link: cc -shared  .libs/php_memcached.o .libs/php_libmemcached_compat.o .libs/g_fmt.o fastlz/.libs/fastlz.o .libs/php_memcached_session.o   -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib -lz /usr/local/lib/libmemcached.a -lcrypt -lpthread -lm -lstdc++ -lsasl2 /usr/local/lib/libmemcachedutil.so /usr/local/lib/libmemcached.so  -Wl,-rpath -Wl,/usr/local/lib   -pthread -Wl,-soname -Wl,memcached.so -o .libs/memcached.so
/usr/bin/ld: /usr/local/lib/libmemcached.a(libmemcached_libmemcached_la-allocators.o): relocation R_X86_64_32S against `_Z20_libmemcached_mallocPK12memcached_stmPv' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmemcached.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [memcached.la] Error 1

I am attempting to build it statically so I can use it on different hosts. Here is the ./configure line:

./configure --with-libmemcached-dir=/usr/local --disable-memcached-sasl

Along with the MEMCACHED_SHARED_LIBADD line:

MEMCACHED_SHARED_LIBADD = -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lz /usr/local/lib/libmemcached.a -lcrypt -lpthread -lm -lstdc++ -lsasl2 -lmemcachedutil

I am also using aws-elasticache-cluster-client-libmemcached to compile against. Also I have verified that I am using the proper php7 branch.

@sethryder
Copy link
Author

FWIW I also just tried it on Ubuntu 14.04 LTS with the same result.

@QuChen88
Copy link
Contributor

Please try to dynamically link libmemcached during compilation with the updated instructions in README file.

@sethryder
Copy link
Author

It does work when I dynamically link libmemcached.

I am guessing statically building the module is no longer supported in PHP 7 (wanted to easily move it between hosts)?

@QuChen88
Copy link
Contributor

I updated the README instructions for compilation/installation as per previous threads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants