From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by sourceware.org (Postfix) with ESMTPS id 1E1983858C5F for ; Sat, 30 Sep 2023 20:55:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E1983858C5F 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-qt1-x832.google.com with SMTP id d75a77b69052e-4190890d201so47474911cf.2 for ; Sat, 30 Sep 2023 13:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696107320; x=1696712120; darn=gcc.gnu.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XvPQGLAb+MXdvwof5WeLpD/l6d8yMURHY7JdQygpWFw=; b=TGjenSbFMnmqGKBhmHDOiCk68/0kmroqfHbJQQgoTwT7GgOcT+f5RB+h++sgD6B1pI petjpY8CW3YYo7EyoehHvO0wO9g07OcDCLtYZp2zneN2/hVU4Ile7eGJ8ZhKnO5X8hv/ kAvjqJn/3v3Y7E30JFCwcpyOT4kIk5+yloeKIzE2fxYP20jmolhGXwBjP+KQqcCXXF2V l0Fy3d1qz6JeMEQy2kekjtCBll7BxROnllFZP7NUnYB1SNQ/WxPcjhbYp35uoy98fNYQ h8bZy29KGPWhOD/kFG1pzsxKmkRmFylgS0s/p0xcl5rWmjSccsLaYjtRHIoTTve7sOXL U/6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696107320; x=1696712120; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XvPQGLAb+MXdvwof5WeLpD/l6d8yMURHY7JdQygpWFw=; b=By4CE0BixpY3tvAaxzWh2YT8rBcIvQ+eB/M9/SVnKFG46lDB5f27fYydXNGbVanfaW jDvdY3YQb8HgXv9KEo66yiRBtdu9F+GCatPQLiMptyIey1hSeXMYVYKbqER+xgb2kzgN NTyzQaaEWTptaJBBQUHe4BwtsgkHM0TaeJ1GtuimMT/5ZqyxzFwcyv9ZlU1+ah2NaX9M AqZi1BMs1TIToQbXGg9w0xG7l3KuNdFSb955T5PylkMOUVfpHhmfEeQIZHWJDlAgNcHc I6M+8xvu1gx6gp68erf6GFdtY7H4d89xcp/XeV4Dhy2c464/NiLLmc2iZTa5qUqbnuQq bUpA== X-Gm-Message-State: AOJu0YwcQAB/bTPkynijXDCD9FOre2jXXX+nP1rlmkECMBzRawZjutuk Uj5MnnQ6h3NHI/+CyYGEXyHqFc95eac= X-Google-Smtp-Source: AGHT+IFCWWdBgr+D77GeMvYvp0jsis/tETTH0tB+CZzlxhWOYFRFIQOIETmpUeKccslCNne4GYhu2w== X-Received: by 2002:a0c:c981:0:b0:64c:92f8:6b11 with SMTP id b1-20020a0cc981000000b0064c92f86b11mr6475899qvk.37.1696107320024; Sat, 30 Sep 2023 13:55:20 -0700 (PDT) Received: from Dell-Inspiron-15 ([2601:18c:8002:3d40:7920:e10c:26cf:ff86]) by smtp.gmail.com with ESMTPSA id w15-20020a0ce10f000000b006560eea8a7esm4583665qvk.132.2023.09.30.13.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 13:55:19 -0700 (PDT) Date: Sat, 30 Sep 2023 16:55:17 -0400 From: Ben Wolsieffer To: gcc-patches@gcc.gnu.org Cc: Lance Fredrickson Subject: Re: [PATCH] arm: add -static-pie support Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,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 Tue, Jul 19, 2022 at 02:21:05PM -0600, lancethepants wrote: > The commit mirros code from aarch64 to handle -static-pie. > Tested with uclibc-ng and musl c-standard libraries. > > Signed-off-by: Lance Fredrickson > --- > gcc/config/arm/linux-elf.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h > index df3da67c4f0..70f71b051a3 100644 > --- a/gcc/config/arm/linux-elf.h > +++ b/gcc/config/arm/linux-elf.h > @@ -66,9 +66,10 @@ > %{static:-Bstatic} \ > %{shared:-shared} \ > %{symbolic:-Bsymbolic} \ > - %{!static: \ > + %{!static:%{!static-pie: \ > %{rdynamic:-export-dynamic} \ > - %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ > + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}} \ > + %{static-pie:-Bstatic -pie --no-dynamic-linker -z text} \ > -X \ > %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ > SUBTARGET_EXTRA_LINK_SPEC Hi, This patch seems to have gotten a bit mangled when it was submitted, so perhaps that's why it was ignored, but it would be great to get this functionality in gcc. In particular, systemd has begun relying on -static-pie for EFI support, and has to implement workarounds (manually passing these flags to the linker) for architectures that don't support -static-pie (see [1], [2]). Thanks, Ben [1] https://github.com/NixOS/nixpkgs/pull/243242#issuecomment-1741835837 [2] https://github.com/systemd/systemd/issues/29381