[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH ARM v8 3/4] mini-os: arm: build system



On Fri, 2014-10-03 at 10:20 +0100, Thomas Leonard wrote:
> diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile
> index 6d6537e..77dc9aa 100644
> --- a/extras/mini-os/Makefile
> +++ b/extras/mini-os/Makefile

WRT the freeze some of the changes here would appear to also affect x86
builds, which means they need more careful consideration. Konrad CCd.

> @@ -51,7 +51,7 @@ flags-$(CONFIG_XENBUS) += -DCONFIG_XENBUS
>  DEF_CFLAGS += $(flags-y)
>  
>  # Symlinks and headers that must be created before building the C files
> -GENERATED_HEADERS := include/list.h $(ARCH_LINKS) include/mini-os 
> include/xen include/$(TARGET_ARCH_FAM)/mini-os
> +GENERATED_HEADERS := include/list.h $(ARCH_LINKS) include/mini-os 
> include/xen include/$(TARGET_ARCH_FAM)/mini-os include/fdt.h include/libfdt.h
>  
>  EXTRA_DEPS += $(GENERATED_HEADERS)
>  
> @@ -75,7 +75,18 @@ EXTRA_OBJS =
>  TARGET := mini-os
>  
>  # Subdirectories common to mini-os
> -SUBDIRS := lib xenbus console
> +SUBDIRS := lib xenbus console libfdt
> +
> +FDT_SRC :=
> +ifeq ($(XEN_TARGET_ARCH),arm32)
> +# Need libgcc.a for division helpers

Is this the __aeabi_* stuff?

Samuel, is this sort of thing OK in mini-os? Usually on the Xen/kernel
side we avoid libgcc.a and instead have our own copies of such helpers.
I don't recall why, I don't think it is licensing (libgcc has an
exception). Possibly just to give some control over what gets included?

> +LDLIBS += `$(CC) -print-libgcc-file-name`
> +
> +# Device tree support
> +FDT_SRC := libfdt/fdt.c libfdt/fdt_ro.c libfdt/fdt_strerror.c
> +
> +src-y += ${FDT_SRC}

We would normally use $(FDT_SRC) (TBH I'm not sure what the difference
is).

> +endif
>  
>  src-$(CONFIG_BLKFRONT) += blkfront.c
>  src-$(CONFIG_TPMFRONT) += tpmfront.c
> @@ -97,10 +108,13 @@ src-y += sched.c
>  src-$(CONFIG_TEST) += test.c
>  
>  src-y += lib/ctype.c
> +ifneq ($(XEN_TARGET_ARCH),arm32)
>  src-y += lib/math.c
> +endif
>  src-y += lib/printf.c
>  src-y += lib/stack_chk_fail.c
>  src-y += lib/string.c
> +src-y += lib/memmove.c
>  src-y += lib/sys.c
>  src-y += lib/xmalloc.c
>  src-$(CONFIG_XENBUS) += lib/xs.c
> @@ -125,6 +139,21 @@ $(ARCH_LINKS):
>       $(arch_links)
>  endif
>  
> +include/fdt.h:
> +     cp $(XEN_ROOT)/xen/include/xen/libfdt/fdt.h $@
> +
> +include/libfdt.h:
> +     sed 's!xen/libfdt/!!' $(XEN_ROOT)/xen/include/xen/libfdt/libfdt.h > $@

Should both of these not depend on their input?

> +
> +libfdt:
> +     mkdir $@
> +
> +libfdt/libfdt_internal.h: libfdt
> +     cp $(XEN_ROOT)/xen/common/libfdt/libfdt_internal.h $@
> +
> +libfdt/%.c: libfdt libfdt/libfdt_internal.h
> +     cp $(XEN_ROOT)/xen/common/libfdt/$*.c $@

And these too. Would ln -s be better than cp? Or even VPATH tricks?

> @@ -202,6 +235,7 @@ clean:    arch_clean
>               rm -f $$dir/*.o; \
>       done
>       rm -f include/list.h
> +     rm -f ${FDT_SRC} libfdt/libfdt_internal.h

$(FDT_SRC) again.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.