Skip to contentSkip to conversation

Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation

DISCUSSION Konrad Rzeszutek Wilk 4 participants 10 messages Mar 21, 2011 – Mar 23, 2011

lore
Share & tools
lore
#0 lore raw

This is a Fedora Core 13 environment and I just noticed this as I update the xen-unstable tree:

make -C libxl install
make[3]: Entering directory `/home/konrad/ssd/xtt/xen-unstable/tools/libxl'
rm -f _libxl_paths.h.tmp.tmp; echo "SBINDIR=\"/usr/sbin\"" >> _libxl_paths.h.tmp.tmp; echo "BINDIR=\"/usr/bin\"" >> _libxl_paths.h.tmp.tmp; echo "LIBEXEC=\"/usr/lib/xen/bin\"" >> _libxl_paths.h.tmp.tmp; echo "LIBDIR=\"/usr/lib64\"" >> _libxl_paths.h.tmp.tmp; echo "SHAREDIR=\"/usr/share\"" >> _libxl_paths.h.tmp.tmp; echo "PRIVATE_BINDIR=\"/usr/lib64/xen/bin\"" >> _libxl_paths.h.tmp.tmp; echo "XENFIRMWAREDIR=\"/usr/lib/xen/boot\"" >> _libxl_paths.h.tmp.tmp; echo "XEN_CONFIG_DIR=\"/etc/xen\"" >> _libxl_paths.h.tmp.tmp; echo "XEN_SCRIPT_DIR=\"/etc/xen/scripts\"" >> _libxl_paths.h.tmp.tmp; echo "XEN_LOCK_DIR=\"/var/lock\"" >> _libxl_paths.h.tmp.tmp; if ! cmp _libxl_paths.h.tmp.tmp _libxl_paths.h.tmp; then mv -f _libxl_paths.h.tmp.tmp _libxl_paths.h.tmp; fi sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" _libxl_paths.h.tmp >_libxl_paths.h.2.tmp
if ! cmp _libxl_paths.h.2.tmp _libxl_paths.h; then mv -f _libxl_paths.h.2.tmp _libxl_paths.h; fi
gcc -Wl,--no-as-needed -o xl xl.o xl_cmdimpl.o xl_cmdtable.o libxlutil.so libxenlight.so -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxl -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/xenstore -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/blktap2/control -lxenlight
/usr/bin/ld: xl.o: undefined reference to symbol 'xtl_createlogger_stdiostream'
/usr/bin/ld: note: 'xtl_createlogger_stdiostream' is defined in DSO /home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc/libxenctrl.so.4.0 so try adding it to the linker command line
/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc/libxenctrl.so.4.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[3]: *** [xl] Error 1
make[3]: Leaving directory `/home/konrad/ssd/xtt/xen-unstable/tools/libxl'
make[2]: *** [subdir-install-libxl] Error 2
make[2]: Leaving directory `/home/konrad/ssd/xtt/xen-unstable/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/home/konrad/ssd/xtt/xen-unstable/tools'
make: *** [install-tools] Error 2

And nm --defined | grep stdio shows:

0000000000018da0 t stdiostream_destroy
0000000000018df6 t stdiostream_progress
0000000000018f0a t stdiostream_vmessage
0000000000018cbd T xtl_createlogger_stdiostream
0000000000018dc0 T xtl_stdiostream_adjust_flags
0000000000018cb4 T xtl_stdiostream_set_minlevel

So the symbol is definitly there. Any ideas?

#1 lore raw
Quoted 2 lines · Konrad Rzeszutek Wilk

This is a Fedora Core 13 environment and I just noticed this as I update the xen-unstable tree:

My fault.

Ian.

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300712676 0
# Node ID b139d8f6fc5edaa9b26af15c9a6712d6eb7b0bee # Parent 1849d5dc47deeb75721dfaf8fd46c76283a7e1e3
xl: link against libxenctrl

As well as the indirect dependency (via libxl) the xl binary also uses libxenctrl directory (for xtl_createlogger_stdiostream etc) and therefore must link against the library directly too.

tools/libxl/Makefile +1 -1
diff -r 1849d5dc47de -r b139d8f6fc5e tools/libxl/Makefile
@@ -24,7 +24,7 @@ LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLI
 
 LIBXLU_LIBS =
 
-CLIENT_LIBS = $(LDLIBS_libxenlight)
+CLIENT_LIBS = $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl)
 
 LIBXL_OBJS-y = osdeps.o libxl_paths.o libxl_bootloader.o flexarray.o
 ifeq ($(LIBXL_BLKTAP),y)
#2 lore raw

Ian Campbell writes ("Re: [Xen-devel] Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation"):

Quoted 1 line

xl: link against libxenctrl

I've applied this, thanks. Although I don't understand why the build failed for Konrad and not me or my test system. Perhaps the failure is only with -Wl,-as-needed ?

Ian.

#3 lore raw
Quoted 5 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation"):

Quoted 1 line

xl: link against libxenctrl

I've applied this, thanks. Although I don't understand why the build failed for Konrad and not me or my test system.

Me neither.

Quoted 1 line

Perhaps the failure is only with -Wl,-as-needed ?

Possibly, although I did do test builds with that enabled (or at least I thought I did...)

Ian.

#4 lore raw
Quoted 8 lines · Ian Campbell
Quoted 5 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation"):

Quoted 1 line

xl: link against libxenctrl

I've applied this, thanks. Although I don't understand why the build failed for Konrad and not me or my test system.

Me neither.

I am not sure either. Here is another with todays pull:

gcc -o xl xl.o xl_cmdimpl.o xl_cmdtable.o libxlutil.so -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxl -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/xenstore -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/blktap2/control -lxenlight -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -lxenctrl
/usr/bin/ld: xl_cmdimpl.o: undefined reference to symbol 'uuid_parse@@UUID_1.0'
/usr/bin/ld: note: 'uuid_parse@@UUID_1.0' is defined in DSO /lib64/libuuid.so.1 so try adding it to the linker command line /lib64/libuuid.so.1: could not read symbols: Invalid operation

Quoted 14 lines
Quoted 2 lines

Perhaps the failure is only with -Wl,-as-needed ?

Possibly, although I did do test builds with that enabled (or at least I thought I did...)

Ian.

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

#5 lore raw
Quoted 8 lines · Konrad Rzeszutek Wilk
Quoted 7 lines · Ian Campbell
Quoted 5 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation"):

Quoted 1 line

xl: link against libxenctrl

I've applied this, thanks. Although I don't understand why the build failed for Konrad and not me or my test system.

Quoted 8 lines
Quoted 1 line

Me neither.

I am not sure either. Here is another with todays pull:

gcc -o xl xl.o xl_cmdimpl.o xl_cmdtable.o libxlutil.so -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxl -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/xenstore -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/blktap2/control -lxenlight -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -lxenctrl
/usr/bin/ld: xl_cmdimpl.o: undefined reference to symbol 'uuid_parse@@UUID_1.0'
/usr/bin/ld: note: 'uuid_parse@@UUID_1.0' is defined in DSO /lib64/libuuid.so.1 so try adding it to the linker command line /lib64/libuuid.so.1: could not read symbols: Invalid operation

This is due to the use of the uuid library being inlined in the libxl headers, so the user of libxl can end up with linking requirements due to libxl header internals. I think the right fix is to move these out of line like I did with essentially the same thing in blktap2. I'll take a look shortly.

Ian.

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines

Perhaps the failure is only with -Wl,-as-needed ?

Possibly, although I did do test builds with that enabled (or at least I thought I did...)

Ian.

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

#6 lore raw
Quoted 18 lines · Ian Campbell
Quoted 8 lines · Konrad Rzeszutek Wilk
Quoted 7 lines · Ian Campbell
Quoted 5 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation"):

Quoted 1 line

xl: link against libxenctrl

I've applied this, thanks. Although I don't understand why the build failed for Konrad and not me or my test system.

Quoted 8 lines
Quoted 1 line

Me neither.

I am not sure either. Here is another with todays pull:

gcc -o xl xl.o xl_cmdimpl.o xl_cmdtable.o libxlutil.so -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxl -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/xenstore -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/blktap2/control -lxenlight -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -lxenctrl
/usr/bin/ld: xl_cmdimpl.o: undefined reference to symbol 'uuid_parse@@UUID_1.0'
/usr/bin/ld: note: 'uuid_parse@@UUID_1.0' is defined in DSO /lib64/libuuid.so.1 so try adding it to the linker command line /lib64/libuuid.so.1: could not read symbols: Invalid operation

Quoted 5 lines

This is due to the use of the uuid library being inlined in the libxl headers, so the user of libxl can end up with linking requirements due to libxl header internals. I think the right fix is to move these out of line like I did with essentially the same thing in blktap2. I'll take a look shortly.

Konrad, Jeremy,

Does this help?

Christoph,

Does it work for BSD?

Ian.

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300893083 0
# Node ID 83ff83c380c0bfb594e6ac0ccc860cfc60741242 # Parent 26ba6a80310af7c3b360d4b78da8f3ff7188a9e8 tools/libxl: move uuid wrapper functions out of line.

This isolates users of libxenlight from the need to know about the different OS schemes for UUIDs, in particular the linkage requirements.

tools/libxl/Makefile +1 -1
diff -r 26ba6a80310a -r 83ff83c380c0 tools/libxl/Makefile
@@ -34,7 +34,7 @@ LIBXL_OBJS-$(CONFIG_IA64) += libxl_nocpu
 
 LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \
 			libxl_dom.o libxl_exec.o libxl_xshelp.o libxl_device.o \
-			libxl_internal.o libxl_utils.o $(LIBXL_OBJS-y)
+			libxl_internal.o libxl_utils.o libxl_uuid.o $(LIBXL_OBJS-y)
 LIBXL_OBJS += _libxl_types.o
 
 $(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl)
tools/libxl/libxl_uuid.c new file +105 -0

105 lines not on this page · raw message

tools/libxl/libxl_uuid.h +9 -80

111 lines not on this page · raw message

#7 lore raw
Quoted 25 lines · Ian Campbell
Quoted 18 lines · Ian Campbell
Quoted 8 lines · Konrad Rzeszutek Wilk
Quoted 7 lines · Ian Campbell
Quoted 5 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation"):

Quoted 1 line

xl: link against libxenctrl

I've applied this, thanks. Although I don't understand why the build failed for Konrad and not me or my test system.

Quoted 8 lines
Quoted 1 line

Me neither.

I am not sure either. Here is another with todays pull:

gcc -o xl xl.o xl_cmdimpl.o xl_cmdtable.o libxlutil.so -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxl -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/xenstore -Wl,-rpath-link=/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/blktap2/control -lxenlight -L/home/konrad/ssd/xtt/xen-unstable/tools/libxl/../../tools/libxc -lxenctrl
/usr/bin/ld: xl_cmdimpl.o: undefined reference to symbol 'uuid_parse@@UUID_1.0'
/usr/bin/ld: note: 'uuid_parse@@UUID_1.0' is defined in DSO /lib64/libuuid.so.1 so try adding it to the linker command line /lib64/libuuid.so.1: could not read symbols: Invalid operation

Quoted 5 lines

This is due to the use of the uuid library being inlined in the libxl headers, so the user of libxl can end up with linking requirements due to libxl header internals. I think the right fix is to move these out of line like I did with essentially the same thing in blktap2. I'll take a look shortly.

Quoted 3 lines

Konrad, Jeremy,

Does this help?

Yes!

#8 lore raw
In reply to Ian Campbell

Ian Campbell writes ("Re: [Xen-devel] Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation"):

Quoted 7 lines

tools/libxl: move uuid wrapper functions out of line.

This isolates users of libxenlight from the need to know about the different OS schemes for UUIDs, in particular the linkage requirements.

Thanks for the test, Konrad. I've applied the patch.

Ian.

#9 lore raw
Quoted 10 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] Build problem: note: 'xtl_createlogger_stdiostream' is defined in DSO .. so try adding it to the linker command line... libxenctrl.so.4.0: could not read symbols: Invalid operation"):

Quoted 7 lines

tools/libxl: move uuid wrapper functions out of line.

This isolates users of libxenlight from the need to know about the different OS schemes for UUIDs, in particular the linkage requirements.

Thanks for the test, Konrad. I've applied the patch.

I think you forgot to hg add tools/libxl/libxl_uuid.c...