Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Apr 2018 21:33:30 -0500
From:      Benjamin Kaduk <bjk@freebsd.org>
To:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc:        Ed Maste <emaste@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Can't load linux64.ko module
Message-ID:  <20180406023330.GI80088@mit.edu>
In-Reply-To: <20180404213453.GA35165@troutmask.apl.washington.edu>
References:  <20180403162600.GA23894@troutmask.apl.washington.edu> <CAPyFy2D7dkUO929htg4Qxu6jQXgc2M4J1fFtd2s_2gZ5wKK3-w@mail.gmail.com> <20180404190902.GA34292@troutmask.apl.washington.edu> <20180404201955.GA34736@troutmask.apl.washington.edu> <20180404211315.GA35006@troutmask.apl.washington.edu> <20180404213453.GA35165@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 04, 2018 at 02:34:53PM -0700, Steve Kargl wrote:
> 
> The answer is compat/linux/linux_vdso.c where we find
> 
> #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
> #define __ELF_WORD_SIZE 32
> #else
> #define __ELF_WORD_SIZE 64
> #endif
> 
> having COMPAT_LINUX32 in my kernel config file gives me
> elf32_linux_vdso_fixup.  It seems that one cannot have
> a kernel that supports both 32 and 64-bit linux software.
> 
> linux(4) states
> 
>      for an amd64 kernel use:
> 
>            options COMPAT_LINUX32
> 
>      Alternatively, to load the ABI as a module at boot time, place the
>      following line in loader.conf(5):
> 
>            linux_load="YES"
> 
> It turns out that I have 'linux_load=YES" in /etc/loader.conf.
> When I boot the kernel built with COMPAT_LINUX32 prevents 
> the kldload of linux64.ko.

Yes, building the linuxulator statically into the kernel forces only
a single ABI to be possible.  If dynamic modules are used for all
three relevant modules, then it is possible to simultaneously
support 32- and 64-bit linux code.

This is (perhaps obliquely) documented at
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/linuxemu-lbc-install.html
which I added after a similar thread on -current last July.

-Ben



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180406023330.GI80088>