From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2137.outbound.protection.outlook.com [40.107.20.137]) by sourceware.org (Postfix) with ESMTPS id 637823858D33 for ; Sat, 16 Sep 2023 07:17:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 637823858D33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=qt.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=qt.io ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RoTdCHom3pa2/yhlfVYsfCPO4C7R6TAc5kGzaoNH41JL38tRRXriE0tTDFxvGPNouwWtHBBOZ1HucxrcwSqFwkfouNi9id2CXKSUE5EzjSxvkd979e8fX5b0+bNysy7N9gq04kkYagdaxxrXv2qtTU+SeLoWAJ7LGZjuAokGf5TnPdAIatWMqO5LNpskXhWwCN1gkgIHak1FSNpQhLvwaHJbE1d4bTq93JXe/F847aQHH+uEqpjq+aYgbIkaf1FRrQJZu6aeFqVlFZy5O3zP0yLh46lYeF8W6mwc+yXdWlMjHeXcKYnqKiJDWA5BNph9dk78sNlXaDwlJzEQNXHyJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ukvvzJaeFlX67T+cwybXJojMfig7RKIHN4SJaQxjoA8=; b=obldTK1lZh7DdjZERH+DDn1KziIChItKlmt9XiGCKFwkZGsUifpKVGaMvH52VQ5oM9LZ091GdzXVAwLe0/AEOmUl/I1Q3+1DoZVIan+DYsXZAMAhecagZFORH89zqkHz5EEMYK3Vo8HhnoragfHguAaAS5mhr7YrtuPgTvqaz6WbRsWKqD4M4f63x6cxxQHG40PYs6jphibD3RSQjUrSK9J8paG9RnEVYWvnNC0UsZT10wO5BV6eWKw0DfTikYHyZjcZnhxKvhi/gOFJPqFYhlnzrcqLAPOr6QymqYROQjGCrK1fxnMwMjFa3vdmR0frr5fNP2J+Ipq2Zzym0hpdXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=qt.io; dmarc=pass action=none header.from=qt.io; dkim=pass header.d=qt.io; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qt.io; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ukvvzJaeFlX67T+cwybXJojMfig7RKIHN4SJaQxjoA8=; b=vv00E4XbxTFcwikAZ7tlcqavgTwLUd/MAX1HhysEPshwztPxzzOEGp0FujJ+SJlS6bWae1OcV0eEp3+R+cC1NvO8b/e/aLvcpiuZJIuoRH3aHKXz0ULTw2X6+8yppTCko8usOdJ9SlZHj77fkWzopF0Ecv4JlUKyxe2lp6rAK64= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=qt.io; Received: from AM9PR02MB7500.eurprd02.prod.outlook.com (2603:10a6:20b:433::21) by PAVPR02MB8992.eurprd02.prod.outlook.com (2603:10a6:102:32b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.20; Sat, 16 Sep 2023 07:17:46 +0000 Received: from AM9PR02MB7500.eurprd02.prod.outlook.com ([fe80::eb32:6027:ca45:8f10]) by AM9PR02MB7500.eurprd02.prod.outlook.com ([fe80::eb32:6027:ca45:8f10%5]) with mapi id 15.20.6792.023; Sat, 16 Sep 2023 07:17:46 +0000 Message-ID: Date: Sat, 16 Sep 2023 09:17:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: Building Elfutils with Mingw32 To: Mark Wielaard , "McAllister, Colin" Cc: "elfutils-devel@sourceware.org" References: <05996b4f-8464-ffdf-8629-c1e94aa73052@qt.io> <20230915210056.GA5558@gnu.wildebeest.org> Content-Language: en-US From: Ulf Hermann In-Reply-To: <20230915210056.GA5558@gnu.wildebeest.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BE1P281CA0236.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:8c::20) To AM9PR02MB7500.eurprd02.prod.outlook.com (2603:10a6:20b:433::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR02MB7500:EE_|PAVPR02MB8992:EE_ X-MS-Office365-Filtering-Correlation-Id: 8cf8d39c-ef07-4da2-ce22-08dbb68506c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i3cRig/wUbqouBlUHmEUYHp4gfN/s1mjOHOoGj5XK67XOVE0IcW04Z/EzeeqO2hMTjMGXYb7IklklwlbcF+1QhpwOYmRe90mK85jw91mG+KkE/AErj2N1D5fwOSM25ZDyL7V/l6W+4PgHGJA3Csv6fJik/cp2guv90AvwoK7SqsHMWnkbR2z4ompeLsFsJk8ucpxhaJZQs0U3eVDwg0AmeEa8yKhIRv7d+4KAH4uzC0yrYtTeK0jkf0Kh/DqX6wGoi6KtwFQzlNVBGWZHixg0dzmFkEU9hIBTjxt952EAT3zt1CNLTd5Q+GcAjjDtKKR2wneQyBIwY+e45DnKgUCB1kwSzROS75mSUyJ96NSqt78zn02OKyiDfeEMChVu9kzj4mUz6Qqs0ft+tT/EWQwy4ttdQMVlCeRSnDIIzNRT1l7oapD+xRZrAz2H7EQ4onu2MdthWTr0diXsY0Mg8rxZEdZQB8I9s/RMb0cIZOnxSxLELh1ULdUgscIx+TQHtipCVfLZC8iPjs6skHkVIxAtAs7Wx6vZHEDvKxU06zsIo1EijzBlB4eVCDwIGtFonINJ3LtmB8w4N5IUklV4xNFj+blNQdRbZSCLGZjtHtfYMoCYgC6PGTkeT4M9yGJrsVfjh3S8iE9wmAh06TgAe6PuQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR02MB7500.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(396003)(376002)(346002)(39850400004)(186009)(451199024)(1800799009)(38100700002)(2616005)(6506007)(966005)(478600001)(45080400002)(36756003)(6486002)(6512007)(66556008)(66946007)(110136005)(66476007)(41300700001)(316002)(31686004)(83380400001)(5660300002)(44832011)(2906002)(4326008)(8676002)(8936002)(31696002)(86362001)(66899024)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ak5uOFdNeUJxVUl2ZjJSK3k2Z3l5eisxT2U3aGs1cW01anlqeWVuZkdDd1RK?= =?utf-8?B?ZGFYVHNVd0c4ZTJUNWFGcDZ2dkFHY3lvYmdJbjM2bzhzY1J1YlFHRHo1YXJl?= =?utf-8?B?UTdHNWR0amhPb1ZsdFVoWlJnblhvUmZlRFQ5T2NmajlJRFV0ZGFkSWJIejkx?= =?utf-8?B?NWZOREdCWVBHSCtpZnFMRnRqL1VaM20xVVhqdU5rNWROdDFWMk1UU1cxalk4?= =?utf-8?B?Zm9ZTGRJRG5wbjkrSzFvYkVmekZIN1FvanVKTmlVOWl0R1VEWDh6K3AyRDFj?= =?utf-8?B?ejU3ZDlhamhUSTJyODVscVF5bHhiNjd5WFF1dHJwL0NVUGFJQm5mcXZ6Vm9C?= =?utf-8?B?RFBuNkRINzRORVdYNHVhSmhRTGlXWjNPczRETXVkM0tQNlNmdldqbk9hKzYx?= =?utf-8?B?NUE4VUxiVzFTRWFWdzhIMjVHU0xoVktwZEd0RFRhUFo3RzhyN0d1MVo3TG00?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enant-Network-Message-Id: 8cf8d39c-ef07-4da2-ce22-08dbb68506c9 X-MS-Exchange-CrossTenant-AuthSource: AM9PR02MB7500.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2023 07:17:46.5298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 20d0b167-794d-448a-9d01-aaeccc1124ac X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: poQZZIWiRnnT2AXG+ami8ntObeNsdfQjsSnhK1cw/Jw1Cs+FdyrVWNmUjXelNFfkm5VtYPxHM8QcHg0Nb+PP+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR02MB8992 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, I'll answer some questions here: > Given that Windows doesn't even use ELF why would you even want elfutils on > such a platform? There is a large number of developers who build software for ELF-based embedded systems on windows and test/debug/profile/deploy it over some network or USB connection. Those people want to have elfutils for their debugging and profiling. They want to use elfutils on the host (the windows box) because that is much faster. Those people are not me and I'm not talking about sanity. Qt Creator (the Qt IDE) has a profiling view that takes data produced by perf and paints pretty graphs from that. The actual perf data is recorded on the target (potentially an embedded device), then streamed or copied to the host, then run through perfparser to produce meaningful stack traces. perfparser uses elfutils for the actual work. That work is quite heavy. A sample frequency of 1000Hz is not uncommon. Few embedded device can do that "on the side" while still producing meaningful results for the actual task. Finally, Qt Creator takes the processed data and displays a UI to explore it. There is another UI for the same data, "Hotspot" by Milian, but I don't know if that can run on windows. > And why aren't people simply using cygwin for such a port? If we built perfparser with cygwin, the people who use it would also need cygwin. People building embedded devices generally have a colorful mess of different tools, none of which you can rely on in advance. I haven't considered shipping cygwin with perfparser. Is that actually possible? It looks like it needs some installation procedure I would have to burden the user with. > Without it you don't even have a normal POSIX like system. Indeed, but we have gnulib and the various adapters I wrote myself (some of which should probably be upstreamed to gnulib). That deals with the problem. We get binaries that only depend on a basic windows system. This comes at the price of using the most basic C library that Microsoft offers, msvcrt.dll. In order to use the elfutils libraries built that way you have to jump through the open/close and malloc/free hoops we provide in eu_compat.lib. However, that is only a problem for perfparser or other software linked against elfutils, not for the user. > And when using mingw do people still use a normal gcc compiler (to cross > build)? Or is the goal to build with some alternative windows > compiler? The gold standard would indeed be the ability to build it with Microsoft compilers and their associated C libraries. Then we could get rid of the malloc/free and open/close hacks. However, given that Microsoft compilers have a rather different idea of C than elfutils, I didn't go there. Building it with gcc is more overhead for me when producing the binary. I cannot cleanly integrate it into the Qt Creator build system since that assumes it can use the same compiler for everything. However, for the users it doesn't make a difference. > But if there is consensus (among the Windows hackers) about using one > common target for the port then maybe we should have an official > branch on sourceware? Such a thing would certainly be welcome from my point of view! > Also there is a mingw container setup on builder.sourceware.org which > we might use for doing CI on the port? > https://sourceware.org/cgit/builder/tree/builder/containers/Containerfile-fedora-mingw I'll have to look at it in detail, but that also sounds great! So far there is no automated CI. I just run the tests manually when I change anything. best regards, Ulf