From: Eric Sandeen <sandeen@redhat.com>
To: dsterba@suse.cz, Hallo32 <Hallo32@gmx.net>,
Qu Wenruo <quwenruo.btrfs@gmx.com>,
kreijack@inwind.it, linux-btrfs@vger.kernel.org
Subject: Re: btrfs-progs-v4.12: cross compiling
Date: Tue, 15 Aug 2017 12:28:52 -0500 [thread overview]
Message-ID: <0f50ee70-d546-6aff-b57d-1283eadefa15@redhat.com> (raw)
In-Reply-To: <20170815124807.GZ2866@twin.jikos.cz>
On 8/15/17 7:48 AM, David Sterba wrote:
> On Tue, Aug 15, 2017 at 02:44:07PM +0200, Hallo32 wrote:
...
>>>> How the kernel deals with this kind of problem ?
>>>> Looking at the source of btrfs Makefile, it is more simple to replace
>>>>
>>>> mktables: kernel-lib/mktables.c
>>>> @echo " [CC] $@"
>>>> $(Q)$(CC) $(CFLAGS) $< -o $@
>>>>
>>>> with
>>>>
>>>>
>>>> mktables: kernel-lib/mktables.c
>>>> @echo " [HOSTCC] $@"
>>>> $(Q)$(HOSTCC) $(CFLAGS) $< -o $@
>>>>
>>>> where HOSTCC is defined as
>>>>
>>>> HOSTCC=gcc
>>>>
>>>>
>>>> (may be the same applied also to CFLAGS <-> HOSTCFLAGS ?)
>>>
>>> If using HOSTCC then I'm fine with it.
>>
>> CFLAGS needs also be replaced by something like HOSTCFLAGS, because if
>> you use something like mips/architecture specific CFLAGS, they may be
>> not applicably on the host system.
>
> Good point. Without a regular/automated cross-compilation build testing
> I think we could break it quite easily. I'm going to keep the
> pregenerated file in git.
Isn't using the host compiler for some binaries during a cross-compile
a very standard thing to do?
The kernel manages it, as shown above. xfsprogs does it (see libxfs/Makefile
for the crc32table.h and crc32selftest targets), e2fsprogs does it (see
gen_crc32ctable target in lib/ext2fs/Makefile), etc.
Seems that checking in a generated file would be more prone to eventual
errors, no?
I guess it's harder to do in btrfs-progs since it's not using autotools...
-Eric
next prev parent reply other threads:[~2017-08-15 17:28 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
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 [this message]
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=0f50ee70-d546-6aff-b57d-1283eadefa15@redhat.com \
--to=sandeen@redhat.com \
--cc=Hallo32@gmx.net \
--cc=dsterba@suse.cz \
--cc=kreijack@inwind.it \
--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