From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AB3B33858D1E for ; Tue, 19 Mar 2024 20:43:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AB3B33858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AB3B33858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710880999; cv=none; b=VhldhDkaXitLBhg4waQtsd3RDW6/kUY0mSYPRJZYjJ4mDe7hGBb7yrznzQelGbLwwc94ZuCsdhvCLqu27zGrpkfvBZd3bdLb0vPC/YXb4PDdUKbsgIF7wqXMLpAn/OOpoj4HZ/G8ERGE70rjN3OnWup6SDjfctgSUbLVubC6vDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710880999; c=relaxed/simple; bh=BpEnUk4dav/IJWIzN6tMg7Qcr66Zj5yMqpw8PyxS500=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=SxVuEnlvuytKHT2eGC9nGRTv39NibStriiBWRlw/t45zFsfFJrzmTIvKrnF6h3een5RqFVG8f6evPmQYQDiNDTpm7weCUemxIcuvLugE9ovrmp/Vz8cIg6XEIcc6r1vxgd3/+qMk8oUP5Wq19dBNfmChOrsegN/WASAOhlEueew= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710880996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=54qC81hIHaHSvkfZSYio1L7wVhyRye+cwVgAEkIzwNg=; b=YU123tZH5WsN3R3lMKZWe8FKahR0ihTrUaghfPY6ONiL2veNiuoWA6JSa4vlO/GBEXUQic 0yosFCLaqArfLvcxnuk5xPT+oYjNwbS09MBx9wLcShIS4z49UgO90Tci/XG9ze3HRehj5n 8fDixT6WfiF8Xp+gh5SOY5U1mvEtSAg= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-OWj15xrxPNSDCWBxNPdccg-1; Tue, 19 Mar 2024 16:43:14 -0400 X-MC-Unique: OWj15xrxPNSDCWBxNPdccg-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6963cd45fddso5874356d6.1 for ; Tue, 19 Mar 2024 13:43:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710880993; x=1711485793; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=54qC81hIHaHSvkfZSYio1L7wVhyRye+cwVgAEkIzwNg=; b=pe7Jys7KT5bDvb90W2jA1a9AuxYK/Dc+AHH+zxVZpJbR81FsmXeIOcW/cwJLqHaO6h z8/tvHjWkyN7csPoSXO7TQQGOujH0gQYyVaaFl1WuSsrfiDG6SAKE9EkRygvwHgnjQyq IM7gnWO7bE3AHbm1FEUHLnL20fKdTDOZIMkc0MzXk8F54ucGUlXA+QULd13OGVbMuulm oWqdOGvHxurthebL1yyXHq46KEzEkEMdlM3NJW7GsfsmIYbGoqUgaIQa5Ykb509uxjBM 18AHYuxq8gB0qhw/Iko6RshNCa6M/H0vuM5EaGqeOYt0FOUN7moQpBQ+NVn/OSN6y/LX Ubsg== X-Forwarded-Encrypted: i=1; AJvYcCWgupyuIUxyvIqseCmXBVB9ItzyAqr98rSGHVCQIPP1Vy5Hc6o3WKkWO8mISUjM8IZfHZrmGkNneuh7o4P290Q= X-Gm-Message-State: AOJu0Yyq3t7RO+4FwYLyXqJ6cOY3gJVoSsIBBkX3S2qWyXjEmkMEGgCr HZrKd3qWUAfZj97vB3rrOOLsyfcwRJSiMz96CuT6RRoTzjGcIgdqTjrh2nXG9GWFct7CdEI3ykk rfIe8eEYOmOVzHHQyelZT/afAjJbxzNhglSxD51GQ0u7QkSE3nv8G X-Received: by 2002:a0c:e84d:0:b0:696:3077:7f19 with SMTP id l13-20020a0ce84d000000b0069630777f19mr1159860qvo.4.1710880993409; Tue, 19 Mar 2024 13:43:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1v/QoKxuXCzf/95kzzn7Uortp4pSEUlnX5yVZ+Ysxqft9bGoy3LELJJ8/mmOv/l3K3X0yLg== X-Received: by 2002:a0c:e84d:0:b0:696:3077:7f19 with SMTP id l13-20020a0ce84d000000b0069630777f19mr1159837qvo.4.1710880993083; Tue, 19 Mar 2024 13:43:13 -0700 (PDT) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id z10-20020a056214040a00b00690d951b7d9sm6879687qvx.6.2024.03.19.13.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 13:43:12 -0700 (PDT) Message-ID: Subject: Re: lto1: internal compiler error: original not compressed with zstd From: David Malcolm To: StrawberryTea , jit@gcc.gnu.org Date: Tue, 19 Mar 2024 16:43:11 -0400 In-Reply-To: <87cyrsbfd9.fsf@strawberrytea.xyz> References: <87cyrsbfd9.fsf@strawberrytea.xyz> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Sun, 2024-03-17 at 18:36 -0500, StrawberryTea wrote: > Hello GCC libjit people, Hi StrawberryTea I'm the author/maintainer of libgccjit. I confess that I don't think I've ever tried using LTO with libgccjit, but rustc_codegen_gcc appears to, given: https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommit;h=3D8415bceea9d3ca86adc00ae= 8ad92deaec0457dd1 >=20 > Whenever I try to compile Elisp packages with GCC libjit and -flto, I > get "lto1: internal compiler error: original not compressed with > zstd". FWIW that message appears in the sources in gcc/lto-compress.cc's lto_uncompression_zstd here: https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dblob;f=3Dgcc/lto-compress.cc;#l162 but I'm unfamiliar with that part of the compiler. > I have an Emacs bug report on > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D69689=C2=A0and a Gentoo b= ug > report on https://bugs.gentoo.org/926953=C2=A0but nobody has been able to > resolve this. There are hints that this might be related to the way > Gentoo builds GCC, but I'm not sure. I suspect that debugging this further would be very hard, due to it involving a large amount of non-trivial code and interactions between gcc, the linker, emacs C, the emacs AOT compilation code, and how gentoo packages all of these. You'd need to turn on debug logging from libgccjit which I don't know how to do from Emacs [2], and that might give clues as to what's going wrong (or might not!) Do you know if the Emacs native compilation project has tried turning on LTO? [1] What does that actually mean? (e.g. LTO between compiled Emacs lisp modules? Or between a compiled Emacs lisp module and Emacs C code? Are both built using the same GCC version? etc) The simplest fix is probably to turn off LTO. Sorry not to be of more help Dave [1] https://www.emacswiki.org/emacs/GccEmacs [2] FWIW, from C you'd do it with gcc_jit_context_set_logfile: https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html#c.gcc_jit_context_s= et_logfile