Skip to contentSkip to conversation

compiling error "xen-unstable.hg"

DISCUSSION hackroute 5 participants 12 messages Jul 27, 2012 – Aug 2, 2012 3 messages not in the archive

lore
Share & tools
lore

hackroute

author
#0 lore raw

when i compiling xen-unstable.hg from 'http://xenbits.xen.org/hg/xen-unstable.hg' or staging reps i have an error

sed: -e expression #6, symbol 111:command not finished `s' make[2]: *** [include/xen/compile.h] error 1

/xen-unstable.hg/xen/makefile:
...

# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
include/xen/compile.h: include/xen/compile.h.in .banner
	@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
...
	    -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep version |
tail -1)!g' \
...
	    -e 's!@@changeset@@!$(shell ((hg parents --template "{date|date}
{rev}:{node|short}" >/dev/null && hg parents --template "{date|date}
{rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
	    < include/xen/compile.h.in > [email protected]
...

i remove " | grep version"
and it fixed this error

but now i have this error:

make world:
...
ln -sf libxenlight.so.2.0.0 libxenlight.so.2.0
ln -sf libxenlight.so.2.0 libxenlight.so
gcc -pthread -o xl xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o libxlutil.so
/home/alex/xen-unstable.hg/tools/libxl/../../tools/libxl/libxenlight.so -Wl,-rpath-link=/home/alex/xen-unstable.hg/tools/libxl/../../tools/libxc -Wl,-rpath-link=/home/alex/xen-unstable.hg/tools/libxl/../../tools/xenstore -Wl,-rpath-link=/home/alex/xen-unstable.hg/tools/libxl/../../tools/blktap2/control /home/alex/xen-unstable.hg/tools/libxl/../../tools/libxc/libxenctrl.so -lyajl /home/alex/xen-unstable.hg/tools/libxl/../../tools/libxl/libxenlight.so:
undefined reference to `yajl_complete_parse'
collect2: execution ld finished with error code 1
make[4]: *** [xl] error 1
make[4]: Выход из каталога `/home/alex/xen-unstable.hg/tools/libxl'
make[3]: *** [subdir-install-libxl] (error 2)
make[3]: Выход из каталога `/home/alex/xen-unstable.hg/tools'
make[2]: *** [subdirs-install] (error 2)
make[2]: Выход из каталога `/home/alex/xen-unstable.hg/tools'
make[1]: *** [install-tools] (error 2)
make[1]: Выход из каталога `/home/alex/xen-unstable.hg'
make: *** [world] (error 2)

libxl_json.c:

    status = yajl_complete_parse(yajl_ctx.hand);
    if (status != yajl_status_ok)
        goto out;

libxl_json.h:
#define yajl_complete_parse yajl_parse_complete

how can i fix this error?

ubuntu 12.04 desktop
with kernel 3.3.0-rc7-xen-teo.en.ming-sgp
with kernel 3.2.0-27-generic

--
View this message in context: http://xen.1045712.n5.nabble.com/compiling-error-xen-unstable-hg-tp5710388.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 23 lines
Quoted 1 line
Quoted 1 line · hackroute

when i compiling xen-unstable.hg from 'http://xenbits.xen.org/hg/xen-unstable.hg' or staging reps i have an error

sed: -e expression #6, symbol 111:command not finished `s' make[2]: *** [include/xen/compile.h] error 1

/xen-unstable.hg/xen/makefile:
...

# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
include/xen/compile.h: include/xen/compile.h.in .banner
	@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
...
	    -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep version |
tail -1)!g' \
...
	    -e 's!@@changeset@@!$(shell ((hg parents --template "{date|date}
{rev}:{node|short}" >/dev/null && hg parents --template "{date|date}
{rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
	    < include/xen/compile.h.in > [email protected]
...
Quoted 2 lines

i remove " | grep version"
and it fixed this error

But that's certainly not the right fix. What output does "$(CC) $(CFLAGS) -v" produce for you? In particular, does it perhaps include any single quote character(s)?

Quoted 4 lines

but now i have this error:
...
/home/alex/xen-unstable.hg/tools/libxl/../../tools/libxl/libxenlight.so:
undefined reference to `yajl_complete_parse'

Unsupported/wrong libyajl version (I don't recall whether support for v2 of the library was ever added).

Jan

#2 lore raw
Quoted 7 lines · Jan Beulich
Quoted 4 lines

but now i have this error:
...
/home/alex/xen-unstable.hg/tools/libxl/../../tools/libxl/libxenlight.so:
undefined reference to `yajl_complete_parse'

Unsupported/wrong libyajl version (I don't recall whether support for v2 of the library was ever added).

It was.

configure has a check for yajl/yajl_version.h and tools/libxl/libxl_json.h uses this to determine v1 vs v2 (and assumes v1 if it is not present).

What does "grep YAJL tools/config.h" say?

Ian.

#4 lore raw
In reply to a message not in the archive

Please keep the list on the CC line so that everyone can benefit. I've put it back for you this time.

Quoted 11 lines · Yuriy Logvinov
Quoted 8 lines
Quoted 2 lines

but now i have this error:
...

/home/alex/xen-unstable.hg/tools/libxl/../../tools/libxl/libxenlight.so:

Quoted 1 line

undefined reference to `yajl_complete_parse'

Unsupported/wrong libyajl version (I don't recall whether support for v2 of the library was ever added).

It was.

Quoted 8 lines

configure has a check for yajl/yajl_version.h and tools/libxl/libxl_json.h uses this to determine v1 vs v2 (and assumes v1
if it is not present).

What does "grep YAJL tools/config.h" say?

Ian.

Please can you configure you MUA to give some indication of what is quoted material and what you have added yourself.

Quoted 5 lines

grep YAJL tools/config.h:

#define HAVE_LIBYAJL 1
#define HAVE_YAJL_YAJL_VERSION_H 1

What does /usr/incude/yajl/yajl_version.h contain?

What does "objdump -T /usr/lib/libyajl.so" show?

Quoted 4 lines

yajl got and installed from git rep:

cd
git clone git://github.com/lloyd/yajl

Which version of yajl is this? Why don't you just "apt-get install libyajl-dev"? Or at least use a released version.

Quoted 11 lines

cd yajl
sudo apt-get install ruby cmake
./configure
make
sudo make install

install was successful

#6 lore raw
In reply to a message not in the archive

You have dropped xen-devel again. I have put it back again this time. In the future I will ignore mails from you which do not CC the list.

Quoted 37 lines · Yuriy Logvinov

:

Please keep the list on the CC line so that everyone can benefit. I've
put it back for you this time.

On Fri, 2012-07-27 at 10:16 +0100, Yuriy Logvinov wrote:
> > > but now i have this error:
> > >...
> >
>
> /home/alex/xen-unstable.hg/tools/libxl/../../tools/libxl/libxenlight.so:
> > > undefined reference to `yajl_complete_parse'
> >
> > Unsupported/wrong libyajl version (I don't recall whether support
> > for v2 of the library was ever added).
>
> It was.
>
> configure has a check for yajl/yajl_version.h and
> tools/libxl/libxl_json.h uses this to determine v1 vs v2 (and assumes
> v1
> if it is not present).
>
> What does "grep YAJL tools/config.h" say?
>
> Ian.

> grep YAJL tools/config.h:
>
>
> #define HAVE_LIBYAJL 1
> #define HAVE_YAJL_YAJL_VERSION_H 1

Quoted 6 lines

What does /usr/incude/yajl/yajl_version.h contain?

it contain:
#define YAJL_MAJOR 1
#define YAJL_MINOR 0
#define YAJL_MICRO 12

Which indicates version 1.0.12 of yajl, yet the git URL you quoted before contains 2.0.5.

I think you've got your system into an inconsistent state, with multiple incompatible versions of yajl on it.

Quoted 1 line

/usr/local/lib/libyajl.so: file format elf64-x86-64

[...]

Quoted 1 line

0000000000001540 g DF .text 000000000000003d Base yajl_complete_parse

This implies a 2.0.x version also.

Quoted 2 lines

i have libyajl.so in /usr/local/lib/ folder not /usr/lib/ may be it`s important ?

Yes, you need to clean up all the rubbish you installed by hand and make sure your system is in a consistent state before you try installing Xen again. I suggest you ask for help on how to do this from the Ubuntu user forums or somewhere like that -- it's not a Xen issue.

Ian.

#8 lore raw
In reply to a message not in the archive
Quoted 30 lines
Quoted 23 lines
Quoted 1 line · Yuriy Logvinov

when i compiling xen-unstable.hg from
'http://xenbits.xen.org/hg/xen-unstable.hg' or staging reps i have an error

sed: -e expression #6, symbol 111:command not finished `s' make[2]: *** [include/xen/compile.h] error 1

/xen-unstable.hg/xen/makefile:
...

# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
include/xen/compile.h: include/xen/compile.h.in .banner
@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
...
-e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep version |
tail -1)!g' \
...
-e 's!@@changeset@@!$(shell ((hg parents --template "{date|date}
{rev}:{node|short}" >/dev/null && hg parents --template "{date|date}
{rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
< include/xen/compile.h.in > [email protected]
...
Quoted 2 lines

i remove " | grep version"
and it fixed this error

But that's certainly not the right fix. What output does "$(CC) $(CFLAGS) -v" produce for you? In particular, does it perhaps include any single quote character(s)?

Quoted 8 lines

Jan

after remove grep version i get in compile.h:
#define XEN_COMPILER "gcc версия 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
"

what should i get in this identifier?
"gcc"? Or "4.6.3" or what?

The resulting string is correct, and the grep simply doesn't work because you have a localized gcc. The addition of grep here was done to support clang (see c/s 22985:d8ea33e7af7e, author Cc-ed). It's not clear to me how to get around such translation issues (Tim - could you explain what output clang generates that made the use of grep necessary?), nor do I have a clue why the sed invocation would complain about an unfinished command (from what you provided I'd suppose that it would end up with an empty replacement string, which ought to be fine).

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw
Quoted 36 lines · Jan Beulich
Quoted 36 lines
Quoted 23 lines
Quoted 1 line · Yuriy Logvinov

when i compiling xen-unstable.hg from
'http://xenbits.xen.org/hg/xen-unstable.hg' or staging reps i have an error

sed: -e expression #6, symbol 111:command not finished `s' make[2]: *** [include/xen/compile.h] error 1

/xen-unstable.hg/xen/makefile:
...

# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
include/xen/compile.h: include/xen/compile.h.in .banner
@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
...
-e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep version |
tail -1)!g' \
...
-e 's!@@changeset@@!$(shell ((hg parents --template "{date|date}
{rev}:{node|short}" >/dev/null && hg parents --template "{date|date}
{rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
< include/xen/compile.h.in > [email protected]
...
Quoted 2 lines

i remove " | grep version"
and it fixed this error

But that's certainly not the right fix. What output does "$(CC) $(CFLAGS) -v" produce for you? In particular, does it perhaps include any single quote character(s)?

Jan

after remove grep version i get in compile.h:
#define XEN_COMPILER "gcc версия 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
"

Quoted 8 lines
Quoted 2 lines

what should i get in this identifier?
"gcc"? Or "4.6.3" or what?

The resulting string is correct, and the grep simply doesn't work because you have a localized gcc. The addition of grep here was done to support clang (see c/s 22985:d8ea33e7af7e, author Cc-ed). It's not clear to me how to get around such translation issues

A judicious sprinkling of LANG=C or LC_ALL=C etc?

Quoted 3 lines

(Tim - could you explain what output clang generates that
made the use of grep necessary?), nor do I have a clue why the sed invocation would complain about an unfinished command

Perhaps one of the multibyte Russian characters contains a "!" which confuses non-UTF8 aware sed?

Quoted 9 lines

(from what you provided I'd suppose that it would end up with an empty replacement string, which ought to be fine).

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#10 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
Quoted 5 lines · Jan Beulich

The resulting string is correct, and the grep simply doesn't work because you have a localized gcc. The addition of grep here was done to support clang (see c/s 22985:d8ea33e7af7e, author Cc-ed). It's not clear to me how to get around such translation issues

A judicious sprinkling of LANG=C or LC_ALL=C etc?

Yuriy, could you give this a try?

Quoted 6 lines
Quoted 3 lines

(Tim - could you explain what output clang generates that
made the use of grep necessary?), nor do I have a clue why the sed invocation would complain about an unfinished command

Perhaps one of the multibyte Russian characters contains a "!" which confuses non-UTF8 aware sed?

But the grep should not have returned anything, hence none of those characters would even be seen by sed. Plus UTF-8 encodings of characters outside the ASCII range have their high bits set on all resulting bytes (to avoid this very problem).

Jan

#11 lore raw

Am 27.07.2012 12:38, schrieb Jan Beulich:

Quoted 16 lines
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
Quoted 5 lines · Jan Beulich

The resulting string is correct, and the grep simply doesn't work because you have a localized gcc. The addition of grep here was done to support clang (see c/s 22985:d8ea33e7af7e, author Cc-ed). It's not clear to me how to get around such translation issues

A judicious sprinkling of LANG=C or LC_ALL=C etc?

Yuriy, could you give this a try?

Quoted 4 lines
Quoted 3 lines

(Tim - could you explain what output clang generates that
made the use of grep necessary?), nor do I have a clue why the sed invocation would complain about an unfinished command

Quoted 7 lines
Quoted 2 lines

Perhaps one of the multibyte Russian characters contains a "!" which confuses non-UTF8 aware sed?

But the grep should not have returned anything, hence none of those characters would even be seen by sed. Plus UTF-8 encodings of characters outside the ASCII range have their high bits set on all resulting bytes (to avoid this very problem).

The grep returns the "Configured with:..." string on my system which contains something like

--with-pkgversion='Debian 4.4.5-8'

resulting in the sed error, as the tail -1 won't return the gcc version line.

Juergen

Signature · 5 lines
Juergen Gross                 Principal Developer Operating Systems
PDG ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: [email protected]
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html
#12 lore raw
Quoted 16 lines · Juergen Gross

Am 27.07.2012 12:38, schrieb Jan Beulich:

Quoted 15 lines
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
Quoted 5 lines · Jan Beulich

The resulting string is correct, and the grep simply doesn't work because you have a localized gcc. The addition of grep here was done to support clang (see c/s 22985:d8ea33e7af7e, author Cc-ed). It's not clear to me how to get around such translation issues

A judicious sprinkling of LANG=C or LC_ALL=C etc?

Yuriy, could you give this a try?

Quoted 3 lines
Quoted 3 lines

(Tim - could you explain what output clang generates that
made the use of grep necessary?), nor do I have a clue why the sed invocation would complain about an unfinished command

clang -v prints something like this:

Debian clang version 3.0-6 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

so unlike GCC you can't just take the last line of the output. Grepping for version was intended to get rid of the other chatter, but clearly it's broken in the face of localized version strings.

We might do better to switch to '$(CC) --version | head -1', which seems to provide something sensible on all the gcc and clang binaries I have handy.

Tim.

#13 lore raw
Quoted 25 lines
Quoted 1 line
Quoted 1 line · Tim Deegan
Quoted 16 lines · Juergen Gross

Am 27.07.2012 12:38, schrieb Jan Beulich:

Quoted 15 lines
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
Quoted 5 lines · Jan Beulich

The resulting string is correct, and the grep simply doesn't work because you have a localized gcc. The addition of grep here was done to support clang (see c/s 22985:d8ea33e7af7e, author Cc-ed). It's not clear to me how to get around such translation issues

A judicious sprinkling of LANG=C or LC_ALL=C etc?

Yuriy, could you give this a try?

Quoted 3 lines
Quoted 3 lines

(Tim - could you explain what output clang generates that
made the use of grep necessary?), nor do I have a clue why the sed invocation would complain about an unfinished command

clang -v prints something like this:

Debian clang version 3.0-6 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

Quoted 7 lines

so unlike GCC you can't just take the last line of the output. Grepping for version was intended to get rid of the other chatter, but clearly it's broken in the face of localized version strings.

We might do better to switch to '$(CC) --version | head -1', which seems to provide something sensible on all the gcc and clang binaries I have handy.

The question is how relevant that string is in the first place:
My cross compilers, for example, get invoked through a shell scripts that's named gccx. Invoking that with --version reproduces the shell script name (which the script forces as the argv[0] of the exec-ed "real" gcc):

gccx (GCC) 4.7.1

which isn't the case for -v:

gcc version 4.7.1 (GCC)

So as long as no deeper meaning is implied from the string by anyone (there's nothing in-tree that I'm aware of), I think that's at least as good a change as adding LC_ALL=C (of which I'm not really certain whether it would be fully reliable in all possible cases).

Jan

#14 lore raw
Quoted 10 lines · Jan Beulich
Quoted 3 lines

We might do better to switch to '$(CC) --version | head -1', which seems to provide something sensible on all the gcc and clang binaries I have handy.

The question is how relevant that string is in the first place:
My cross compilers, for example, get invoked through a shell scripts that's named gccx. Invoking that with --version reproduces the shell script name (which the script forces as the argv[0] of the exec-ed "real" gcc):

Quoted 5 lines

gccx (GCC) 4.7.1

which isn't the case for -v:

gcc version 4.7.1 (GCC)

Sigh.

Quoted 5 lines

So as long as no deeper meaning is implied from the string by anyone (there's nothing in-tree that I'm aware of), I think that's at least as good a change as adding LC_ALL=C (of which I'm not really certain whether it would be fully reliable in all possible cases).

I'm not aware of anyone/anything that relies on that string except for human consumption. I'll submit a patch to change to --version.

Cheers,

Tim.