[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 04/04: build: Test '-flto' on both compiler and linker.

From: Ludovic Courtès
Subject: [Guile-commits] 04/04: build: Test '-flto' on both compiler and linker.
Date: Mon, 7 Mar 2022 04:57:12 -0500 (EST)

civodul pushed a commit to branch main
in repository guile.

commit f047133e7b43433e77dc01741d559ac9e2a9ea58
Author: Sergei Trofimovich <>
AuthorDate: Sun Feb 20 09:39:59 2022 +0000

    build: Test '-flto' on both compiler and linker.
    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  
     ld: warning: ignoring file 
       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 
    Taken from
    The change makes sure -flto support tests basic support of just for
    object file generation but for linker as well.
    * use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE.
    Signed-off-by: Ludovic Courtès <>
 NEWS         | 1 + | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 0c77f8dd7..b0217a429 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Changes in 3.0.9 (since 3.0.8)
 ** psyntax honors source properties coming from read hash extensions
+** ./configure checks whether the linker supports '-flto' (needed on macOS)
 Changes in 3.0.8 (since 3.0.7)
diff --git a/ b/
index ad7ff12c6..30229489d 100644
--- a/
+++ b/
@@ -69,7 +69,7 @@ AC_MSG_CHECKING([whether the compiler supports -flto])
 if test -n "$LTO_CFLAGS"; then

reply via email to

[Prev in Thread] Current Thread [Next in Thread]