All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junling Zheng <zhengjunling@huawei.com>
To: "Burton, Ross" <ross.burton@intel.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>,
	"peifeiyue@huawei.com" <peifeiyue@huawei.com>
Subject: Re: [PATCH] file: remove the original magic.h
Date: Fri, 27 Mar 2015 11:31:34 +0800	[thread overview]
Message-ID: <5514CF16.2020804@huawei.com> (raw)
In-Reply-To: <CAJTo0LYk7tA=5Vos6BC4j8cC5V=9TK4BZ9H0j0RQeajQuo=D0A@mail.gmail.com>

On 2015/3/26 21:08, Burton, Ross wrote:
> 
> On 26 March 2015 at 12:58, Junling Zheng <zhengjunling@huawei.com <mailto:zhengjunling@huawei.com>> wrote:
> 
>     This problem is that sometimes the magic.h wouldn't be generated again by magic.h.in <http://magic.h.in> if there
>     is already an original magic.h, and we may get an unexpected header file.
> 
> 
> libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
>         encoding.c compress.c is_tar.c readelf.c print.c fsmagic.c \
>         funcs.c file.h readelf.h tar.h apptype.c \
>         file_opts.h elfclass.h mygetopt.h cdf.c cdf_time.c readcdf.c cdf.h
> 
> The problem is that the makefile doesn't actually say that the magic binaries depend on magic.h, so make is perfectly reasonably to build the binaries and then re-generate the makefile.
> 
> The correct fix here is to add magic.h to libmagic_la_SOURCES.
> 
> Ross
>
Hi, Ross

I don't think the dependency is the true reason, and I have tested it.

I add the magic.h to libmagic_la_SOURCES, and then make several times.

However, it's disappointing that sometimes the magic.h does still not generated again by the different magic.h.in.

I think the dependency of magic.h for magic binaries has been already declared in Makefile:

BUILT_SOURCES = magic.h
all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am

The following is the comparison of the incorrect and the correct log of compiling:

z00238152@Patch-Test:~>0$ diff -ru log.do_compile.incorrect log.do_compile.correct
--- log.do_compile.incorrect	2015-03-27 11:05:23.000000000 +0800
+++ log.do_compile.correct	2015-03-27 11:09:27.000000000 +0800
@@ -5,6 +5,7 @@
 make[1]: Entering directory `/home/z00238152/halogen/build-fluorine-arma9el-qemu-HULK/tmp-eglibc/work/armv7a-euler-linux-gnueabi/file/5.14-r0/file-5.14'
 Making all in src
 make[2]: Entering directory `/home/z00238152/halogen/build-fluorine-arma9el-qemu-HULK/tmp-eglibc/work/armv7a-euler-linux-gnueabi/file/5.14-r0/file-5.14/src'
+sed -e "s/X.YY/$(echo 5.14 | tr -d .)/" < ../src/magic.h.in > magic.h
 make  all-am
 make[3]: Entering directory `/home/z00238152/halogen/build-fluorine-arma9el-qemu-HULK/tmp-eglibc/work/armv7a-euler-linux-gnueabi/file/5.14-r0/file-5.14/src'

And the Makefile in src directory is the same:

z00238152@Patch-Test:~>0$ diff -ru Makefile.incorrect Makefile.correct
z00238152@Patch-Test:~>0$

And I set the PARALLEL_MAKE ?= "-j 1", the problem also doesn't be fixed.

So I think the true reason is that if the magic.h exists already, sometimes Makefile will not generate it again.



  reply	other threads:[~2015-03-27  3:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26  9:18 [PATCH] file: remove the original magic.h Junling Zheng
2015-03-26  9:54 ` Richard Purdie
2015-03-26 11:31   ` Junling Zheng
2015-03-26 11:58     ` Jack Mitchell
2015-03-26 12:58       ` Junling Zheng
2015-03-26 13:08         ` Burton, Ross
2015-03-27  3:31           ` Junling Zheng [this message]
2015-03-27  9:56             ` Burton, Ross
2015-03-28  2:36               ` Junling Zheng
2015-03-28  8:53                 ` Richard Purdie
2015-03-28  9:37                   ` Junling Zheng
2015-03-28 11:05                     ` Richard Purdie
2015-03-30  1:49                       ` Junling Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5514CF16.2020804@huawei.com \
    --to=zhengjunling@huawei.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peifeiyue@huawei.com \
    --cc=ross.burton@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.