On Tue, Feb 20, 2024 at 1:09 AM Eli Schwartz <eschwart...@gmail.com> wrote:
>
> On 2/20/24 12:58 AM, Mike Gilbert wrote:
> > On Mon, Feb 19, 2024 at 11:26 PM Eli Schwartz <eschwart...@gmail.com> wrote:
> >>
> >> meson's builtin LTO support allows meson to introspect whether LTO is
> >> enabled and do some fancy things, such as forcing LTO off for a single
> >> target that is known to be special(ly bad) and not support LTO.
> >
> > Please make sure to test this change with a multilib-enabled ebuild
> > with multiple ABIs enabled. I suspect the filter-lto call will cause
> > differing results for the ABIs after the first.
> >
> > If that is the case, we may need to declare the relevant FLAGS
> > variables with "local -x".
>
>
> >>> Configuring source in
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson ...
>  * abi_x86_32.x86: running multilib-minimal_abi_src_configure
> meson setup --libdir lib --localstatedir /var/lib --prefix /usr
> --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path
> /usr/share/pkgconfig:/usr/share/pkgconfig --pkg-config-path
> /usr/share/pkgconfig:/usr/share/pkgconfig --native-file
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/temp/meson.i686-pc-linux-gnu.x86.ini
> -Db_pch=false -Dwerror=false -Db_lto=true -Db_lto_threads=4
> -Dbuildtype=plain -Ddefault_library=shared -Dbin_programs=false
> -Dbin_contrib=false -Dbin_tests=false -Dzlib=disabled -Dlzma=disabled
> -Dlz4=disabled --native-file
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/temp/meson.i686-pc-linux-gnu.x86.ini.local
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson-abi_x86_32.x86
> [...]
>     Native files         :
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/temp/meson.i686-pc-linux-gnu.x86.ini
>
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/temp/meson.i686-pc-linux-gnu.x86.ini.local
>     b_lto                : true
>     b_lto_threads        : 4
>
>
>
>
>  * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
> meson setup --libdir lib64 --localstatedir /var/lib --prefix /usr
> --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path
> /usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig
> --native-file
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnu.amd64.ini
> -Db_pch=false -Dwerror=false -Db_lto=true -Db_lto_threads=4
> -Dbuildtype=plain -Ddefault_library=shared -Dbin_programs=true
> -Dbin_contrib=true -Dbin_tests=false -Dzlib=enabled -Dlzma=enabled
> -Dlz4=disabled --native-file
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnu.amd64.ini.local
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson-abi_x86_64.amd64
> [...]
>     Native files         :
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnu.amd64.ini
>
> /var/tmp/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnu.amd64.ini.local
>     b_lto                : true
>     b_lto_threads        : 4

I'm afraid I get different results. Build log attached. Happy to help
figure this out tomorrow.

To test, I applied this patch and ran this:

ABI_X86="32 x32 64" CFLAGS="-O2 -pipe -march=amdfam10 -flto=2" ebuild
zstd-1.5.5-r1.ebuild clean configure
 * Package:    app-arch/zstd-1.5.5-r1:0/1
 * Repository: gentoo
 * Maintainer: base-sys...@gentoo.org
 * USE:        abi_x86_32 abi_x86_64 abi_x86_x32 amd64 elibc_glibc kernel_linux lzma zlib
 * FEATURES:   ccache network-sandbox preserve-libs sandbox userpriv usersandbox
 * Package:    app-arch/zstd-1.5.5-r1:0/1
 * Repository: gentoo
 * Maintainer: base-sys...@gentoo.org
 * USE:        abi_x86_32 abi_x86_64 abi_x86_x32 amd64 elibc_glibc kernel_linux lzma zlib
 * FEATURES:   ccache network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking zstd-1.5.5.tar.gz to /x/portage/app-arch/zstd-1.5.5-r1/work
>>> Source unpacked in /x/portage/app-arch/zstd-1.5.5-r1/work
>>> Preparing source in /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson ...
 * Applying zstd-1.5.4-no-find-valgrind.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson ...
 * abi_x86_32.x86: running multilib-minimal_abi_src_configure
meson setup --libdir lib --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig:/usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig:/usr/share/pkgconfig --native-file /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.i686-pc-linux-gnu.x86.ini -Db_pch=false -Dwerror=false -Db_lto=true -Db_lto_threads=2 --buildtype plain -Ddefault_library=shared -Dbin_programs=false -Dbin_contrib=false -Dbin_tests=false -Dzlib=disabled -Dlzma=disabled -Dlz4=disabled --native-file /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.i686-pc-linux-gnu.x86.ini.local /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson-abi_x86_32.x86
The Meson build system
Version: 1.3.1
Source dir: /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson
Build dir: /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson-abi_x86_32.x86
Build type: native build
Program GetZstdLibraryVersion.py found: YES (/usr/bin/python3.12 /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson/GetZstdLibraryVersion.py)
Project name: zstd
Project version: 1.5.5
C compiler for the host machine: x86_64-pc-linux-gnu-gcc -m32 -mfpmath=sse (gcc 13.2.1 "x86_64-pc-linux-gnu-gcc (Gentoo 13.2.1_p20240113-r1 p12) 13.2.1 20240113")
C linker for the host machine: x86_64-pc-linux-gnu-gcc -m32 -mfpmath=sse ld.bfd 2.41
C++ compiler for the host machine: x86_64-pc-linux-gnu-g++ -m32 -mfpmath=sse (gcc 13.2.1 "x86_64-pc-linux-gnu-g++ (Gentoo 13.2.1_p20240113-r1 p12) 13.2.1 20240113")
C++ linker for the host machine: x86_64-pc-linux-gnu-g++ -m32 -mfpmath=sse ld.bfd 2.41
Host machine cpu family: x86
Host machine cpu: i686
Library m found: YES
Run-time dependency threads found: YES
Dependency zlib skipped: feature zlib disabled
Dependency liblzma skipped: feature lzma disabled
Dependency liblz4 skipped: feature lz4 disabled
Compiler for C supports arguments -Wundef: YES 
Compiler for C supports arguments -Wshadow: YES 
Compiler for C supports arguments -Wcast-align: YES 
Compiler for C supports arguments -Wcast-qual: YES 
Compiler for C supports arguments -Wstrict-prototypes: YES 
Compiler for C++ supports arguments -Wundef: YES 
Compiler for C++ supports arguments -Wshadow: YES 
Compiler for C++ supports arguments -Wcast-align: YES 
Compiler for C++ supports arguments -Wcast-qual: YES 
Message: Enable legacy support back to version 0.5
Message: Enable multi-threading support
Found pkg-config: YES (/usr/bin/x86_64-pc-linux-gnu-pkg-config) 2.1.0
Build targets in project: 2

zstd 1.5.5

  User defined options
    Native files         : /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.i686-pc-linux-gnu.x86.ini
                           /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.i686-pc-linux-gnu.x86.ini.local
    build.pkg_config_path: /usr/share/pkgconfig:/usr/share/pkgconfig
    buildtype            : plain
    default_library      : shared
    libdir               : lib
    localstatedir        : /var/lib
    pkg_config_path      : /usr/share/pkgconfig:/usr/share/pkgconfig
    prefix               : /usr
    sysconfdir           : /etc
    werror               : false
    wrap_mode            : nodownload
    b_lto                : true
    b_lto_threads        : 2
    b_pch                : false
    bin_contrib          : false
    bin_programs         : false
    bin_tests            : false
    lz4                  : disabled
    lzma                 : disabled
    zlib                 : disabled

Found ninja-1.11.1 at /usr/bin/ninja
 * abi_x86_x32.x32: running multilib-minimal_abi_src_configure
meson setup --libdir libx32 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig:/usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig:/usr/share/pkgconfig --native-file /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnux32.x32.ini -Db_pch=false -Dwerror=false -Db_lto=false --buildtype plain -Ddefault_library=shared -Dbin_programs=false -Dbin_contrib=false -Dbin_tests=false -Dzlib=disabled -Dlzma=disabled -Dlz4=disabled --native-file /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnux32.x32.ini.local /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson-abi_x86_x32.x32
The Meson build system
Version: 1.3.1
Source dir: /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson
Build dir: /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson-abi_x86_x32.x32
Build type: native build
Program GetZstdLibraryVersion.py found: YES (/usr/bin/python3.12 /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson/GetZstdLibraryVersion.py)
Project name: zstd
Project version: 1.5.5
C compiler for the host machine: x86_64-pc-linux-gnu-gcc -mx32 (gcc 13.2.1 "x86_64-pc-linux-gnu-gcc (Gentoo 13.2.1_p20240113-r1 p12) 13.2.1 20240113")
C linker for the host machine: x86_64-pc-linux-gnu-gcc -mx32 ld.bfd 2.41
C++ compiler for the host machine: x86_64-pc-linux-gnu-g++ -mx32 (gcc 13.2.1 "x86_64-pc-linux-gnu-g++ (Gentoo 13.2.1_p20240113-r1 p12) 13.2.1 20240113")
C++ linker for the host machine: x86_64-pc-linux-gnu-g++ -mx32 ld.bfd 2.41
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Run-time dependency threads found: YES
Dependency zlib skipped: feature zlib disabled
Dependency liblzma skipped: feature lzma disabled
Dependency liblz4 skipped: feature lz4 disabled
Compiler for C supports arguments -Wundef: YES 
Compiler for C supports arguments -Wshadow: YES 
Compiler for C supports arguments -Wcast-align: YES 
Compiler for C supports arguments -Wcast-qual: YES 
Compiler for C supports arguments -Wstrict-prototypes: YES 
Compiler for C++ supports arguments -Wundef: YES 
Compiler for C++ supports arguments -Wshadow: YES 
Compiler for C++ supports arguments -Wcast-align: YES 
Compiler for C++ supports arguments -Wcast-qual: YES 
Message: Enable legacy support back to version 0.5
Message: Enable multi-threading support
Found pkg-config: YES (/usr/bin/x86_64-pc-linux-gnu-pkg-config) 2.1.0
Build targets in project: 2

zstd 1.5.5

  User defined options
    Native files         : /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnux32.x32.ini
                           /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnux32.x32.ini.local
    build.pkg_config_path: /usr/share/pkgconfig:/usr/share/pkgconfig
    buildtype            : plain
    default_library      : shared
    libdir               : libx32
    localstatedir        : /var/lib
    pkg_config_path      : /usr/share/pkgconfig:/usr/share/pkgconfig
    prefix               : /usr
    sysconfdir           : /etc
    werror               : false
    wrap_mode            : nodownload
    b_lto                : false
    b_pch                : false
    bin_contrib          : false
    bin_programs         : false
    bin_tests            : false
    lz4                  : disabled
    lzma                 : disabled
    zlib                 : disabled

Found ninja-1.11.1 at /usr/bin/ninja
 * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
meson setup --libdir lib64 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig --native-file /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnu.amd64.ini -Db_pch=false -Dwerror=false -Db_lto=false --buildtype plain -Ddefault_library=shared -Dbin_programs=true -Dbin_contrib=true -Dbin_tests=false -Dzlib=enabled -Dlzma=enabled -Dlz4=disabled --native-file /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnu.amd64.ini.local /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson-abi_x86_64.amd64
The Meson build system
Version: 1.3.1
Source dir: /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson
Build dir: /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson-abi_x86_64.amd64
Build type: native build
Program GetZstdLibraryVersion.py found: YES (/usr/bin/python3.12 /x/portage/app-arch/zstd-1.5.5-r1/work/zstd-1.5.5/build/meson/GetZstdLibraryVersion.py)
Project name: zstd
Project version: 1.5.5
C compiler for the host machine: x86_64-pc-linux-gnu-gcc (gcc 13.2.1 "x86_64-pc-linux-gnu-gcc (Gentoo 13.2.1_p20240113-r1 p12) 13.2.1 20240113")
C linker for the host machine: x86_64-pc-linux-gnu-gcc ld.bfd 2.41
C++ compiler for the host machine: x86_64-pc-linux-gnu-g++ (gcc 13.2.1 "x86_64-pc-linux-gnu-g++ (Gentoo 13.2.1_p20240113-r1 p12) 13.2.1 20240113")
C++ linker for the host machine: x86_64-pc-linux-gnu-g++ ld.bfd 2.41
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Run-time dependency threads found: YES
Found pkg-config: YES (/usr/bin/x86_64-pc-linux-gnu-pkg-config) 2.1.0
Run-time dependency zlib found: YES 1.3.1
Run-time dependency liblzma found: YES 5.4.6
Dependency liblz4 skipped: feature lz4 disabled
Compiler for C supports arguments -Wundef: YES 
Compiler for C supports arguments -Wshadow: YES 
Compiler for C supports arguments -Wcast-align: YES 
Compiler for C supports arguments -Wcast-qual: YES 
Compiler for C supports arguments -Wstrict-prototypes: YES 
Compiler for C++ supports arguments -Wundef: YES 
Compiler for C++ supports arguments -Wshadow: YES 
Compiler for C++ supports arguments -Wcast-align: YES 
Compiler for C++ supports arguments -Wcast-qual: YES 
Message: Enable legacy support back to version 0.5
Message: Enable multi-threading support
Has header "execinfo.h" skipped: feature backtrace disabled
Build targets in project: 7

zstd 1.5.5

  User defined options
    Native files         : /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnu.amd64.ini
                           /x/portage/app-arch/zstd-1.5.5-r1/temp/meson.x86_64-pc-linux-gnu.amd64.ini.local
    build.pkg_config_path: /usr/share/pkgconfig
    buildtype            : plain
    default_library      : shared
    libdir               : lib64
    localstatedir        : /var/lib
    pkg_config_path      : /usr/share/pkgconfig
    prefix               : /usr
    sysconfdir           : /etc
    werror               : false
    wrap_mode            : nodownload
    b_lto                : false
    b_pch                : false
    bin_contrib          : true
    bin_programs         : true
    bin_tests            : false
    lz4                  : disabled
    lzma                 : enabled
    zlib                 : enabled

Found ninja-1.11.1 at /usr/bin/ninja
>>> Source configured.

Reply via email to