[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Test -flto on both compiler and linker
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] Test -flto on both compiler and linker |
Date: |
Mon, 07 Mar 2022 10:48:08 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hi Sergei,
Sergei Trofimovich <slyich@gmail.com> 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’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH] Test -flto on both compiler and linker,
Ludovic Courtès <=