public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: dsterba@suse.cz, Hallo32 <Hallo32@gmx.net>, linux-btrfs@vger.kernel.org
Subject: Re: btrfs-progs-v4.12: cross compiling
Date: Mon, 14 Aug 2017 17:10:52 +0200	[thread overview]
Message-ID: <20170814151052.GV2866@twin.jikos.cz> (raw)
In-Reply-To: <159b3db0-6eae-7cff-d166-3c4b0c2513ac@gmx.com>

On Mon, Aug 14, 2017 at 10:14:42PM +0800, Qu Wenruo wrote:
> On 2017年08月14日 22:03, David Sterba wrote:
> > On Mon, Aug 14, 2017 at 09:17:08PM +0800, Qu Wenruo wrote:
> >> On 2017年08月14日 21:06, David Sterba wrote:
> >>> On Mon, Aug 14, 2017 at 02:17:26PM +0200, Hallo32 wrote:
> >>>> Since versions 4.12 btrfs-progs is complicated to cross compile for
> >>>> other systems.
> >>>> The problem is, that this version includes mktables, which needs to be
> >>>> compiled for the host system and executed there for the creation of
> >>>> tables.c.
> >>>>
> >>>> Are there any changes planed for the next version of btrfs-progs to make
> >>>> the cross compiling as simple as in the past? A included tables.c for
> >>>> example?
> >>>
> >>> Yes, keeping the generated tables.c around is fine. There's no reason it
> >>> needs to be generated each time during build. I'll fix that in 4.12.1.
> >>
> >> But the number of lines and impossibility to review it makes it not
> >> suitable to be managed by git.
> > 
> > I don't understand your concern. The file is generated from a set of
> > formulas, not intended to be updated directly.
> 
> Yes, it should never be updated directly, so it's generated by a less 
> than 400 lines program, instead of a whole 10K+ lines file managed by git.

mktables.c is synced from kernel sources, taking updates from there is
easier than porting any changes to the proposed scripted implementation.

The workflow is simple:
- copy kernel mktables.c changes to btrfs-progs mktables.c
- compile mktables
- run 'make kernel-lib/tables.c'
- commit the changes to git

All of that happens very rarely, if ever, the raid56 tables and
correction algorithms are set in stone. Any extensions need to be done
on both sides kernel/userspace.

> >> What about using script to generate it?
> > 
> > We do have the mktables utility to generate it and I'll regenerate it
> > should there be a change to kernel-lib/mktables.c
> 
> I mean to replace mktables.c with a script.
> So no cross compiler problems at all, and even easier Makefile.
> No dependence on "mktables" program.

Somebody has to implement the script and verify that the output is the
same, eventually sync changes. The cross-compilation should be fixed
with the pregenerated tables.c . Is Makefile size really a concern? The
number of related lines is like 7. I don't see any benefit in what you
propose and hopefully explained my viewpoint enough so I don't have to
continue.

  reply	other threads:[~2017-08-14 15:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 12:17 btrfs-progs-v4.12: cross compiling Hallo32
2017-08-14 13:06 ` David Sterba
2017-08-14 13:17   ` Qu Wenruo
2017-08-14 14:03     ` David Sterba
2017-08-14 14:14       ` Qu Wenruo
2017-08-14 15:10         ` David Sterba [this message]
2017-08-14 18:57           ` Goffredo Baroncelli
2017-08-14 23:39             ` Qu Wenruo
2017-08-15 12:44               ` Hallo32
2017-08-15 12:48                 ` David Sterba
2017-08-15 17:28                   ` Eric Sandeen
2017-08-15 18:14                     ` Eric Sandeen
2017-08-16  0:13                     ` Qu Wenruo
2017-08-15 19:27           ` Jeff Mahoney
2017-08-14 13:10 ` Qu Wenruo

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=20170814151052.GV2866@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=Hallo32@gmx.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox