Re: [lfs-support] compile 32-bit kernel on a 64-bit LFS?

2019-12-16 Thread Ken Moffat
On Mon, Dec 16, 2019 at 02:00:58PM -0500, Michael Shell wrote:
> 
> Also, there is a patch for the kernel source that enables additional
> processor types and CPU specific optimizations:
> 
> https://github.com/graysky2/kernel_gcc_patch
> 
> IMHO, this patch should be accepted into the mainstream kernel tree.
> 
> 
>   Cheers,
> 
>   Mike Shell
> 
Hi Mike,

from memory the x86 maintainers were not keen on the patch because
it could make things harder to debug.  Although I would like to be
able to say "this one goes up to eleven", on a completed system the
optimizations for the kernel (assuming -Os is not used!) are the
least of the slowdowns.

And since most distros (with the likely exception of gentoo) do not
optimize for the running processor, it doesn't seem liekly to be
very important for normal use.  Oh, wait, intel's Clear linux ships
binaries with lots of variations for specific intel
micro-architectures (if I've understood reviews at phoronix
correctly).

But long story short: if something in the kernel gives a problem
while using it, upstream won't be interested unless it can be
replicated without using it.  Personally I've got enough problems on
my Picasso (works fine, except there is what I think is an oops
during bringing up amdgpu with all versions of the kernel new enough
to be able to do that - i.e. 5.0 and later) to not try this.

OTOH speed-ups, particularly on intel in the light of their
vulnerabilities and the slowdowns from newer microcode, are always
welcome so (like -march=native which I mostly use in userspace,
along with a choice of CFLAGS/CXXFLAGS) people should be encouraged
to experiment if they understand the potential downsides. ;-)

ĸen
-- 
  We've all got both light and dark inside of us.
  What matters is the part we choose to act on.
  -- Sirius Black
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] compile 32-bit kernel on a 64-bit LFS?

2019-12-16 Thread Michael Shell
On Thu, 12 Dec 2019 16:29:27 +0100
Thomas Seeling  wrote:

> take the .config from the 32-bit system and copy into the usual place on
> the compile machine. A multilib gcc is not required. I did not build the
> LFS for my 64-bit machine with multilib afair and it works.
> 
> Since you cannot "install" and "modules_install" you need to give
> temporary install paths for the kernel and the modules. These are 2
> distinct environment variables that have to be set.


  Thomas,

FWIW, the kernel build system also has environment variables to specify
the machine/CPU architecture as well as an alternate compiler.
For example, to build a 64 bit kernel on a 32 bit system, you could
do something like:

make ARCH=x86_64 CROSS_COMPILE=/opt/crosstools/bin/x86_64-linux-gnu- menuconfig
make ARCH=x86_64 CROSS_COMPILE=/opt/crosstools/bin/x86_64-linux-gnu- -j8
make ARCH=x86_64 CROSS_COMPILE=/opt/crosstools/bin/x86_64-linux-gnu- 
modules_install

where x86_64-linux-gnu- is the name prefix assigned to a cross gcc
(a 64 bit capable gcc, built using the --program-prefix=x86_64-linux-gnu-
during gcc configuration.) You can also use this approach to use any special
version of gcc for the kernel build.

In your case, a simple

make ARCH=x86_32 ...

should do the trick as long as your system gcc supports the specified
architecture and your .config is otherwise correct (including the
processor type) for what you want.

Also, there is a patch for the kernel source that enables additional
processor types and CPU specific optimizations:

https://github.com/graysky2/kernel_gcc_patch

IMHO, this patch should be accepted into the mainstream kernel tree.


  Cheers,

  Mike Shell

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style