From: Helge Deller <deller@gmx.de>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: linux-parisc@vger.kernel.org,
Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: hppa vDSO and compiler (non-)support
Date: Tue, 8 Mar 2022 17:40:13 +0100 [thread overview]
Message-ID: <YieG7XxeM8B83AbP@ls3530> (raw)
In-Reply-To: <2e1f3e41-7097-e68d-d312-9319ad62565c@gmx.de>
* Helge Deller <deller@gmx.de>:
> Hi Jiri,
>
> Thanks for testing on parisc!
>
> On 3/8/22 12:06, Jiri Slaby wrote:
> > since the "parisc: Add vDSO support" commit, I can no longer cross-build a hppa kernel. I see two issues:
> >
> > 1) CROSS32_COMPILE detection doesn't work here, as openSUSE provides hppa-suse-linux-* binaries. It's easy to overcome by "CROSS32_COMPILE=hppa-suse-linux-"
>
> How is it handled for other platforms like s390x?
> Would it make sense to add the detection for SUSE too?
>
> > 2) openSUSE doesn't provide any libc for hppa. So gcc doesn't provide libgcc.a and the build of vDSO fails.
>
> libgcc.a comes with the compiler, I don't think you need libc for that.
> I'm currently installing opensuse to try myself though...
>
> > So could vDSO be optional on hppa via KConfig?
> The vDSO is one of the first things which is built during kernel build process.
> This is why you fail.
> Making it optional doesn't make sense, because then the kernel wouldn't be able
> to start the user space processes.
>
> > I used to use the cross compiler to at least compile-check the following tty drivers:
> > arch/parisc/kernel/pdc_cons.o
> > drivers/tty/serial/mux.o
> > drivers/tty/serial/8250/8250_gsc.o
>
> I assume you never built a full kernel, but stopped when building those modules?
> Without libgcc.a the kernel itself wouldn't have linked before either.
Below is a hackish patch which should allow you to build at least until
those modules. The make will still fail when linking the vmlinux file,
because libgcc.a provides the necessary low level symbols.
I'm currently not planning to include this patch, because it simply
doesn't make sense. Maybe you could nevertheless try/use it?
I'm open to any other ideas you may have.
IMHO, the only solution is, that libgcc.a gets included into the suse cross
compiler rpm package.
Helge
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 2a9387a93592..3e62527db749 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -165,6 +165,7 @@ vmlinuz: bzImage
$(OBJCOPY) $(boot)/bzImage $@
ifeq ($(KBUILD_EXTMOD),)
+ifdef CONFIG_VDSO
# We need to generate vdso-offsets.h before compiling certain files in kernel/.
# In order to do that, we should use the archprepare target, but we can't since
# asm-offsets.h is included in some files used to generate vdso-offsets.h, and
@@ -177,6 +178,7 @@ vdso_prepare: prepare0
$(build)=arch/parisc/kernel/vdso64 include/generated/vdso64-offsets.h)
$(Q)$(MAKE) $(build)=arch/parisc/kernel/vdso32 include/generated/vdso32-offsets.h
endif
+endif
PHONY += vdso_install
diff --git a/arch/parisc/include/asm/vdso.h b/arch/parisc/include/asm/vdso.h
index ef8206193f82..d667cddd700d 100644
--- a/arch/parisc/include/asm/vdso.h
+++ b/arch/parisc/include/asm/vdso.h
@@ -2,6 +2,7 @@
#ifndef __PARISC_VDSO_H__
#define __PARISC_VDSO_H__
+#ifdef CONFIG_VDSO
#ifndef __ASSEMBLY__
#ifdef CONFIG_64BIT
@@ -15,6 +16,12 @@
extern struct vdso_data *vdso_data;
#endif /* __ASSEMBLY __ */
+#else /* CONFIG_VDSO */
+
+#define VDSO64_SYMBOL(tsk, name) (0)
+#define VDSO32_SYMBOL(tsk, name) (0)
+
+#endif /* CONFIG_VDSO */
/* Default link addresses for the vDSOs */
#define VDSO_LBASE 0
diff --git a/arch/parisc/kernel/Makefile b/arch/parisc/kernel/Makefile
index d579243edc2f..461dd4a85e99 100644
--- a/arch/parisc/kernel/Makefile
+++ b/arch/parisc/kernel/Makefile
@@ -41,6 +41,8 @@ obj-$(CONFIG_KEXEC_CORE) += kexec.o relocate_kernel.o
obj-$(CONFIG_KEXEC_FILE) += kexec_file.o
# vdso
+ifdef CONFIG_VDSO
obj-y += vdso.o
obj-$(CONFIG_64BIT) += vdso64/
obj-y += vdso32/
+endif
next prev parent reply other threads:[~2022-03-08 16:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 11:06 hppa vDSO and compiler (non-)support Jiri Slaby
2022-03-08 14:51 ` Helge Deller
2022-03-08 16:40 ` Helge Deller [this message]
2022-03-09 5:48 ` Jiri Slaby
2022-03-21 7:26 ` Jiri Slaby
2022-03-21 18:51 ` Helge Deller
2022-03-22 9:19 ` Jiri Slaby
2022-03-22 9:42 ` Helge Deller
2022-03-22 13:05 ` Guenter Roeck
2022-03-22 14:25 ` Helge Deller
2022-03-22 15:19 ` Guenter Roeck
2022-03-22 16:16 ` Helge Deller
2022-03-22 17:50 ` Guenter Roeck
2022-03-24 7:20 ` Helge Deller
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=YieG7XxeM8B83AbP@ls3530 \
--to=deller@gmx.de \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@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