LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   kernel & binutils (https://www.linuxquestions.org/questions/slackware-14/kernel-and-binutils-4175698015/)

marav 07-20-2021 10:35 AM

kernel & binutils
 
As mentioned in the kernel thread

the kernel doc :
Code:

CONFIG_X86_X32:
Include code to run binaries for the x32 native 32-bit ABI
for 64-bit processors.  An x32 process gets access to the
full 64-bit register file and wide data path while leaving
pointers at 32 bits for smaller memory footprint.

You will need a recent binutils (2.22 or later) with
elf32_x86_64 support enabled to compile a kernel with this
option set.

http://ftp.slackware.com/pub/slackwa...ils.SlackBuild
Code:

# Build for an x86 glibc2-based Linux system:
CFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --mandir=/usr/man \
  --infodir=/usr/info \
  --with-docdir=/usr/doc/binutils-$VERSION \
  --disable-compressed-debug-sections \
  --enable-shared \
  --enable-multilib \
  --enable-64-bit-bfd \
  --enable-plugins \
  --enable-threads \
  --enable-targets=i386-efi-pe,${TARGET} \
  --enable-install-libiberty \
  --enable-gold=yes \
  --enable-ld=default \
  --enable-initfini-array \
  $WERROR \
  --build=$TARGET \
  || exit 1

Could binutils be compiled with elf32_x86_64 support enabled ?

LuckyCyborg 07-20-2021 10:39 AM

Well, I think this is intentional. Years ago was heated discussions regarding Slackware and multilib.

So, the kernel is "multilib" , while the operating system is not.

marav 07-20-2021 10:57 AM

so, I probably don't use 32b software ...
let's go :-)

hazel 07-20-2021 11:47 AM

There's an unofficial multilib version of LFS that includes this architecture. I can't remember who maintains it but there are a couple of threads on it in the LFS forum.

Petri Kaukasoina 07-20-2021 02:31 PM

https://www.linuxquestions.org/quest...ml#post6267470
https://www.linuxquestions.org/quest...ml#post6267666

Petri Kaukasoina 07-20-2021 03:34 PM

Quote:

Originally Posted by LuckyCyborg (Post 6268083)
So, the kernel is "multilib" , while the operating system is not.

And binutils is.
Code:

$ ld --help|grep targets:
ld: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 pei-i386 pe-x86-64 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-i386 pe-bigobj-i386 srec symbolsrec verilog tekhex binary ihex plugin


marav 07-20-2021 05:46 PM

Quote:

Originally Posted by Petri Kaukasoina (Post 6268189)
And binutils is.
Code:

$ ld --help|grep targets:
ld: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 pei-i386 pe-x86-64 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-i386 pe-bigobj-i386 srec symbolsrec verilog tekhex binary ihex plugin


I've seen your post Petri
That's why I made this request

Petri Kaukasoina 07-21-2021 02:46 AM

OK, but in this post https://www.linuxquestions.org/quest...ml#post6267470 I showed that ld makes an elf32_x86_64 exe from an elf32_x86_64 object. After that file tells it's 'ELF 32-bit LSB executable, x86-64'. An ordinary 64-bit exe of slackware64 is 'ELF 64-bit LSB executable, x86-64' and in the 32-bit slackware it's 'ELF 32-bit LSB executable, Intel 80386'. So, elf32-x86-64 is already supported is slackware64, as is elf32-i386. Alien Bob's multilib also does not replace binutils, even though you can't see elf32-i386 in the configure command you copied in your original post.

marav 07-21-2021 03:04 AM

I just don't like warnings :-)
so I removed the 32bits support in the kernel

davjohn 07-21-2021 09:37 AM

This is not "normal" 32bit support.
This is x32 ABI, it's kind of hybrid between 32 and 64bit.
It's running in 64 bit mode but uses 32bit pointers. I don't know if this is really used anywhere.

hazel 07-21-2021 09:59 AM

Turned out one of those LFS threads I mentioned was mine! It contains a discussion of -x32 versus -32 and -64.
https://www.linuxquestions.org/quest...st-4175684753/.

I hope this kind of absent-mindedness isn't an early sign of dementia.


All times are GMT -5. The time now is 04:34 AM.