From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qG0JE+uQQ2I+MAAAgWs5BA (envelope-from ) for ; Wed, 30 Mar 2022 01:06:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qF/KD+uQQ2I6hwAAauVa8A (envelope-from ) for ; Wed, 30 Mar 2022 01:06:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C6B1A2E068 for ; Wed, 30 Mar 2022 01:06:18 +0200 (CEST) Received: from localhost ([::1]:52158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZKun-0005iZ-OG for larch@yhetil.org; Tue, 29 Mar 2022 19:06:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZKub-0005hY-JB for guix-patches@gnu.org; Tue, 29 Mar 2022 19:06:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZKuX-0005Bo-Tn for guix-patches@gnu.org; Tue, 29 Mar 2022 19:06:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nZKuX-0001e8-Pa for guix-patches@gnu.org; Tue, 29 Mar 2022 19:06:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54619] [PATCH] gnu: lsof: Fix cross-compilation. Resent-From: Brian Kubisiak Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Mar 2022 23:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54619 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 54619@debbugs.gnu.org Received: via spool by 54619-submit@debbugs.gnu.org id=B54619.16485951396297 (code B ref 54619); Tue, 29 Mar 2022 23:06:01 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648595179; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=ZAiZXx0eR32KHEX+wwUkmyjMKezMgofe9aZoy5XRk0E=; b=R1TJxCOqyBqz5gXf5yxkMXW8hGUo1Q2xvLG5vpj5jDInzbYuT4jaARLcHMhs9f6DK0U+xn CI2EvptHjAsOY+QlDgOZPQDJnk4gLKDycqRZR0xbxb4B5VcKuUESjwzsgx83hBb8CQw9bj D4fl1qyzehi2AaRM9RtDt8mM8w0EDMlF+MzplowqaDcvv/azTwjfGOC2x1dtKfG2iV+V4a exTNAfHkCCgtz/F7k1ByWFRTIunH+Ff/tt6NIhdKgRywNegGbwx/I6kGUNYBJzESc1l8g5 kmzD+SzYy87IowroyFzoIa78Hii5cmtcmRuZVRqnWbbffiXEcHuVtftbwzJwtQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648595179; a=rsa-sha256; cv=none; b=pOGNErr5Q6T2jifpAiACaTPdBCUEQ4cqUf1IB3NMXGIzlk6S7+TDQejtAoqYdv2ONMLRu2 fpAI1W1qxXvh+wZTpb6vK9PIpiYjftcm5SYqIHYBp/+Wsic+tRdIrCMMSfO3BElGs6YyfD eZtDb7AcDpgQY9wWlzHYS1T6UiqqPgTFzw2jqmfel//ihnBmtee/VF1PFXqSJtf8glVNtP CbYLi0txEFEez6iZERDbnZ1LV561SxY+6Usb+rU+MHTVxMJ/mDfqdhB54bXvOGYqQIpUYp VMCWTiPPikvLJ3tirN55DaUCgM7hpcIZYckNH6uDDG1OD3sXB6JfA123FKY37A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.57 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C6B1A2E068 X-Spam-Score: -2.57 X-Migadu-Scanner: scn1.migadu.com X-TUID: N17S/Z34wBBl 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