[PATCH 2/5] configure.ac, arch/x86_64: handle x32 as subarch of x86_64 and don't specify -mcmodel=large there

Simon Horman horms at verge.net.au
Fri Oct 23 14:40:26 EDT 2020


On Fri, Oct 23, 2020 at 05:41:03PM +0200, Ahelenia Ziemiańska wrote:
> On Fri, Oct 23, 2020 at 04:33:07PM +0200, Simon Horman wrote:
> > On Fri, Oct 09, 2020 at 05:39:42PM +0200, Ahelenia Ziemiańska wrote:
> > > Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli at nabijaczleweli.xyz>
> > > ---
> > >  configure.ac                   | 8 ++++++++
> > >  purgatory/arch/x86_64/Makefile | 2 ++
> > >  2 files changed, 10 insertions(+)
> > > 
> > > diff --git a/configure.ac b/configure.ac
> > > index f025823..4e8f7c5 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -54,6 +54,14 @@ case $target_cpu in
> > >  		;;
> > >  	ia64|x86_64|alpha|m68k )
> > >  		ARCH="$target_cpu"
> > > +		case $target in
> > > +			*x32 )
> > > +				SUBARCH="x32"
> > > +				;;
> > > +			* )
> > > +				SUBARCH=""
> > > +				;;
> > > +		esac
> > 
> > Is x32 value only for x86_64 or ia64, x886_64, alpha and m68k as
> > seems to be implied by this change?
> 
> There is, indeed, no x32 equivalent for non-amd64,
> but I just put this here like this because there aren't
> any other triples that end in "x32". Would you rather this go
> in a separate "if ARCH=x86_64 && target=*x32" clause below?

Yes, I think that would be slightly nicer.

> > Also, could you let me know how to exercise compiling this changeset?
> 
> The easiest way would be to install GCC for "x86_64-linux-gnux32";
> on Buster, installing gcc-x86-64-linux-gnux32 followed by
>   ./configure --host=x86_64-linux-gnux32
> worked and built.

Thanks, this looks like it should work well for me.
I'll try it out.

> Alternatively, you could use an x32 chroot via something
> along the lines of
>   debootstrap --arch=x32 --variant=minbase
>     --include=debian-ports-archive-keyring --no-check-gpg sid target
>     https://deb.debian.org/debian-ports
> and proceeding as normal within.
> 
> To test the kexecution and/or get the x32 userland to run, you'll need
> your kernel to have CONFIG_X86_X32=y, or, on Debian amd64 kernels,
> to pass syscall.x32=y on the cmdline.
> 
> Best,
> Ahelenia





More information about the kexec mailing list