[OE-core] [PATCH] u-boot-mkimage: fix a building failure on OpenSus

Rongqing Li rongqing.li at windriver.com
Thu Jul 30 06:26:47 UTC 2015



On 2015年07月28日 19:47, Burton, Ross wrote:
>
> On 28 July 2015 at 03:00, <rongqing.li at windriver.com
> <mailto:rongqing.li at windriver.com>> wrote:
>
>     +config.mk <http://config.mk> will be included only if auto.conf is
>     newer than .config
>     +but in some system, the HPET is not enabled, the smallest unit of
>     +time is second, and can not decise which file is newer, even if
>     +the correct dependency has been created.
>     +
>     +The below shows unit of time:
>     +
>     +under SUSE Linux Enterprise Desktop 11 SP2  (i586):
>     +    $ls --full-time include/config/auto.conf .config
>     +    2015-07-27 03:46:20.000000000 -0400 .config
>     +    2015-07-27 03:46:20.000000000 -0400 include/config/auto.conf
>     +    $
>     +
>     +under Ubuntu 14.04 LTS:
>     +    $ ls --full-time include/config/auto.conf .config
>     +    2015-07-27 13:40:14.008703027 +0800 .config
>     +    2015-07-27 13:40:15.020703054 +0800 include/config/auto.conf
>     +    $
>     +
>     +The rule of including config.mk <http://config.mk> in Makefile as below
>     +    autoconf_is_current := $(if $(wildcard
>     $(KCONFIG_CONFIG)),$(shell find . \
>     +                    -path ./include/config/auto.conf -newer
>     $(KCONFIG_CONFIG)))
>     +    ifneq ($(autoconf_is_current),)
>     +    include $(srctree)/config.mk <http://config.mk>
>     +    include $(srctree)/arch/$(ARCH)/Makefile
>     +    endif
>     +
>     +The compilation will be failed if config.mk <http://config.mk> is
>     not included
>     +so delay 1 second to create auto.conf after creating of .config
>
>
> Adding a sleep seems pretty ugly, wouldn't a neater fix be to change the
> logic so that instead of the test being "is newer" you use "is not
> older", to handle identical timestamps as being current.
>
> Ross

u-boot-mkimage just be upgraded, and has the similar your suggestive fix:





commit cffcd2861310855130db52c93f7bf4d9b511741d
Author: Masahiro Yamada <yamada.masahiro at socionext.com>
Date:   Fri Apr 3 12:30:25 2015 +0900

     kbuild: include config.mk when auto.conf is not older than .config

     Since the Kconfig conversion, config.mk has been included only when
     include/config/auto.conf is newer than the .config file.

     It causes build error if both files have the same time-stamps.
     It is actually possible because EXT* file systems have a 1s time-stamp
     resolution.

     The config.mk should be included when include/config/auto.conf is
     *not older* than the .config file.

     Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
     Reported-by: Tom Rini <trini at konsulko.com>
     Reported-by: York Sun <yorksun at freescale.com>
     Reported-by: Stephen Warren <swarren at nvidia.com>
     Reported-by: Matthew Gerlach <mgerlach at opensource.altera.com>
     Tested-by: Stephen Warren <swarren at nvidia.com>

diff --git a/Makefile b/Makefile
index f1bce44..53ad450 100644
--- a/Makefile
+++ b/Makefile
@@ -513,12 +513,16 @@ include/config/%.conf: $(KCONFIG_CONFIG) 
include/config/auto.conf.cmd
  # is up-to-date. When we switch to a different board configuration, 
old CONFIG
  # macros are still remaining in include/config/auto.conf. Without the 
following
  # gimmick, wrong config.mk would be included leading nasty 
warnings/errors.
-autoconf_is_current := $(if $(wildcard $(KCONFIG_CONFIG)),$(shell find . \
-               -path ./include/config/auto.conf -newer $(KCONFIG_CONFIG)))
-ifneq ($(autoconf_is_current),)
+ifneq ($(wildcard $(KCONFIG_CONFIG)),)
+ifneq ($(wildcard include/config/auto.conf),)
+autoconf_is_old := $(shell find . -path ./$(KCONFIG_CONFIG) -newer \
+                                               include/config/auto.conf)
+ifeq ($(autoconf_is_old),)
  include $(srctree)/config.mk
  include $(srctree)/arch/$(ARCH)/Makefile
  endif
+endif
+endif

  # If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
  # that (or fail if absent).  Otherwise, search for a linker script in a



-- 
Best Reagrds,
Roy | RongQing Li



More information about the Openembedded-core mailing list