From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Test -flto on both compiler and linker Date: Mon, 07 Mar 2022 10:48:08 +0100 Message-ID: <87pmmy2iw7.fsf@gnu.org> References: <20220220093959.3130873-1-slyich@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37219"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) To: guile-devel@gnu.org Cancel-Lock: sha1:f2/pd/DBjYhNcUeHD1h9tk9rujQ= Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Mar 07 10:48:46 2022 Return-path: Envelope-to: guile-devel@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 1nR9yw-0009Ti-Pc for guile-devel@m.gmane-mx.org; Mon, 07 Mar 2022 10:48:46 +0100 Original-Received: from localhost ([::1]:44780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nR9yv-0004gA-0o for guile-devel@m.gmane-mx.org; Mon, 07 Mar 2022 04:48:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nR9yb-0004dc-Hi for guile-devel@gnu.org; Mon, 07 Mar 2022 04:48:27 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:43326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nR9yW-0000NK-4V for guile-devel@gnu.org; Mon, 07 Mar 2022 04:48:25 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nR9yR-0008ma-PS for guile-devel@gnu.org; Mon, 07 Mar 2022 10:48:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 =?utf-8?Q?Vent=C3=B4se?= an 230 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Received-SPF: pass client-ip=116.202.254.214; envelope-from=guile-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21157 Archived-At: Hi Sergei, Sergei Trofimovich skribis: > Before the change ./configure incorrectly enabled -flto on toolchains > that support -flto on compiler side but don't support -flto on linker > side. This caused incorrect type size detection on nixpkgs' Darwin: > > configure:54594: checking size of size_t > configure:54600: clang -std=gnu11 -o conftest -g -O2 -flto conftest.c >&5 > ld: warning: ignoring file /private/tmp/nix-build-guile-3.0.8.drv-0/conftest-00e93d.o, > building for macOS-x86_64 but attempting to link with file built > for unknown-unsupported file format ( 0xDE 0xC0 0x17 0x0B 0x00 0x00 0x00 0x00 0x14 0x00 0x00 0x00 0x80 0x1A 0x00 0x00 ) > Undefined symbols for architecture x86_64: > "_main", referenced from: > implicit entry/start for main executable > ld: symbol(s) not found for architecture x86_64 > clang-11: error: linker command failed with exit code 1 (use -v to see invocation) > > Taken from https://github.com/NixOS/nixpkgs/pull/160051#issuecomment-1046105041 > > The change makes sure -flto support tests basic support of just for > object file generation but for linker as well. > > * configure.ac: use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE. Applied, thanks! Ludo’.