From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by sourceware.org (Postfix) with ESMTPS id 1A39C3851C36; Sun, 7 Jun 2020 16:03:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1A39C3851C36 Received: by mail-oi1-x241.google.com with SMTP id i74so13063516oib.0; Sun, 07 Jun 2020 09:03:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=bLo2yWAKO1JMYoarjk1z3UI61Rsx5zXv7XMsnyOzThc=; b=m765lfvzabJfpAv44Qk9I49+Ld9MuTjqDzYNlsb5Pif1zFtJQpAQfZBucWrHdYAX3X 8GXCpOStAnVQaKklPBVU3wfgO9X5PcQZqDVtxJ3UfYIYZ3ryH/f/hQrJ3rE3ta2iuESm BhhOT91SASvCyrM0q+kkvCgVsW3BKPDQoqvYCMJNHdLnIhDI8JOrLOm7ug1IwlZcTS2C T40YQv1D3/E0DeHFVUqVw2dUqE6JzpXfuReiWQZA5hsrCtlTayZFKbGfT0PxDwc3hIKi sUiVnH6+y3KahFgYua7X7+lIuiQxPC9uR9mV5XsYZRBDYAy597GFT0UIxGbi20Qxpzlm 7upg== X-Gm-Message-State: AOAM532VEfupsy1Da7MojkDxJvaYwvMkST2fh1w7Tp8YkDMES4v3MJ7S nDN9ttJAk7WJVkv5AMLTz+DBm/l4T9fzm3jC3Ys= X-Google-Smtp-Source: ABdhPJwMoG2+XqYAOhEHpcsxcGVW9LBXk+1715VckNxjt11WUilrv8UlF2Qtk3cfrk0UfzJA+lLl6xXD8U/69WXOwEs= X-Received: by 2002:aca:b742:: with SMTP id h63mr8042271oif.65.1591545824454; Sun, 07 Jun 2020 09:03:44 -0700 (PDT) MIME-Version: 1.0 References: <4b619179a08075bd2ee7f9e98aa2d5918191306d.camel@redhat.com> <5de2a5202b50882612e1fe51d254f2b125f61716.camel@redhat.com> <885d0b34df56c30f25c2ba57f4eecf517d1ba05c.camel@redhat.com> <5edb0f517d11a551f622ebb787fc06cd6c06225b.camel@redhat.com> <01bd8894-78f7-47b4-1a38-e062d549450b@gmail.com> In-Reply-To: <01bd8894-78f7-47b4-1a38-e062d549450b@gmail.com> From: =?UTF-8?Q?Nicolas_B=C3=A9rtolo?= Date: Sun, 7 Jun 2020 13:03:32 -0300 Message-ID: Subject: Re: [PATCH] Port libgccjit to Windows. To: JonY <10walls@gmail.com> Cc: David Malcolm , jit@gcc.gnu.org, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.3 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: jit@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Jit mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2020 16:03:46 -0000 Hi, Sorry for the super late reply. > 1. Using .so on Windows for DLLs is fine. I know, but using the standard suffix for the platform seems better, IMHO. > 2. The DLL name on Windows should use LIBGCCJIT_SONAME rather than > LIBGCCJIT_LINKER_NAME, so applications would load libgccjit.so.0 instead > of libgccjit.so directly. The linker command output needs to be > LIBGCCJIT_SONAME. Do you think the library should be called libgccjit.so.0 instead of the mor= e Windows-like libgccjit.dll? That seems weird. Could you explain why? Thanks, Nicolas. El mar., 2 jun. 2020 a las 13:27, JonY (<10walls@gmail.com>) escribi=C3=B3: > > On 5/28/20 8:46 PM, David Malcolm via Gcc-patches wrote: > > On Thu, 2020-05-28 at 16:51 -0300, Nicolas B=C3=A9rtolo wrote: > >>> I'm going to have to trust your Windows expertise here; the tempdir > >>> code looks convoluted to me, but perhaps that's the only way to do > >> it. > >>> (Microsoft's docs for "SECURITY_ATTRIBUTES" suggest to me that if > >>> lpSecurityDescriptor is NULL, then the directory gets a default > >>> security descriptor, and that this may mean it's only readable by > >> the > >>> user represented by the access token of the process [1], which > >> might > >>> suggest a simplification - but I'm very hazy on how the security > >> model > >>> in Windows works) > >> > >> I tested this and it gives write access to the "Authenticated Users" > >> group. > > > > Aha - sounds like that would be a problem. Thanks for clarifying. > > > >> The > >> way I did it gives access only to the user that owns the libgccjit > >> process. I > >> have to admit that it is a lot of code and it is hard to understand > >> unless you > >> know the security model of Windows well. I don't know it well, I > >> wrote this > >> keeping the documentation close and experimenting. > > > > Thanks. > > > >>> I was able to successfully bootstrap and regression test with your > >>> patch on x86_64-pc-linux-gnu. I also verified that the result of > >> "make > >>> install" was not affected for my configuration. > >> > >> Great. > >> > >>> I've pushed your patch to master as > >>> c83027f32d9cca84959c7d6a1e519a0129731501. > >>> > >>> Thanks again for the patch > >>> Dave > >> > >> Thanks to you for all the good feedback. > >> > >> Nico. > > > > Hello, > > A bit of a late review, some minor points: > > 1. Using .so on Windows for DLLs is fine. > 2. The DLL name on Windows should use LIBGCCJIT_SONAME rather than > LIBGCCJIT_LINKER_NAME, so applications would load libgccjit.so.0 instead > of libgccjit.so directly. The linker command output needs to be > LIBGCCJIT_SONAME. > 3. Ideally I would prefer to .cc too, though I see other C++ files also > written as .c. > > Resend in case reply to list did not work, >