From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: MPS: Please check if scratch/igc builds with native compilation Date: Wed, 22 May 2024 07:43:21 +0200 Message-ID: <87r0du5rly.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18124"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Andrea Corallo , Emacs Devel , Eli Zaretskii To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 22 07:44:34 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s9em9-0004VA-Td for ged-emacs-devel@m.gmane-mx.org; Wed, 22 May 2024 07:44:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9elO-0000aj-SR; Wed, 22 May 2024 01:43:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9elC-0000Zp-Cs for emacs-devel@gnu.org; Wed, 22 May 2024 01:43:35 -0400 Original-Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9el3-0007Vi-GV; Wed, 22 May 2024 01:43:34 -0400 Original-Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a599c55055dso908462266b.0; Tue, 21 May 2024 22:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716356603; x=1716961403; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=HJMMoybH8nKWkJf7/YMolX2dAbhWF7QsLjY6PNmg20k=; b=cWU1+nXG1hK6gxiB8dBUG51kpGw6RaCFiqJVAnIeuC82g1SWcBOFNw8dCwrDrgJI0y ahXVwkPoFWl3lAPtj/9mN22nknhdQ5Bok0i24aoYIxmfgvySyGLZq6rRRXkPiVJTK3Mh v2Vgj3sphs/8fPAdVq+rGDoxAe9EsMkhWak6q3VX3vkizvmnFCVIKqav3rXqzA1eYB59 Sa12m/fLNFCtjNc+XwbaiuhtnP5EgLmdIhr2w4kvI+rDFyNbJWIzj5Bv0SW7ZgF6IJ4d rJIygUmfTMRLoYrasbkZFk26MLoG1wC4ks5zvgny8dVSb1kAnjDCtOWNHblU0I1sewSU lJCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716356603; x=1716961403; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HJMMoybH8nKWkJf7/YMolX2dAbhWF7QsLjY6PNmg20k=; b=crToDSrHaY4lyTeeLMl1IT5PlRzDj/m96BhrGFXmj4z6vkOm8+O58+U8KFkKrz+/2l XsfNjUdSwmDxflqXlE20BiodZnaLWPClEApMkh3owLlhy0G32EF/ZoT00D5X+CXw5Icz VfCVfcEs2+CUYJPqu5xMhjEzhfgJss8xJPsppO0MuiRJm5eWmC3/pnHrAzyIbjs6wYFB zM7+FvuMlbvag4Xh7N59x343geV+Q1nlXmTRHb8P026o6z/DIscyfnmuohfx0ZtZzZ6C I3yXxvRwi3ZWPjUOm6OauuniSpFe8dzxXeDTPqRZtrCCFzrLVcK55SIlv/xOfB7VPLNP QLig== X-Forwarded-Encrypted: i=1; AJvYcCXfizG+IlhRKplLkPQ16CzIcrsZHdJmifbQEBpQrzQG8WqvqS86CNqsaomZBQFqB78f4VreTYs82JUkK7QkE7vhS0yoht3uR/60P3x2mzqkHJs= X-Gm-Message-State: AOJu0YzC41xzjOZNvE+9D+DawxKLE4IbJrA4FK+3Bb2CzrTWMKhOTC41 9QQYVlPpAGnJjh/mqQ80K4uWKn2+Nl0c9Om+8AdslJV6XKHiJ5s9zlOlEg== X-Google-Smtp-Source: AGHT+IHz87k31fq7O8FvuIHUiX+xoKCqKjOOnjI4MWro3xqK5AnvNyubGQmMJEi1ZB9neWfMpeqX1Q== X-Received: by 2002:a17:907:8026:b0:a5a:278f:7830 with SMTP id a640c23a62f3a-a6228084b17mr39854466b.26.1716356602847; Tue, 21 May 2024 22:43:22 -0700 (PDT) Original-Received: from caladan (dial-188233.pool.broadband44.net. [212.46.188.233]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b180c7sm1733361366b.221.2024.05.21.22.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 22:43:22 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Tue, 21 May 2024 19:06:42 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=eller.helmut@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319470 Archived-At: > I've checked that d_reloc is indeed scanned by fix_comp_unit. The > check gives me reasonable confidence that this "should work". But as > an alternative, I also made all the things like d_reloc in the .elns > ambiguous roots, so that they cannot possibly be moved, if all works as > expected. Registering the dump as root happens rather late. The relocation code allocates a hash table and stores a reference to it in comp_u->lambda_gc_guard_h. By that time the dump should already be a root. Can we register the dump earlier? AFAIU, the dumper writes zeros in the cells for to-be-relocated references and the scan code will ignore them. So I think this could work: diff --git a/src/pdumper.c b/src/pdumper.c index b039e375c1f..39484a16c95 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -5958,6 +5958,7 @@ pdumper_load (const char *dump_filename, char *argv0) & ~(DUMP_ALIGNMENT - 1)); void *hot_start = (void *) (dump_base + aligned_header_size); void *hot_end = (void *) (dump_base + header->discardable_start); + igc_on_pdump_loaded (hot_start, hot_end); #endif dump_do_all_dump_reloc_for_phase (header, dump_base, EARLY_RELOCS); @@ -6002,10 +6003,6 @@ pdumper_load (const char *dump_filename, char *argv0) dump_private.load_time = timespectod (load_timespec); dump_private.dump_filename = dump_filename_copy; -# ifdef HAVE_MPS - igc_on_pdump_loaded (hot_start, hot_end); -# endif - out: for (int i = 0; i < ARRAYELTS (sections); ++i) dump_mmap_release (§ions[i]);