Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3951465pxf; Mon, 29 Mar 2021 16:34:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw51UEiZmAlqQ9tRuGsN1S4TnEzqWj4sTIl6Xji6kX3eLTfVwrPDGZc4jfchGhSSZDJeeRT X-Received: by 2002:aa7:c150:: with SMTP id r16mr30341577edp.96.1617060875099; Mon, 29 Mar 2021 16:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617060875; cv=none; d=google.com; s=arc-20160816; b=cPpdrflz1ZTBD3KFCgvuFNilAbclrladKn6VAPBTunzk4VC+w6S6rSVr+odtE5LdH2 A4McTbmLFXbHeoIlTuBQtAXbfxHqBPTxmch6uaXHu6J1ZLi1OGUvc+I6cJhUCstRQ8jP ROgvCLZm5Nw5bl3RzF/lY8vYgzXtR0fxKDpzgPwyniARW4V/C649l1Mtd96ySqyLYQIc QMgCl3lqppj2lCc4KNjobxPuFGRLdHODkFTxzj1hoCHG8kY9jgKtfi4DVIRjmiTEQAm8 INmR7ogv2OC7cVN9D0mTGCglxtPIhliUqpFbc1tWqL9Cg4vQ70DU68wnoJdtNnHRalr/ 6WNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:mime-version :dkim-signature; bh=e2JYMGScRSVZMfFXQMv1S/5M/YAYIAEgmCeN/0UgUAY=; b=B/ckxKMVNg+7HeSNYMHaiRjNPDN6PtbPuuoMzwtMU0U1KAYxjkzBum9/6g84ZdYnuA qmg6iIiPRhebexjsE3d1R+e8ABVekPJr7SKDwsfAa241KzHCfunVvOR+WVerZbUwAAAZ 464lh/pjTx7V0Q5oPNDhDTiymK3AjYIOOfYdKKwwBQQggPv6EVlt7bSBX/tQuU4PJQNB sCnmEM2mNPWrpV32dU9B/aLNJOwECc/uQ7dog7yDRjUjTpUu8ykGKQFcfgVbxFmD2iMS H04TM1DA8Zt/MAiwFXwv1c/gSfaIpo8OKR7dfmN+r2/OYenfhdGBcPysDsGvd2TOTrES wLoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cBRwnZEY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si13684445edw.468.2021.03.29.16.34.13; Mon, 29 Mar 2021 16:34:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cBRwnZEY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbhC2XbQ (ORCPT + 99 others); Mon, 29 Mar 2021 19:31:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230366AbhC2XbF (ORCPT ); Mon, 29 Mar 2021 19:31:05 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CC3FC061762 for ; Mon, 29 Mar 2021 16:31:05 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id c17so12661198ilj.7 for ; Mon, 29 Mar 2021 16:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=e2JYMGScRSVZMfFXQMv1S/5M/YAYIAEgmCeN/0UgUAY=; b=cBRwnZEYaK65xqJKBC3hSioYdLFSKIZW5Lh07w5lvRUPgNt59HLfeffOyGDtxj9BIj AwPi5NwPnqwepBMgJ16LnjiDaw3DbiD8Lpj4N1lpnNML4CTN7+TamhmpZyi8mxwY6n4I OGLbXO0u/gXX2iAfdz7Kw4OJSVbFRVvYsShc81f/A4rO0z4yZKoinE/byJNuQMZJsGhX jZBz4mYnZnzYjYLjgZCxJ0PpuWiMAWqESdd18CBnRSZS3kssWzQJKw2FpV4h62zqVX4O q0AB5+ujCjmuxvy3pAtTpMP5MNqLSfSocasryx7CQBYX81WO+c3XWhvXN8aWi7woN6T0 hoEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=e2JYMGScRSVZMfFXQMv1S/5M/YAYIAEgmCeN/0UgUAY=; b=ha2dhh78aUtn9hD4qzSO9EstEw5d/IywKTpWh3VglwGfd3k8YnuBymbHSQO3ibczJt J5OM+AMav1GTYDBciGbaVlcVULoHa5PMQIlx/gGBTxzEogFn1kPsMx0G3UAqP1eSt4Lg 8ucquCzKpY0WodTg9U1eyhxagU3bthTFPiXPx2H26n4qAPhmtzgP59I5+puv6EgnPkv1 6T+RToT38bBxoosACt/ONFvOTWmJBuC14cHik6qfsHZ89mgpkaQKkbMHj/sQ+YZq9+2i LHk7HHx1WkXQw/r+E8PjKFZ/mB+SGMU3GYv8Ti/ew5o12+2do9g1KKG80ceCdu++CLX9 RxeQ== X-Gm-Message-State: AOAM533hPaGZigGS2mXPP3POFoCI+EY31lb0QJYu07k/WJ98ZLW8NRpU l1Q+YM4ZFllash2tWfTbqe9LSKVad50k46eF3cbC/FBL3NbbBQ== X-Received: by 2002:a92:3647:: with SMTP id d7mr24061090ilf.264.1617060663407; Mon, 29 Mar 2021 16:31:03 -0700 (PDT) MIME-Version: 1.0 From: Chris Packham Date: Tue, 30 Mar 2021 12:30:52 +1300 Message-ID: Subject: Linux include/uapi/linux/libc-compat.h and Musl include/netinet/in.h incompatibility for __UAPI_DEF_IN6_ADDR_ALT To: linux-kernel@vger.kernel.org, musl@lists.openwall.com, carlos@redhat.com, davem@davemloft.net Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I've come over from https://github.com/strace/strace/issues/177 there's a bit of context there. Crosstool-ng has hit a problem when building a recent enough version of strace in a configuration that uses musl libc. The error is [ALL ] In file included from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/in6.h:26, [ALL ] from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/if_bridge.h:19, [ALL ] from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:16: [ERROR] /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/libc-compat.h:109: error: "__UAPI_DEF_IN6_ADDR_ALT" redefined [-Werror] [ALL ] 109 | #define __UAPI_DEF_IN6_ADDR_ALT 1 [ALL ] | [ALL ] In file included from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:15: [ALL ] /home/x-tool/x-tools/arm-unknown-linux-musleabi/arm-unknown-linux-musleabi/sysroot/usr/include/netinet/in.h:401: note: this is the location of the previous definition [ALL ] 401 | #define __UAPI_DEF_IN6_ADDR_ALT 0 [ALL ] | [ALL ] cc1: all warnings being treated as errors [ERROR] make[4]: *** [Makefile:6660: libstrace_a-rtnl_mdb.o] Error 1 [ALL ] make[4]: Leaving directory '/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace/src' [ERROR] make[3]: *** [Makefile:2404: all] Error 2 [ALL ] rm ioctlsort0.o ioctls_all0.h ioctlsort0 [ALL ] make[3]: Leaving directory '/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace/src' [ERROR] make[2]: *** [Makefile:601: all-recursive] Error 1 [ALL ] make[2]: Leaving directory '/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace' [ERROR] make[1]: *** [Makefile:506: all] Error 2 [ALL ] make[1]: Leaving directory '/home/x-tool/.build/arm-unknown-linux-musleabi/build/build-strace' It appears that the bundled uapi headers definition of __UAPI_DEF_IN6_ADDR_ALT conflicts with the musl libc definition. It looks like libc-compat.h tries to co-exists with GNU libc but this isn't working for musl. I've identified an egregious hack that I think should make things work (CFLAGS+=-D__USE_MISC) but I wanted to know if there was a nicer way to make this work. Regards, Chris