From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: balducci@units.it Newsgroups: gmane.lisp.guile.bugs Subject: bug#71752: commit 57a889b72 breaks cross compilation of 32bit target on 64bit host Date: Mon, 24 Jun 2024 19:24:20 +0200 Message-ID: <31250.1719249884@dschgrazlin2.units.it> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2998"; mail-complaints-to="usenet@ciao.gmane.io" To: 71752@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Mon Jun 24 19:25:23 2024 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sLnRS-0000XY-FA for guile-bugs@m.gmane-mx.org; Mon, 24 Jun 2024 19:25:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLnR9-0002X6-5u; Mon, 24 Jun 2024 13:25:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLnR7-0002Wh-3V for bug-guile@gnu.org; Mon, 24 Jun 2024 13:25:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLnR6-0006Ez-Rw for bug-guile@gnu.org; Mon, 24 Jun 2024 13:25:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLnR7-0005kr-VD for bug-guile@gnu.org; Mon, 24 Jun 2024 13:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: balducci@units.it Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Jun 2024 17:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71752 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171924989522103 (code B ref -1); Mon, 24 Jun 2024 17:25:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Jun 2024 17:24:55 +0000 Original-Received: from localhost ([127.0.0.1]:35197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLnR0-0005kR-V4 for submit@debbugs.gnu.org; Mon, 24 Jun 2024 13:24:55 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLnQy-0005kD-4H for submit@debbugs.gnu.org; Mon, 24 Jun 2024 13:24:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLnQv-0002WM-AL for bug-guile@gnu.org; Mon, 24 Jun 2024 13:24:49 -0400 Original-Received: from dschgrazlin2.univ.trieste.it ([140.105.55.81] helo=dschgrazlin2.units.it) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLnQs-0006Dw-Pq for bug-guile@gnu.org; Mon, 24 Jun 2024 13:24:49 -0400 Original-Received: from dschgrazlin2.units.it (loopback [127.0.0.1]) by dschgrazlin2.units.it (8.18.1/8.18.1) with ESMTP id 45OHOKPE031251 for ; Mon, 24 Jun 2024 19:24:20 +0200 X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 29.4 Content-ID: <31249.1719249884.1@dschgrazlin2.units.it> X-Greylist: inspected by milter-greylist-4.6.4 (dschgrazlin2.units.it [0.0.0.0]); Mon, 24 Jun 2024 19:24:20 +0200 (CEST) for IP:'127.0.0.1' DOMAIN:'loopback' HELO:'dschgrazlin2.units.it' FROM:'balducci@units.it' RCPT:'' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.4 (dschgrazlin2.units.it [0.0.0.0]); Mon, 24 Jun 2024 19:24:20 +0200 (CEST) Received-SPF: pass client-ip=140.105.55.81; envelope-from=balducci@units.it; helo=dschgrazlin2.units.it X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10868 Archived-At: Hello commit 57a889b7282dab303c4cdc49cccbbe22f961bd1c: commit 57a889b7282dab303c4cdc49cccbbe22f961bd1c Author: Jonas Hahnfeld Date: Thu Feb 22 22:09:42 2024 +0100 build: Fix cross-compilation in out-of-tree-builds gen-scmconfig.h is generated in libguile, not $(top_builddir). * libguile/Makefile.am: Add '-I.' when compiling gen-scmconfig.o. Signed-off-by: Ludovic Courts was in response to the report quoted here: https://lists.gnu.org/archive/html/bug-guile/2024-05/msg00006.html (apologies for not replying inside the original mail thread: I was not subscribed at the time) But, paradoxically, for me it breaks cross compilation of 32 bit target on a 64 bit native host. After successful build/install of guile-3.0.10 for the native host (64 bit), I run the cross build with: --build=3Dx86_64-unknown-linux-gnu --host=3Di686-unknown-linux-gnu and get: ----8<---- make[2]: Entering directory '/home/balducci/tmp/install-us-d/guile-3.0= .10.d/guile-3.0.10/libguile' \ if [ "yes" =3D "yes" ]; then \ gcc -m32 -DHAVE_CONFIG_H -I.. \ -I. -c -o gen-scmconfig.o gen-scmconfig.c; \ else \ gcc -m32 -DHAVE_CONFIG_H -DBUILDING_LIBGUILE=3D1 -I.. -I.. -= I../lib -I../lib -iquote. -I../libguile/lightening -I/home/balducci/tmp/i= nstall-us-d/guile-3.0.10.d/guile-3.0.10 -Wall -Wmissing-prototypes -Wpoin= ter-arith -fno-strict-aliasing -fwrapv -fvisibility=3Dhidden -I/opt/stow.d= /versions/gc-5458/usr/include -Wno-incompatible-pointer-types -flto -c -o= gen-scmconfig.o gen-scmconfig.c; \ fi In file included from ../libguile/inline.h:28, from ../libguile/gc.h:25, from ./strings.h:25, from /usr/include/string.h:462, from gen-scmconfig.c:142: ../libguile/scm.h:30:10: fatal error: libguile/scmconfig.h: No such fi= le or directory 30 | #include "libguile/scmconfig.h" | ^~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:4478: gen-scmconfig.o] Error 1 make[2]: Leaving directory '/home/balducci/tmp/install-us-d/guile-3.0.= 10.d/guile-3.0.10/libguile' ---->8---- The reason seems to be precisely the "-I." added by the above mentioned commit. If I delete the "-I." directive the cross build completes successfully. Actually, in my case, the reason why the "-I." causes the failure is the following. libguile/gen-scmconfig.c includes the string.h system header: #include On my system (GNU/linux) the /usr/include/string.h system header (from glibc) includes a strings.h system header (note the s in strings.h): #include It happens that in libguile, where gen-scmconfig.c is compiled, there is also a strings.h header of the guile distribution (so totally different from the system's /usr/include/strings.h): thus, the added "-I." directive makes my /usr/include/string.h system header include *guile's strings.h*, instead of my system's /usr/include/strings.h and this causes the compile failure, due to the (wrong) chain of included headers downstream, which ends up trying to include libguile/scmconfig.h, which, obviously, isn't there yet, since it is supposed to be created precisely by the gen-scmconfig executable. As I could clarify, the wrong inclusion chain caused by the "-I." directive is: gen-scmconfig.c `-- /usr/include/string.h # THIS WANTS /usr/include/strings.h `-- ./strings.h # BUT GETS THIS ONE, INSTEAD `-- ../libguile/gc.h `-- ../libguile/inline.h `-- ../libguile/scm.h `-- ../libguile/scmconfig.h # ISN'T THERE, YET =3D> E= RROR According to the original post (which then triggered the above mentioned commit) the "-I." directive was supposed to fix the inclusion of gen-scmconfig.h, which is created in the same directory (libguile) where gen-scmconfig.c is compiled. BUT: gen-scmconfig.c includes gen-scmconfig.h as a *quoted* header: #include "gen-scmconfig.h" and, at least with gcc, which I use for building, quoted headers are looked for in the same directory of the file being compiled without the need for a "-I." directive (OTOH, the "-I." directive makes the curren= t directory searched for headers BEFORE the system directories, and this causes the build failure in my case, as detailed above). Turning the "-I." into "-iquote." or "-idirafter." (instead of deleting it) works for me and maybe might work also for the original poster, but I don't think is portable outside gcc... Apologies for the long mail: I hope to have clarified the problem thanks a lot for your valuable work ciao -gabriele