linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: richard@nod.at, anton.ivanov@cambridgegreys.com,
	 johannes@sipsolutions.net, masahiroy@kernel.org
Cc: nathan@kernel.org, nicolas@fjasle.eu, ndesaulniers@google.com,
	 morbo@google.com, justinstitt@google.com,
	linux-um@lists.infradead.org,  linux-kbuild@vger.kernel.org,
	llvm@lists.linux.dev, patches@lists.linux.dev,
	 stable@vger.kernel.org
Subject: [PATCH 0/2] Fix UML build with clang-18 and newer
Date: Tue, 23 Jan 2024 15:59:53 -0700	[thread overview]
Message-ID: <20240123-fix-uml-clang-18-v1-0-efc095519cf9@kernel.org> (raw)

Hi all,

This series resolves two independent but related issues that were
recently exposed by two LLVM changes.

https://github.com/llvm/llvm-project/commit/ec92d74a0ef89b9dd46aee6ec8aca6bfd3c66a54
exposes that '-no-pie' is not getting added to the linker flags with
clang, resulting in building objects with '-fno-PIE' that are linked
with '-pie', to which the linker rightfully errors with:

  /usr/sbin/ld: init/main.o: relocation R_X86_64_32 against symbol `saved_command_line' can not be used when making a PIE object; recompile with -fPIE
  /usr/sbin/ld: failed to set dynamic section sizes: bad value

https://github.com/llvm/llvm-project/commit/4bf8a688956a759b7b6b8d94f42d25c13c7af130
adds '.ltext' (and '.ltext.*' with '-ffunction-sections') when using
'-mcmodel=large' (which UML does), which causes a segmentation fault
with modpost.

I have tested these patches with all supported versions of clang,
noticing no regressions.

---
Nathan Chancellor (2):
      um: Fix adding '-no-pie' for clang
      modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS

 arch/um/Makefile      | 4 +++-
 scripts/mod/modpost.c | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
---
base-commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a
change-id: 20240118-fix-uml-clang-18-e365b0503a29

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>



             reply	other threads:[~2024-01-23 23:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 22:59 Nathan Chancellor [this message]
2024-01-23 22:59 ` [PATCH 1/2] um: Fix adding '-no-pie' for clang Nathan Chancellor
2024-01-27 15:46   ` Masahiro Yamada
2024-01-23 22:59 ` [PATCH 2/2] modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS Nathan Chancellor
2024-01-27 15:49   ` Masahiro Yamada
2024-01-27 15:43 ` [PATCH 0/2] Fix UML build with clang-18 and newer Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240123-fix-uml-clang-18-v1-0-efc095519cf9@kernel.org \
    --to=nathan@kernel.org \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=johannes@sipsolutions.net \
    --cc=justinstitt@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=morbo@google.com \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=patches@lists.linux.dev \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).