From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 28 21:37:40 2022 Received: (at submit) by debbugs.gnu.org; 29 Mar 2022 01:37:40 +0000 Received: from localhost ([127.0.0.1]:59473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZ0nk-0003S6-Cu for submit@debbugs.gnu.org; Mon, 28 Mar 2022 21:37:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:37668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZ0ni-0003Rx-Iw for submit@debbugs.gnu.org; Mon, 28 Mar 2022 21:37:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ0ni-0002F7-2C for guix-patches@gnu.org; Mon, 28 Mar 2022 21:37:38 -0400 Received: from mn-69-69-108-139.sta.embarqhsd.net ([69.69.108.139]:2253 helo=mail.kubisiak.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZ0ng-0007kX-H0 for guix-patches@gnu.org; Mon, 28 Mar 2022 21:37:37 -0400 Received: from peregrine (108-237-41-25.lightspeed.sntcca.sbcglobal.net [108.237.41.25]) by mail.kubisiak.com with ESMTPSA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Mon, 28 Mar 2022 20:37:29 -0500 Date: Mon, 28 Mar 2022 18:37:28 -0700 From: Brian Kubisiak To: guix-patches@gnu.org Subject: [PATCH] gnu: lsof: Fix cross-compilation. Message-ID: <20220329013728.d2flni2rrt46wyes@peregrine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=69.69.108.139; envelope-from=brian@kubisiak.com; helo=mail.kubisiak.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, PDS_RDNS_DYNAMIC_FP=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * gnu/packages/lsof (lsof)[arguments]: Add LINUX_CONF_CC environment variable. --- gnu/packages/lsof.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/packages/lsof.scm b/gnu/packages/lsof.scm index 98bcdab468..f872eb8de8 100644 --- a/gnu/packages/lsof.scm +++ b/gnu/packages/lsof.scm @@ -54,6 +54,7 @@ (define-public lsof (replace 'configure (lambda _ (setenv "LSOF_CC" ,(cc-for-target)) + (setenv "LINUX_CONF_CC" "gcc") (setenv "LSOF_MAKE" "make") ;; By default, the makefile captures the output of 'uname -a'. -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 04:52:10 2022 Received: (at 54619) by debbugs.gnu.org; 29 Mar 2022 08:52:10 +0000 Received: from localhost ([127.0.0.1]:59757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZ7aE-0006F3-7q for submit@debbugs.gnu.org; Tue, 29 Mar 2022 04:52:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZ7aD-0006Eq-1u for 54619@debbugs.gnu.org; Tue, 29 Mar 2022 04:52:09 -0400 Received: from [2001:470:142:3::e] (port=60328 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ7a7-0001UN-6r; Tue, 29 Mar 2022 04:52:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=wzYwznNKIbQD+tlKQxHnc0+mozudzTTcTiw+6Vr7npY=; b=T5itVF8TkiPrLnlY9oft 2aJaepMWzb3oeqlCu3kdF51nm0U2Xw07reh41VUW7TaNeooONzeu2Ur9++Qw+AewYIkp+vB1b02Iu +bnfq0JCzjahFgqll9rbLF/zDudvarEjVJ6FI0NTO2xd9Mgf33MWEcc1ZXp35yB5OZ6PbTZhGiM6O XPFfbjTrADs3h8CuQzctOuhwfAXwPC4+faz5AqAsRfcjFV2wZxKu4DOOAB7Vc9QhnNe60Esb1xQCI QD0Fo+l+TaZUxGb0VgkssAZGgeBCIQ+Eb47Fybqee67SS7WpsFqZIErN1QhnEo1TkMKw2hOzx3OcA Cg+kxQR49fzTHg==; Received: from 71.125.192.77.rev.sfr.net ([77.192.125.71]:33828 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ7a5-00088E-NU; Tue, 29 Mar 2022 04:52:03 -0400 From: Mathieu Othacehe To: Brian Kubisiak Subject: Re: bug#54619: [PATCH] gnu: lsof: Fix cross-compilation. References: <20220329013728.d2flni2rrt46wyes@peregrine> Date: Tue, 29 Mar 2022 10:51:59 +0200 In-Reply-To: <20220329013728.d2flni2rrt46wyes@peregrine> (Brian Kubisiak's message of "Mon, 28 Mar 2022 18:37:28 -0700") Message-ID: <87r16l6t00.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54619 Cc: 54619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Brian, Without your patch lsof seems to cross-build successfully, why is it required to set this LINUX_CONF_CC variable? Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 19:05:39 2022 Received: (at 54619) by debbugs.gnu.org; 29 Mar 2022 23:05:39 +0000 Received: from localhost ([127.0.0.1]:33831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZKuA-0001dU-PK for submit@debbugs.gnu.org; Tue, 29 Mar 2022 19:05:39 -0400 Received: from mn-69-69-108-139.sta.embarqhsd.net ([69.69.108.139]:2023 helo=mail.kubisiak.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZKu9-0001dH-4P for 54619@debbugs.gnu.org; Tue, 29 Mar 2022 19:05:37 -0400 Received: from peregrine (108-237-41-25.lightspeed.sntcca.sbcglobal.net [108.237.41.25]) by mail.kubisiak.com with ESMTPSA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Tue, 29 Mar 2022 18:05:24 -0500 Date: Tue, 29 Mar 2022 16:05:24 -0700 From: Brian Kubisiak To: Mathieu Othacehe Subject: Re: bug#54619: [PATCH] gnu: lsof: Fix cross-compilation. Message-ID: <20220329230524.uzyn5k5bdlteoz36@peregrine> References: <20220329013728.d2flni2rrt46wyes@peregrine> <87r16l6t00.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87r16l6t00.fsf@gnu.org> X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 54619 Cc: 54619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Hello Mathieu, I see the following compiler errors during the build phase when trying to build with `guix build --target=aarch64-linux-gnu lsof': dsock.c: In function ‘build_IPstates’: dsock.c:392:49: error: ‘TCP_ESTABLISHED’ undeclared (first use in this function) 392 | (void) enter_IPstate("TCP", "ESTABLISHED", TCP_ESTABLISHED); | ^~~~~~~~~~~~~~~ dsock.c:392:49: note: each undeclared identifier is reported only once for each function it appears in aarch64-linux-gnu-gcc -DLINUXV=00000 -DHASNORPC_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DLSOF_VSTR=\"0.0.0\" -O -c -o usage.o usage.c dsock.c:393:46: error: ‘TCP_SYN_SENT’ undeclared (first use in this function); did you mean ‘TCP_SYNCNT’? 393 | (void) enter_IPstate("TCP", "SYN_SENT", TCP_SYN_SENT); | ^~~~~~~~~~~~ | TCP_SYNCNT dsock.c:394:46: error: ‘TCP_SYN_RECV’ undeclared (first use in this function) 394 | (void) enter_IPstate("TCP", "SYN_RECV", TCP_SYN_RECV); | ^~~~~~~~~~~~ dsock.c:395:47: error: ‘TCP_FIN_WAIT1’ undeclared (first use in this function) 395 | (void) enter_IPstate("TCP", "FIN_WAIT1", TCP_FIN_WAIT1); | ^~~~~~~~~~~~~ dsock.c:396:47: error: ‘TCP_FIN_WAIT2’ undeclared (first use in this function) 396 | (void) enter_IPstate("TCP", "FIN_WAIT2", TCP_FIN_WAIT2); | ^~~~~~~~~~~~~ dsock.c:397:47: error: ‘TCP_TIME_WAIT’ undeclared (first use in this function); did you mean ‘TCP_TIMESTAMP’? 397 | (void) enter_IPstate("TCP", "TIME_WAIT", TCP_TIME_WAIT); | ^~~~~~~~~~~~~ | TCP_TIMESTAMP dsock.c:398:43: error: ‘TCP_CLOSE’ undeclared (first use in this function); did you mean ‘TCP_CORK’? 398 | (void) enter_IPstate("TCP", "CLOSE", TCP_CLOSE); | ^~~~~~~~~ | TCP_CORK dsock.c:399:48: error: ‘TCP_CLOSE_WAIT’ undeclared (first use in this function) 399 | (void) enter_IPstate("TCP", "CLOSE_WAIT", TCP_CLOSE_WAIT); | ^~~~~~~~~~~~~~ dsock.c:400:46: error: ‘TCP_LAST_ACK’ undeclared (first use in this function); did you mean ‘TCP_FLAG_ACK’? 400 | (void) enter_IPstate("TCP", "LAST_ACK", TCP_LAST_ACK); | ^~~~~~~~~~~~ | TCP_FLAG_ACK dsock.c:401:44: error: ‘TCP_LISTEN’ undeclared (first use in this function); did you mean ‘TCP_FASTOPEN’? 401 | (void) enter_IPstate("TCP", "LISTEN", TCP_LISTEN); | ^~~~~~~~~~ | TCP_FASTOPEN dsock.c:402:45: error: ‘TCP_CLOSING’ undeclared (first use in this function); did you mean ‘POF_CLOSING’? 402 | (void) enter_IPstate("TCP", "CLOSING", TCP_CLOSING); | ^~~~~~~~~~~ | POF_CLOSING dsock.c: In function ‘get_tcpudp’: dsock.c:2998:20: error: ‘TCP_ESTABLISHED’ undeclared (first use in this function) 2998 | if (tp->state == TCP_ESTABLISHED) { | ^~~~~~~~~~~~~~~ dsock.c: In function ‘get_unix’: dsock.c:3527:64: error: ‘UINT32_MAX’ undeclared (first use in this function); did you mean ‘UINT_MAX’? 3527 | || (ty = (uint32_t)strtoul(fp[4], &ep, 16)) == (uint32_t)UINT32_MAX | ^~~~~~~~~~ | UINT_MAX make: *** [: dsock.o] Error 1 make: *** Waiting for unfinished jobs.... Checking the build log, I see the following error: Testing C library type with aarch64-linux-gnu-gcc ... ./Configure: line 2922: ./lsof_Configure_tmp_26.x: cannot execute binary file: Exec format error done Cannot determine C library type; assuming it is not glibc. So I believe the compiler errors are caused by attempting to build with glibc without adding glibc-specific build flags. The root cause of this is that the c library detection in lsof builds and runs a small program in order to see if it's using glibc. Since it is building this with the cross-compiler, the resulting binary (usually) won't be able to run on the host. If you have binfmt_misc + qemu set up on your machine, you may not see this error. The solution is to point LINUX_CONF_CC at the build machine's compiler instead of using the cross compiler for this step, which should build and execute the test program natively. Thanks, Brian From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 30 05:54:09 2022 Received: (at 54619-done) by debbugs.gnu.org; 30 Mar 2022 09:54:10 +0000 Received: from localhost ([127.0.0.1]:34560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZV1l-0001qE-Q1 for submit@debbugs.gnu.org; Wed, 30 Mar 2022 05:54:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZV1k-0001px-5f for 54619-done@debbugs.gnu.org; Wed, 30 Mar 2022 05:54:08 -0400 Received: from [2001:470:142:3::e] (port=58474 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZV1e-0004ZF-Mi; Wed, 30 Mar 2022 05:54:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=5T7fv1w6qV530sUSXiSd3YsWMDpOMBTtP8sYCNFHIjE=; b=jk8a3tOZQ2ht09nvkODb fi7e1meuZqiAMTAIMOd+FfVX1F7xrBJWtGe7eFpMpIILjtn8qP5SHuQiPq2M5/2tCt2duAkRYfw61 k5jcC5O9cBC+XaNC+mCcFM6crmRITr2j7qBCNcid/4E8XagOF4v2FM4W8WCSQ2dF+5feURUPxWhE+ yNbswL5gF+zrtCUevCZ+u140vdjFBK+f2njzSiJc0kErQ/Dm6cHLnzhMezhx6WPZMIImTUrLIdfS0 sed4Apsb6ZdKgXG1VKGnUE2r+oZp5UooUuw9BAhO3tkJDjBpiupOLlNU//BSZkb2MEQPjl7ZAsuj5 goItLcQ7gljNhA==; Received: from 71.125.192.77.rev.sfr.net ([77.192.125.71]:33846 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZV1b-0001J7-0A; Wed, 30 Mar 2022 05:54:02 -0400 From: Mathieu Othacehe To: Brian Kubisiak Subject: Re: bug#54619: [PATCH] gnu: lsof: Fix cross-compilation. References: <20220329013728.d2flni2rrt46wyes@peregrine> <87r16l6t00.fsf@gnu.org> <20220329230524.uzyn5k5bdlteoz36@peregrine> Date: Wed, 30 Mar 2022 11:53:56 +0200 In-Reply-To: <20220329230524.uzyn5k5bdlteoz36@peregrine> (Brian Kubisiak's message of "Tue, 29 Mar 2022 16:05:24 -0700") Message-ID: <87pmm3yde3.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54619-done Cc: 54619-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Brian, Thanks for the explanation! > If you have binfmt_misc + qemu set up on your machine, you may not see > this error. Oh right, that's probably why I didn't see those errors. > The solution is to point LINUX_CONF_CC at the build machine's compiler > instead of using the cross compiler for this step, which should build > and execute the test program natively. Pushed as a006b7d34757dbafc0d71d875613e6df521efe51. Mathieu From unknown Mon Aug 11 12:53:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 27 Apr 2022 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator