From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id 4EB143858D33 for ; Wed, 22 Feb 2023 08:58:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4EB143858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x130.google.com with SMTP id m7so8997915lfj.8 for ; Wed, 22 Feb 2023 00:58:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=p6jn6JDWu+L2KDp/UD6CEV8y9LQi1oi/LG0pFSADpwM=; b=EMq+PbmOHoLAKWNq/kAZcvqj01gPff9Fvhm4dUU+rTuc6AmkkgXnGGfZMInVVtCqNJ ttp6YSkLKYTU5vnL0nY9lH2nl02SWwU9jSh5NgqolLEdzRL0WV5X86IukNfnSX54I4cQ EPE1PtsxieGV9We8hiUNoVNwBpOaEu880MR0i0xqkFosHL7YsaAeGDzoxrJaipM5husn G1bOUyWM4Kp0daiSitErnFJtQgxGUxILyfmcjFJdquyAgakk30lvMkxXwo3+9MR5TQwa upEkHZCVYQmZEIOaMKxpEWiZQyK00i/WQtdM6rcQAYwFXPIrz+4AjIv81RnsQd07n9Cq 19OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p6jn6JDWu+L2KDp/UD6CEV8y9LQi1oi/LG0pFSADpwM=; b=LH1bfyQEB1OFQ0uw3HJpA/cH3Q2aexipmrVMny0IVOshmitS5tLXTBFrAV2M0vle9A C+DY+2V/ITLpYP//c2rLGKIqHisAYX+MwQHlnibYl2xN1LPg43erDcNv7c097mR4oq+B hmU5FcaeoI6YV8iTgyO+URMQOGU6YUG99zZurzYs1H0lOdgw3JZRlPxvY/DBb72qcdmv 2qZbdH9CidmCwhbaXuEuegSACC6cFuzwzB0jeAYvUY09XhHqiCnnGmLgR77L7b6hI5Ur z/RQIN1hunKuyh+ILTD6QsngjDYCoS5Gi95Plj/1SkCrMFDCCgtPVs4tPHoNR2u/pHzz n6Vg== X-Gm-Message-State: AO0yUKXk7UVVm1Y3pQqSYjAExQvpM2SjynxY4vOoyoLflaGxFJDgbyBd WBJXsfNWVodr8nndBN0S6fXVt0IiD4dkVdFd8fM= X-Google-Smtp-Source: AK7set+1bAxTK9sha3v5UhqZ18d5bUJLHaJsbd8QkssqcRsIu/HdkG9sIgbq+i4BluIjZduKS/w7l77W7XxCbMIkdOI= X-Received: by 2002:a05:6512:3d90:b0:4db:b4:c8d7 with SMTP id k16-20020a0565123d9000b004db00b4c8d7mr3902628lfv.2.1677056316594; Wed, 22 Feb 2023 00:58:36 -0800 (PST) MIME-Version: 1.0 References: <87a616un8q.fsf@oldenburg.str.redhat.com> <875ybuumsp.fsf@oldenburg.str.redhat.com> In-Reply-To: <875ybuumsp.fsf@oldenburg.str.redhat.com> From: Richard Biener Date: Wed, 22 Feb 2023 09:58:24 +0100 Message-ID: Subject: Re: Using __gnu_lto_slim to detect -fno-fat-lto-objects To: Florian Weimer Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Feb 22, 2023 at 9:28 AM Florian Weimer wrote: > > * Richard Biener: > > > On Wed, Feb 22, 2023 at 9:19 AM Florian Weimer via Gcc wrote: > >> > >> Can we use the COMMON symbol __gnu_lto_slim to detect > >> -fno-fat-lto-objects on contemporary GNU/Linux (with the LTO linker > >> plugin)? > > > > Yes. > > Great, thanks. > > >> We currently build the distribution with -ffat-lto-objects, and I want > >> to switch away from that. Packages will need to opt in to > >> -ffat-lto-objects if static objects they build escape the buildroot. > >> And to make sure that this opt-in happens, I want to fail the build if > >> there would be any -fno-fat-lto-objects objects leaking. > > > > For SUSE we're checking that no LTO bytecode leaks instead, thus we check > > for __gnu_lto_v? (I think). The reason is that even for static libraries > > we do not want to ship LTO bytecode. > > We build with -ffat-lto-objects, and this means we can create perfectly > fine object files by stripping the LTO data: > > > > This means that so far, we only had to fix LTO compilation problems in > the packages, but not teach individual packages about LTO and non-LTO > object files. Of course it's wasteful because few packages actually > install the object files (without a final link into a program or shared > object), and that's what I want to fix. Ah, I didn't notice that - I think we only scan static archives for LTO bytecode and reject that case. Richard. > Florian >