0

I know this question has been asked a thousand times before, because I have read most of the answers and now I am completely lost.

On EC2 AWS AMI

here is my code to build a new glib version

wget https://download.gnome.org/sources/glib/2.47/glib-2.47.4.tar.xz
tar -xJf glib-2.47.4.tar.xz
mkdir /home/_tmp/glib_build
cd /home/_tmp/glib_build
/home/_tmp/glib-2.47.4/configure --prefix=/home/NewBin
make -j ${MAXCORES}
sudo make install

All seems to build fine as a lot files end up in /home/NewBin and no error in the log.

I then try to build HHVM from source with the following,

export LD_LIBRARY_PATH=/home/NewBin/lib:$LD_LIBRARY_PATH
sudo ldconfig 
cmake -DENABLE_ZEND_COMPAT=ON .
make -j ${MAXCORES}

the following error is returned

cmake -DENABLE_ZEND_COMPAT=ON .
cmake: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by cmake)
cmake: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by cmake)
+ make -j 40
make: relocation error: /home/_bin/lib/libc.so.6: symbol _dl_find_dso_for_object, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

if I run the code WITHOUT the LD_LIBRARY_PATH

sudo ldconfig 
cmake -DENABLE_ZEND_COMPAT=ON .
make -j ${MAXCORES}

I get the following error

cmake: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by cmake)
cmake: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by cmake)
+ make -j 40
make: *** No targets specified and no makefile found.  Stop.

How do I point the make to the new glib version?

ptomato
  • 56,175
  • 13
  • 112
  • 165
art vanderlay
  • 2,341
  • 4
  • 35
  • 64

1 Answers1

3

You appear to have 3 distinct problems, none which actually have anything to do with GLIB.

The most serious problem is that you don't understand what you are doing, and "Furious activity is no substitute for understanding".

This error:

make: relocation error: /home/_bin/lib/libc.so.6: symbol _dl_find_dso_for_object, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

is caused by the fact that you have installed a private copy of libc.so.6 in your /home/bin/lib. As this answer explains, you need to do quite a bit more if you want to use non-default / non-system libc.so.6. In particular, putting libc.so.6 anywhere on LD_LIBRARY_PATH is a really bad idea(TM).

The last problem is this one:

cmake: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found ...

What this error is telling you is that the version of cmake you are invoking has been built with a later version of g++ than the one you have installed. Specifically, GLIBCXX_4.3.21 was introduced in gcc-5.1 (and your cmake was built with that, or later version of g++), but the system libstdc++.so.6 came from earlier version of GCC.

So, what is the solution?

The easiest approach is to update the whole system to a sufficiently new distribution, where all binaries are built against consistent set of system libraries.

If you can't do that, then you need to gain much deeper understanding of what you are doing, and get much more familiar with configuring and building various binaries and libraries that you need. In particular, you should never set LD_LIBRARY_PATH, and instead add appropriate --rpath=... settings just for the binaries that require non-system library versions to function.

Community
  • 1
  • 1
Employed Russian
  • 199,314
  • 34
  • 295
  • 362