WebFaction
Community site: login faq

My end game is to get HipHop/nginx running on my server. Basically right now I'm chasing down dependencies to get HHVM running (nginx is running).

I haven't had any real issues until trying to install libdwarf

Edit: I've discovered that the necessary elfutils packages are installed by default on Webfaction CentOS6 servers, according to this list of installed packages from the Webfaction site. So I've narrowed the issue to simply getting libdwarf installed.

Here are the commands I'm using to install libdwarf

# cd to temp source folder
wget 'http://www.prevanders.net/libdwarf-20140413.tar.gz'
tar -xzf libdwarf-20140413.tar.gz
cd dwarf-20140413/libdwarf
./configure --prefix=$HOME
make # this is where I get the errors

The configure output:

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking whether gcc needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for ar... ar
checking alloca.h usability... yes
checking alloca.h presence... yes
checking for alloca.h... yes
checking elf.h usability... yes
checking elf.h presence... yes
checking for elf.h... yes
checking elfaccess.h usability... no
checking elfaccess.h presence... no
checking for elfaccess.h... no
checking libelf.h usability... no
checking libelf.h presence... no
checking for libelf.h... no
checking libelf/libelf.h usability... no
checking libelf/libelf.h presence... no
checking for libelf/libelf.h... no
checking for sys/types.h... (cached) yes
checking sys/ia64/elf.h usability... no
checking sys/ia64/elf.h presence... no
checking for sys/ia64/elf.h... no
Assuming struct Elf for the default libdwarf.h
checking for elf64_getehdr in -lelf... no
checking for elf64_getshdr in -lelf... no
libelf/libelf.h does not have struct _Elf
libelf.h does not have struct _Elf
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged

but when I try to make libdwarf I get the following warnings and errors:

dwarf_elf_access.c: In function 'dwarf_elf_object_access_internals_init':
dwarf_elf_access.c:164:21: warning: assignment makes pointer from integer without a cast [enabled by default]
dwarf_elf_access.c:193:21: warning: assignment makes pointer from integer without a cast [enabled by default]
dwarf_elf_access.c: In function 'dwarf_elf_object_access_get_section_info':
dwarf_elf_access.c:267:5: error: unknown type name 'Elf_Scn'
dwarf_elf_access.c:270:9: warning: assignment makes pointer from integer without a cast [enabled by default]
dwarf_elf_access.c:303:17: warning: assignment makes pointer from integer without a cast [enabled by default]
dwarf_elf_access.c:316:19: warning: assignment makes pointer from integer without a cast [enabled by default]
dwarf_elf_access.c: In function 'dwarf_elf_object_access_load_section':
dwarf_elf_access.c:1124:9: error: unknown type name 'Elf_Scn'
dwarf_elf_access.c:1125:9: error: unknown type name 'Elf_Data'
dwarf_elf_access.c:1127:13: warning: assignment makes pointer from integer without a cast [enabled by default]
dwarf_elf_access.c:1139:14: warning: assignment makes pointer from integer without a cast [enabled by default]
dwarf_elf_access.c:1144:29: error: request for member 'd_buf' in something not a structure or union
make[1]: *** [dwarf_elf_access.o] Error 1
make[1]: Leaving directory `/home/xxxxxx/dev/dwarf-20150310/libdwarf'
make: *** [basic] Error 2

I should also note that I've installed the following thus far:

gcc-4.8.1
cmake-3.0.2
boost-1.55.0
glog-0.3.3
jemalloc-3.5.1
libmcrypt-2.5.8
libmemcached-1.0.18
onig-5.9.4
sqlite
tbb

asked 15 May '15, 21:38

nixatlas
1315
accept rate: 0%

edited 18 May '15, 15:28


You could build libelf from source instead of trying to install it from the RPM:

 mkdir -p ~/{src,tmp}
 export TMPDIR=~/tmp
 cd ~/src
 wget https://fedorahosted.org/releases/e/l/elfutils/0.161/elfutils-0.161.tar.bz2
 tar jxf elfutils-0.161.tar.bz2 
 cd elfutils-0.161
 ./configure --prefix=$HOME
 make
 make install

Hope that helps!

permanent link

answered 15 May '15, 22:23

seanf
12.2k41836
accept rate: 37%

edited 16 May '15, 13:34

Hi Sean, Thanks for the response, but I was actually able to get elfutils installed from the source before attempting to install libdwarf The original problem came up when running make on dwarf. So I'm trying to get elfutils-libelf-devel (which is only available as rpm) to install per hhvm docs to see if that fixes the dwarf make & install. This is where I'm stuck. I feel I may be missing something, or maybe it's not possible without modifications to the elfutils source?

I may contact the dev of libdwarf to see if he can help as well.

(16 May '15, 01:22) nixatlas

Can you edit your original question to include the configure line you're using for dwarf, or more generally the full list of commands you're using to install elfutils and dwarf? We can create a fresh test account and try it - the problem might just be that dwarf isn't finding the right library at compile time (and you need to set LIBRARY_PATH or similar).

(16 May '15, 01:35) ryans ♦♦

@ryans I've made a few changes to the question, I found out that the necessary elfutils-libelf and elfutils-libelf-devel packages are installed already on Webfaction servers, so now it's narrowed down to "Why isn't dwarf working?". I've updated it to include the commands I'm using, as well as the configure output.

(18 May '15, 15:35) nixatlas

elfutils-libelf-devel is not installed on your WebFaction server. I've confirmed that via yum on your server, and I see this in your configure output:

checking libelf.h usability... no
checking libelf.h presence... no
checking for libelf.h... no
checking libelf/libelf.h usability... no
checking libelf/libelf.h presence... no
checking for libelf/libelf.h... no

So, try building libelf in your home directory, and then set your LDFLAGS and CPPFLAGS environment variables as described in our documentation. Once you've done so, your dwarf build should be able to use your locally-installed libs and headers.

(18 May '15, 22:35) seanf

Setting LDFLAGS and CPPFLAGS did it. Dwarf installed and is found by HHVM this is the full script to instal libdwarf (after installing elfutils).

wget 'http://www.prevanders.net/libdwarf-20140413.tar.gz'
tar -xzf libdwarf-20140413.tar.gz
cd dwarf-20140413/libdwarf
export CPPFLAGS="-I$HOME/include $CPPFLAGS"
export LDFLAGS="-L$HOME/lib $LDFLAGS"
./configure --prefix=$HOME
make
cp ./dwarf.h $HOME/include
cp ./libdwarf.h $HOME/include
cp ./libdwarf.a $HOME/lib
(19 May '15, 14:18) nixatlas
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×11
×2
×2
×1
×1

question asked: 15 May '15, 21:38

question was seen: 3,157 times

last updated: 19 May '15, 14:18

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM