OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: opensbi@lists.infradead.org
Subject: [PATCH] reproducible builds: strip embedded file paths
Date: Fri, 26 Nov 2021 17:48:11 -0800	[thread overview]
Message-ID: <877dcuweqs.fsf@ponder> (raw)
In-Reply-To: <25ea5b58027e51df4f1399f667d14606b7a4f7b4.camel@126.com>

On 2021-11-22, Xiang W. wrote:
> ? 2021-11-22???? 10:13 +0530?Anup Patel???
>> On Mon, Nov 22, 2021 at 10:02 AM Vagrant Cascadian
>> <vagrant@reproducible-builds.org> wrote:
>> > 
>> > On 2021-11-22, Xiang W. wrote:
>> > > ? 2021-11-21???? 11:20 -0800?Vagrant Cascadian???
>> > > > of the directories below, I built using the same toolchain from
>> > > > the same git commit...
>> > > > 
>> > > > $ cd /home/vagrant/src/opensbi/opensbi1
>> > > > $ CROSS_COMPILE=riscv64-linux-gnu- make V=1 FW_PAYLOAD=n
>> > > > PLATFORM=generic
>> > > > ...
>> > > > $ strings build/platform/generic/firmware/fw_dynamic.bin | grep
>> > > > /home/vagrant
>> > > > /home/vagrant/src/opensbi/opensbi1/lib/sbi/riscv_asm.c
>> > ...
>> > > This is because the source file uses the absolute path when
>> > > compiling,
>> > > you can use the relative path by modifying the Makefile
>> > > 
>> > > diff --git a/Makefile b/Makefile
>> > > index 8623c1c..d017534 100644
>> > > --- a/Makefile
>> > > +++ b/Makefile
>> > > @@ -361,7 +361,7 @@ compile_cc_dep = $(CMD_PREFIX)mkdir -p
>> > > `dirname
>> > > $(1)`; \
>> > > ???????????? -MM $(2) >> $(1) || rm -f $(1)
>> > > ?compile_cc = $(CMD_PREFIX)mkdir -p `dirname $(1)`; \
>> > > ?????????? echo " CC??????? $(subst $(build_dir)/,,$(1))"; \
>> > > -????????? $(CC) $(CFLAGS) $(call dynamic_flags,$(1),$(2)) -c
>> > > $(2) -
>> > > o $(1)
>> > > +????????? $(CC) $(CFLAGS) $(call dynamic_flags,$(1),$(2)) -c
>> > > $(subst $(src_dir)/,,$(2)) -o $(1)
>> > > ?compile_as_dep = $(CMD_PREFIX)mkdir -p `dirname $(1)`; \
>> > > ?????????? echo " AS-DEP??? $(subst $(build_dir)/,,$(1))"; \
>> > > ?????????? printf %s `dirname $(1)`/ > $(1) && \
>> > 
>> > That solves the issue and is probably better than passing more
>> > compiler
>> > arguments, thanks!
>> 
>> This will only work if we are compiling from the OpenSBI source
>> directory
>> itself. What if users compile OpenSBI with a different current
>> directory
>> using "make -C <opensbi_source_path>". I guess passing compiler
>> argument will allow "make -C <opensbi_source_path>".
>
> make -C <directory> will switch the path to <directory> first, so the
> result is the same.

Any outstanding concerns with proposing the patch by Xiang W to pass
relative directories instead of the original patch I submitted?

Should it be submitted by Xiang W or should I merge the commit message
from the original patch and submit it myself?

Thanks!


live well,
  vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/opensbi/attachments/20211126/7eb1c7fd/attachment.sig>

  reply	other threads:[~2021-11-27  1:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  1:05 [PATCH] reproducible builds: strip embedded file paths Vagrant Cascadian
2021-11-21 16:40 ` Xiang W
2021-11-21 16:45   ` Jessica Clarke
2021-11-21 19:20   ` Vagrant Cascadian
2021-11-22  1:45     ` Xiang W
2021-11-22  3:59       ` Vagrant Cascadian
2021-11-22  4:43         ` Anup Patel
2021-11-22  5:44           ` Xiang W
2021-11-27  1:48             ` Vagrant Cascadian [this message]
2021-11-27  4:20               ` Anup Patel
2021-11-27 11:46               ` Xiang W

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=877dcuweqs.fsf@ponder \
    --to=vagrant@reproducible-builds.org \
    --cc=opensbi@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox