Re: vDSO for ppc64 : Preliminary release #4

From: Sam Ravnborg
Date: Fri Sep 10 2004 - 15:43:35 EST


Hi Ben.

I would prefer to use a bit more core kbuild stuff.
Could you please try my version below (needs to be applied manually).

Let me know how it turns out.

Sam


On Fri, Sep 10, 2004 at 04:51:42PM +1000, Benjamin Herrenschmidt wrote:
> diff -urN linux-2.5/arch/ppc64/kernel/vdso32/Makefile linux-vdso/arch/ppc64/kernel/vdso32/Makefile
> --- /dev/null 2004-09-01 15:26:22.000000000 +1000
> +++ linux-vdso/arch/ppc64/kernel/vdso32/Makefile 2004-09-07 18:25:44.000000000 +1000
> @@ -0,0 +1,51 @@
> +# Choose compiler

> +#
> +# XXX FIXME: We probably want to enforce using a biarch compiler by default
> +# and thus use (CC) with -m64, while letting the user pass a
> +# CROSS32_COMPILE prefix if wanted. Same goes for the zImage
> +# wrappers
> +#
> +
> +CROSS32_COMPILE ?=
> +
> +CROSS32CC := $(CROSS32_COMPILE)gcc
> +CROSS32AS := $(CROSS32_COMPILE)as
> +
> +# List of files in the vdso, has to be asm only for now
> +
> +src-vdso32 = sigtramp.S gettimeofday.S datapage.S
> +
> +# Build rules
> +
> +obj-vdso32 := $(addsuffix .o, $(basename $(src-vdso32))
targets := $(obj-vdso32)
-> So they get removed by make clean

> +obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
> +src-vdso32 := $(addprefix $(src)/, $(src-vdso32))
OK.

> +
> +VDSO32_CFLAGS := -shared -s -fno-common -Iinclude -fno-builtin -nostdlib
> +VDSO32_CFLAGS += -Wl,-soname=linux-vdso32.so.1
> +VDSO32_AFLAGS := -D__ASSEMBLY__ -D__KERNEL__ -D__VDSO32__ -s -nostdinc -Iinclude

Replace with:
EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1

EXTRA_AFLAGS := -D__VDSO32__ -s

> +obj-y += vdso32_wrapper.o
-> This causes built-in.o to be generated, which is fine.

> +extra-y += vdso32.lds
> +CPPFLAGS_vdso32.lds += -P -C -U$(ARCH)
OK

> +# Force dependency (incbin is bad)
> +$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
OK

> +# link rule for the .so file, .lds has to be first
> +$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32)
> + $(call if_changed,vdso32ld)
OK

> +
> +# assembly rules for the .S files
> +# This is probably wrong with split src & obj trees
> +$(obj-vdso32): %.o: %.S
> + $(call if_changed_dep,vdso32as)
OK - but see below


> +# actual build commands
> +quiet_cmd_vdso32ld = VDSO32L $@

cmd_vdso32ld = $(CROSS32CC) $(cflags) -Wl,-T $^ -o $@
Utilising $(cflags) gives:
-> Correct $(depfile)
-> Expanded include paths

> +quiet_cmd_vdso32as = VDSO32A $@
> + cmd_vdso32as = $(CROSS32CC) $(aflags) -c -o $@ $^
Same here.

> +
> +targets += vdso32.so
OK - but put it closer to the rule that generates it.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/