From patchwork Thu Dec 18 10:29:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Merlijn Wajer X-Patchwork-Id: 5512701 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E5EC9F1D4 for ; Thu, 18 Dec 2014 10:30:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C39C20987 for ; Thu, 18 Dec 2014 10:30:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC44520975 for ; Thu, 18 Dec 2014 10:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbaLRKak (ORCPT ); Thu, 18 Dec 2014 05:30:40 -0500 Received: from nala.villavu.com ([188.165.243.101]:51572 "EHLO nala.villavu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751696AbaLRKaj (ORCPT ); Thu, 18 Dec 2014 05:30:39 -0500 Received: from [94.228.130.242] (helo=[10.250.4.102]) by nala.villavu.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80.1) (envelope-from ) id 1Y1YLy-0007ic-2X; Thu, 18 Dec 2014 11:30:42 +0100 Message-ID: <5492AC94.8050104@wizzup.org> Date: Thu, 18 Dec 2014 11:29:40 +0100 From: Merlijn Wajer User-Agent: Mozilla/5.0 (X11; Linux armv7l; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: dsterba@suse.cz, linux-btrfs@vger.kernel.org Subject: Re: [RFC] btrfs-progs: Support for musl libc (and perhaps also uclibc) References: <548C4E9D.2080309@wizzup.org> <20141217164924.GB27601@twin.jikos.cz> In-Reply-To: <20141217164924.GB27601@twin.jikos.cz> X-Enigmail-Version: 1.6 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On 17/12/14 17:49, David Sterba wrote: > On Sat, Dec 13, 2014 at 03:35:09PM +0100, Merlijn Wajer wrote: > [snip] > >> Attached are the two patches generated with git format-patch. I am aware >> that this may not be required format for submitting patches -- but >> please give me some time to get used to the etiquette. :-) > > Thanks, there are minor things that I won't bother to point out to > occasional contributors and fix them myself. The only formal requirement > is the Signed-off-by tag, you can find the description eg. here > > http://lxr.free-electrons.com/source/Documentation/SubmittingPatches#L358 Alright, cool. I've rebased my two patches and used --signoff when amending the commit. Please find the new patches attached. >> Please let me know if musl-libc (or any other libc) is a supported >> platform, and if so, if and how I can improve on said patches. > > I'm not aware of non-glibc users, but I don't see any problem to add > support for more libc implementations. However, I won't regularly verify > that it builds so it might break. That is fine; at this point there are not a lot of people using an alternative libc, so this is common practice. I'll be here with a new round of patches if it breaks in a future release; it shouldn't really break too often. :) > Seems that only standardized library calls are used in btrfs-progs so > any kind of support is probably going to be satisfied by #ifdefs. > Your patches are simple so I'll try to schedule them to some 3.18.x > update. That would be great; thank you. Regards, Merlijn From 5ae5cfa3af473625ef5b31daf5f229f12be753d2 Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Sat, 13 Dec 2014 15:08:43 +0100 Subject: [PATCH 2/2] Disable backtrace and define __always_inline Disable backtrace and define __always_inline when glibc is not used as libc. This, together with some header changes allows btrfs-progs to compile with musl-libc. Signed-off-by: Merlijn Wajer --- kerncompat.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kerncompat.h b/kerncompat.h index 8afadc8..05823a7 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -29,6 +29,12 @@ #include #include #include + +#ifndef __glibc__ +#define BTRFS_DISABLE_BACKTRACE +#define __always_inline __inline __attribute__ ((__always_inline__)) +#endif + #ifndef BTRFS_DISABLE_BACKTRACE #include #endif -- 2.0.4