[Skiboot] [PATCH] pflash: Clean up makefiles and resolve build race
Stewart Smith
stewart at linux.vnet.ibm.com
Wed Jul 27 18:15:46 AEST 2016
Joel Stanley <joel at jms.id.au> writes:
> The pflash build process has regressed from when the were last fixed in
> 6c21c4ffaf82.
>
> This patch resolves that issue and performs some cleanups:
>
> - Remove duplicated rules. Patches had moved rules into common files,
> but forgotten to remove them from the pflash makefiles.
>
> - Make assignements simply expanded variables where possible. Form the
> make manual:
>
> Functions referenced in the definition will be executed every time
> the variable is expanded. This makes make run slower; worse, it
> causes the wildcard and shell functions to give unpredictable
> results because you cannot easily control when they are called, or
> even how many times.
>
> To avoid all the problems and inconveniences of recursively
> expanded variables, there is another flavor: simply expanded
> variables.
>
> - set the 'shared' target as a dependency of the libflash objects. This
> was the final piece to resolve the race condition.
>
> The failed build could be reproduced by doing a `git clean -f -x` and
> then running the following:
>
> $ make -j 32 CROSS_COMPILE=arm-linux-gnueabi- SKIBOOT_VERSION=5.2.4
> PFLASH_VERSION=5.2.4 V=1 -C external/pflash all LINKAGE=dynamic
> make: Entering directory '/home/joel/dev/skiboot/external/pflash'
> ln -sf ../../libflash ./libflash
> ln -sf ../../ccan ./ccan
> ln -sf ../common ./common
> cc -O2 -Wall -I. -c pflash.c -o pflash.o
> cc -O2 -Wall -I. -c progress.c -o progress.o
> make -C ../shared
> make[1]: Entering directory '/home/joel/dev/skiboot/external/shared'
> ln -sf ../../hw/ast-bmc/ast-sf-ctrl.c common/ast-sf-ctrl.c
> ln -sf ../../include/ast.h common/ast.h
> ln -sf arch_flash_arm_io.h common/io.h
> cc -O2 -Wall -I. -c common/arch_flash_common.c -o
> common-arch_flash_common.o
> cc -O2 -Wall -I. -c common/arch_flash_arm.c -o common-arch_flash_arm.o
> cc -O2 -Wall -I. -c common/ast-sf-ctrl.c -o common-ast-sf-ctrl.o
> cc -O2 -Wall -I. -c version.c -o version.o
> ld -r common-arch_flash_common.o common-arch_flash_arm.o
> common-ast-sf-ctrl.o -o common-arch_flash.o
> ln -sf ../../libflash ./libflash
> ln -sf ../../ccan ./ccan
> ln -sf ../common ./common
> make[1]: *** No rule to make target 'libflash/file.c', needed by
> 'libflash-file.o'. Stop.
> make[1]: *** Waiting for unfinished jobs....
> make[1]: Leaving directory '/home/joel/dev/skiboot/external/shared'
> rules.mk:25: recipe for target
> '../shared/libflash.so.skiboot-5.2.4-1-g9f13f64c322f-joel-dirty-d5873ce'
> failed
> make: ***
> [../shared/libflash.so.skiboot-5.2.4-1-g9f13f64c322f-joel-dirty-d5873ce]
> Error 2
>
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> ---
>
> Stewart, please apply to master and 5.2 stable.
Thanks, merged to both:
5.2.x: 8692215d6ff81a935e8086ccff6c05e9dc2cc6be
master: c327edd
--
Stewart Smith
OPAL Architect, IBM.
More information about the Skiboot
mailing list