debuggers.hg

changeset 22703:5d78193d67d1

libxc: portability fixes for NetBSD

Attached patch makes libxc build again on NetBSD after the recent rework.

[ Modified by iwj:

I changed the name of the new make variable from LIBDL to DLOPEN_LIBS.
The latter conforms to the naming scheme for similar variables found
in config/*.mk - PTHREAD_LIBS et al.

Also I moved the setting of the variable to -dl from Linux to StdGNU
(which makes it apply more widely) and also added it to SunOS.mk
(based on pure guesswork). ]

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Christoph Egger <Christoph.Egger@amd.com>
date Thu Jan 06 17:26:26 2011 +0000 (2011-01-06)
parents 6874a9d26fd9
children 4c2efce5a808
files config/NetBSD.mk config/StdGNU.mk config/SunOS.mk tools/libxc/Makefile tools/libxc/xc_netbsd.c
line diff
     1.1 --- a/config/NetBSD.mk	Thu Jan 06 14:27:33 2011 +0000
     1.2 +++ b/config/NetBSD.mk	Thu Jan 06 17:26:26 2011 +0000
     1.3 @@ -7,6 +7,8 @@ LIBLEAFDIR_x86_64 = lib
     1.4  LIBEXEC = $(PREFIX)/libexec
     1.5  PRIVATE_BINDIR = $(BINDIR)
     1.6  
     1.7 +DLOPEN_LIBS =
     1.8 +
     1.9  ifeq ($(PREFIX),/usr)
    1.10  XEN_LOCK_DIR = /var/lib
    1.11  else
     2.1 --- a/config/StdGNU.mk	Thu Jan 06 14:27:33 2011 +0000
     2.2 +++ b/config/StdGNU.mk	Thu Jan 06 17:26:26 2011 +0000
     2.3 @@ -60,6 +60,8 @@ SOCKET_LIBS =
     2.4  CURSES_LIBS = -lncurses
     2.5  PTHREAD_LIBS = -lpthread
     2.6  UTIL_LIBS = -lutil
     2.7 +DLOPEN_LIBS = -ldl
     2.8 +
     2.9  SONAME_LDFLAG = -soname
    2.10  SHLIB_LDFLAGS = -shared
    2.11  
     3.1 --- a/config/SunOS.mk	Thu Jan 06 14:27:33 2011 +0000
     3.2 +++ b/config/SunOS.mk	Thu Jan 06 17:26:26 2011 +0000
     3.3 @@ -50,6 +50,8 @@ SOCKET_LIBS = -lsocket
     3.4  CURSES_LIBS = -lcurses
     3.5  PTHREAD_LIBS = -lpthread
     3.6  UTIL_LIBS =
     3.7 +DLOPEN_LIBS = -ldl
     3.8 +
     3.9  SONAME_LDFLAG = -h
    3.10  SHLIB_LDFLAGS = -R $(SunOS_LIBDIR) -shared
    3.11  
     4.1 --- a/tools/libxc/Makefile	Thu Jan 06 14:27:33 2011 +0000
     4.2 +++ b/tools/libxc/Makefile	Thu Jan 06 17:26:26 2011 +0000
     4.3 @@ -158,7 +158,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(
     4.4  	ln -sf $< $@
     4.5  
     4.6  libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
     4.7 -	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) -ldl $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS)
     4.8 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(DLOPEN_LIBS) $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS)
     4.9  
    4.10  # libxenguest
    4.11  
     5.1 --- a/tools/libxc/xc_netbsd.c	Thu Jan 06 14:27:33 2011 +0000
     5.2 +++ b/tools/libxc/xc_netbsd.c	Thu Jan 06 17:26:26 2011 +0000
     5.3 @@ -51,7 +51,7 @@ static xc_osdep_handle netbsd_privcmd_op
     5.4          goto error;
     5.5      }
     5.6  
     5.7 -    return (xc_osinteface_handle)fd;
     5.8 +    return (xc_osdep_handle)fd;
     5.9  
    5.10   error:
    5.11      saved_errno = errno;
    5.12 @@ -181,7 +181,7 @@ static struct xc_osdep_ops netbsd_privcm
    5.13      .close = &netbsd_privcmd_close,
    5.14  
    5.15      .u.privcmd = {
    5.16 -        .hypercall = &netbsd_privcmd_hypercall;
    5.17 +        .hypercall = &netbsd_privcmd_hypercall,
    5.18  
    5.19          .map_foreign_batch = &netbsd_privcmd_map_foreign_batch,
    5.20          .map_foreign_bulk = &xc_map_foreign_bulk_compat,