problems building Vine 1.0 under Ubuntu 10.04 lucid

447 views
Skip to first unread message

canonical.chris

unread,
Dec 7, 2010, 10:49:01 AM12/7/10
to BitBlaze User Discussion group
Hi,

I followed the instructions for the Vine installation, and ran into
problems almost immediately with a conflict between the declaration of
basename() in libiberty.h and string.h.

make[3]: Entering directory `/home/ubuntu/bitblaze/vine-1.0/libasmir/
src'
g++ -DHAVE_CONFIG_H -I. -I../../libasmir -I/home/ubuntu/bitblaze/
vine-1.0/VEX//pub -I./include -fPIC -g -O2 -MT asm_program.o -MD -MP -
MF .deps/asm_program.Tpo -c -o asm_program.o `test -f './disasm/
asm_program.cpp' || echo './'`./disasm/asm_program.cpp
In file included from ./disasm/asm_program.cpp:16:
/usr/include/libiberty.h:106: error: new declaration ‘char*
basename(const char*)’
/usr/include/string.h:601: error: ambiguates old declaration ‘const
char* basename(const char*)’
./disasm/asm_program.cpp: In function ‘bfd* initialize_bfd(const
char*)’:
./disasm/asm_program.cpp:520: warning: deprecated conversion from
string constant to ‘char*’
make[3]: *** [asm_program.o] Error 1

Is this a known issue with Ubuntu 10.04 Lucid? Should I revert to
Karmic instead?

Thanks
--cc

Stephen McCamant

unread,
Dec 7, 2010, 1:59:57 PM12/7/10
to bitblaz...@googlegroups.com
>>>>> "CC" == canonical chris <canonical.chris> writes:

CC> Hi,
CC> I followed the instructions for the Vine installation, and ran
CC> into problems almost immediately with a conflict between the
CC> declaration of basename() in libiberty.h and string.h.

CC> make[3]: Entering directory `/home/ubuntu/bitblaze/vine-1.0/libasmir/
CC> src'
CC> g++ -DHAVE_CONFIG_H -I. -I../../libasmir -I/home/ubuntu/bitblaze/
CC> vine-1.0/VEX//pub -I./include -fPIC -g -O2 -MT asm_program.o -MD -MP -
CC> MF .deps/asm_program.Tpo -c -o asm_program.o `test -f './disasm/
CC> asm_program.cpp' || echo './'`./disasm/asm_program.cpp
CC> In file included from ./disasm/asm_program.cpp:16:
CC> /usr/include/libiberty.h:106: error: new declaration `char*
CC> basename(const char*)'
CC> /usr/include/string.h:601: error: ambiguates old declaration `const
CC> char* basename(const char*)'

CC> Is this a known issue with Ubuntu 10.04 Lucid? Should I revert to
CC> Karmic instead?

Our recommended platform for building the TEMU and Vine 1.0 releases
is still Ubuntu 9.04 ("Jaunty"), since that's what they were tested
with.

However this is a known issue with a simple fix. The patch below is
copied from a previous message at:

http://groups.google.com/group/bitblaze-users/browse_thread/thread/66983b0ddce7827b/

Hope this helps,

-- Stephen

Index: libasmir/src/disasm/asm_program.cpp
===================================================================
--- libasmir/src/disasm/asm_program.cpp (older version)
+++ libasmir/src/disasm/asm_program.cpp (fixed version)
@@ -7,6 +7,11 @@
#include "debug.h"
#include "asm_program.h"
#include "objdump.h"
+/* Some versions of glibc and the binutils libiberty library give
+ conflicting prototypes for basename(). We don't use that function
+ anyway, but to work around the problem, make libliberty.h think
+ that it has already been declared. */
+#define HAVE_DECL_BASENAME 1
#include "libiberty.h"

canonical.chris

unread,
Dec 8, 2010, 3:37:05 PM12/8/10
to BitBlaze User Discussion group
Thanks for the pointer; I had searched using the error message, but
since that older post does not report the error that one receives, I
did not find it; should have searched just for basename.

Seems to be working now; at least the build gets farther along.

--cc

On Dec 7, 12:59 pm, Stephen McCamant <s...@CS.Berkeley.EDU> wrote:
> >>>>> "CC" == canonical chris <canonical.chris> writes:
>
> CC> Hi,
> CC> I followed the instructions for the Vine installation, and ran
> CC> into problems almost immediately with a conflict between the
> CC> declaration of basename() in libiberty.h and string.h.
>
> CC> make[3]: Entering directory `/home/ubuntu/bitblaze/vine-1.0/libasmir/
> CC> src'
> CC> g++ -DHAVE_CONFIG_H -I. -I../../libasmir    -I/home/ubuntu/bitblaze/
> CC> vine-1.0/VEX//pub -I./include -fPIC -g -O2 -MT asm_program.o -MD -MP -
> CC> MF .deps/asm_program.Tpo -c -o asm_program.o `test -f './disasm/
> CC> asm_program.cpp' || echo './'`./disasm/asm_program.cpp
> CC> In file included from ./disasm/asm_program.cpp:16:
> CC> /usr/include/libiberty.h:106: error: new declaration `char*
> CC> basename(const char*)'
> CC> /usr/include/string.h:601: error: ambiguates old declaration `const
> CC> char* basename(const char*)'
>
> CC> Is this a known issue with Ubuntu 10.04 Lucid? Should I revert to
> CC> Karmic instead?
>
> Our recommended platform for building the TEMU and Vine 1.0 releases
> is still Ubuntu 9.04 ("Jaunty"), since that's what they were tested
> with.
>
> However this is a known issue with a simple fix. The patch below is
> copied from a previous message at:
>
> http://groups.google.com/group/bitblaze-users/browse_thread/thread/66...
Reply all
Reply to author
Forward
0 new messages