debuggers.hg

changeset 22681:97779ffa76f5

libxc: Use .opic to build xenctrl_osdep_ENOSYS.so

Resolves build error:
/usr/bin/ld: xenctrl_osdep_ENOSYS.o: relocation R_X86_64_32
against `a local symbol' can not be used when making a shared
object; recompile with -fPIC
xenctrl_osdep_ENOSYS.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

Clean up object files correctly too.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir@xen.org>
date Fri Dec 24 10:17:49 2010 +0000 (2010-12-24)
parents 0292bec5e98d
children 1bc031edae04
files tools/libxc/Makefile
line diff
     1.1 --- a/tools/libxc/Makefile	Fri Dec 24 10:14:58 2010 +0000
     1.2 +++ b/tools/libxc/Makefile	Fri Dec 24 10:17:49 2010 +0000
     1.3 @@ -62,6 +62,8 @@ GUEST_SRCS-$(CONFIG_X86)     += xc_dom_x
     1.4  GUEST_SRCS-$(CONFIG_X86)     += xc_cpuid_x86.c
     1.5  GUEST_SRCS-$(CONFIG_IA64)    += xc_dom_ia64.c
     1.6  
     1.7 +OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
     1.8 +
     1.9  -include $(XEN_TARGET_ARCH)/Makefile
    1.10  
    1.11  CFLAGS   += -Werror -Wmissing-prototypes
    1.12 @@ -82,6 +84,9 @@ CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$
    1.13  GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
    1.14  GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
    1.15  
    1.16 +OSDEP_LIB_OBJS := $(patsubst %.c,%.o,$(OSDEP_SRCS-y))
    1.17 +OSDEP_PIC_OBJS := $(patsubst %.c,%.opic,$(OSDEP_SRCS-y))
    1.18 +
    1.19  LIB := libxenctrl.a
    1.20  ifneq ($(stubdom),y)
    1.21  LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
    1.22 @@ -129,7 +134,8 @@ TAGS:
    1.23  clean:
    1.24  	rm -rf *.rpm $(LIB) *~ $(DEPS) \
    1.25              $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
    1.26 -            $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
    1.27 +            $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \
    1.28 +            $(OSDEP_LIB_OBJS) $(OSDEP_PIC_OBJS)
    1.29  
    1.30  .PHONY: rpm
    1.31  rpm: build
    1.32 @@ -190,8 +196,8 @@ libxenguest.so.$(MAJOR).$(MINOR): COMPRE
    1.33  libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
    1.34  	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz -lxenctrl $(PTHREAD_LIBS)
    1.35  
    1.36 -xenctrl_osdep_ENOSYS.so: xenctrl_osdep_ENOSYS.o libxenctrl.so
    1.37 -	$(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ xenctrl_osdep_ENOSYS.o -lxenctrl
    1.38 +xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so
    1.39 +	$(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) -lxenctrl
    1.40  
    1.41  -include $(DEPS)
    1.42