Page 1 of 1

Compile Module Impossible on 5.6 Kernel?

Posted: Sun Oct 25, 2020 5:39 am
by raw2020
Was 32Bit C code execution disabled by the MXLinux Kernel Developers in the first place as security feature?
Running Kernel: 5.6.0-2-amd64 x86_64 bits: 64 Desktop: Xfce 4.14.2
Distro: MX-19.2_x64 patito feo October 21 2019

Although I have CONFIG_X86_X32 enabled in Grub.

Code: Select all

raw2020@mx19:~/fcpci-4.4.0/src
$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(unset PRETTY_NAME; (. /etc/lsb-release; echo ${PRETTY_NAME:?}) 2>/dev/null || echo Debian)"
GRUB_CMDLINE_LINUX_DEFAULT="quiet nosplash radeon.hard_reset=1 syscall.x32=y quiet"
GRUB_CMDLINE_LINUX="syscall.x32=y"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

GRUB_DISABLE_OS_PROBER=false
#export GRUB_MENU_PICTURE="/usr/share/backgrounds/MXLinux/grub/linen-gradientblu-grub.png"
#export GRUB_MENU_PICTURE="/usr/share/backgrounds/MX18ALPHAWALL.png"

GRUB_THEME="/boot/grub/themes/linen/theme.txt"
Building it shows not supported.

Code: Select all

root@mx19:/home/USER/fcpci-4.4.0/src# make -C /usr/src/linux-source-5.6/ M=PWD
make: Entering directory '/usr/src/linux-source-5.6'
arch/x86/Makefile:147: CONFIG_X86_X32 enabled but no binutils support
scripts/Makefile.build:44: PWD/Makefile: No such file or directory
make[1]: *** No rule to make target 'PWD/Makefile'.  Stop.
make: *** [Makefile:1704: PWD] Error 2
make: Leaving directory '/usr/src/linux-source-5.6'
How can one check what was enabled in the MXL Kernel in the first place when they built it?

Re: Compile Module Impossible on 5.6 Kernel?

Posted: Sun Oct 25, 2020 5:51 am
by raw2020
Do I need package binutils for 32 bit architecture installed here?
obviously I am missing the obvious solution to this problem, if somebody knows please tell me. Thanks.

Re: Compile Module Impossible on 5.6 Kernel?

Posted: Sun Oct 25, 2020 6:11 am
by JayM
As a starting point whenever asking for help, please run Quick System Info and post your system information as per the forum rules by following the instructions here. Thanks.

Re: Compile Module Impossible on 5.6 Kernel?

Posted: Sun Oct 25, 2020 6:22 am
by tony37
raw2020 wrote: Sun Oct 25, 2020 5:51 am Do I need package binutils for 32 bit architecture installed here?
that's one thing to try
are you sure M=PWD shouldn't be M=$(PWD) ?

Re: Compile Module Impossible on 5.6 Kernel?

Posted: Mon Oct 26, 2020 8:19 am
by Stevo
There is a major difference between x32 and i386 packages in Debian, though both are 32-bit. MX does not have an x32 version.

Can you explain exactly why you want to use the less common x32 option, if your mystery module source even supports it, and maybe what that mystery module is?

You probably can cross-compile a normal i386 module on a 64-bit system, but it seems easier to just do it in an i386 virtual machine--MX includes everything necessary to build a native architecture module by default.

Remember, random old module source code off the Net probably won't "just build" with newer kernels, too.

Re: Compile Module Impossible on 5.6 Kernel?

Posted: Wed Oct 28, 2020 1:30 pm
by raw2020
tony37 wrote: Sun Oct 25, 2020 6:22 am that's one thing to try
are you sure M=PWD shouldn't be M=$(PWD) ?
Yes I'm sure.
The M=$PWD command above is not a commandline option of the make programm, but rather it's an argument passed to make that specifies the environment variable inside the Makefile. My second name is Antonius btw.

Re: Compile Module Impossible on 5.6 Kernel?

Posted: Wed Oct 28, 2020 2:15 pm
by raw2020
Stevo wrote: Mon Oct 26, 2020 8:19 am There is a major difference between x32 and i386 packages in Debian, though both are 32-bit. MX does not have an x32 version.
(1) Thank you for telling me that stevo, I'm just reading about the difference of x32, x86 and x64 architectures because of your comment.
Stevo wrote: Mon Oct 26, 2020 8:19 am Can you explain exactly why you want to use the less common x32 option, if your mystery module source even supports it, and maybe what that mystery module is?
(2) Stevo, I don't udnerstand ABI nor assembly language yet. All of this is way too much technical knowledge for me atm. You are very kind for answering me and helpming me here. You can have the attached fcpci-4.4.0.tar.gz source code for the pci card with a rj45 connector for ISDN, to have a look at, if you are so kind. The vt output says x32, and that's all I know.
Stevo wrote: Mon Oct 26, 2020 8:19 am You probably can cross-compile a normal i386 module on a 64-bit system, but it seems easier to just do it in an i386 virtual machine--MX includes everything necessary to build a native architecture module by default.
(3)stevo, do you mean I should use a 32-bit rig, built the module on it, and it would compute/run on my 64-bit desktop? Assuming the same Kernel revisions and MX19.2 on the 32-bit machine for building?
Stevo wrote: Mon Oct 26, 2020 8:19 am Remember, random old module source code off the Net probably won't "just build" with newer kernels, too.
(4) Yup, I had to learn that the hard way.

stevo when I see your wolf avatar I always wonder, is it a pure wolf?, or is it a hybrid with a coyote or a dog? Is it your pet? :eek: I have just a cat.

Re: Compile Module Impossible on 5.6 Kernel?

Posted: Thu Oct 29, 2020 8:47 am
by Stevo
*** DO NOT TRY AT HOME ******

I have the local pack of three wild coyotes pretty much used to me, and they'll come along on my nightly walks, mainly because I give them treats. I just saw them tonight, in fact. That's the female in the pack--that shot is from Halloween night 2018. She (Notchie because of the little tear in her left ear) and her mate "Boss" will even eat from my hand, though I don't want others to try or do so. So far, they are still wary of other people and their pets, and don't cause trouble. :crossfingers: :crossfingers: :crossfingers: and I still have all my fingers, in fact.

They have another pack member that joined some months ago, and he's still not quite as trusting. I named him "Mookie" after the Dodger's Gold Glove outfielder because he's really good at catching treats that I throw on the fly--he once caught a pizza slice at about 50 ft out from me like a dog catching a frisbee.

Re: Compile Module Impossible on 5.6 Kernel?

Posted: Fri Oct 30, 2020 8:24 am
by Stevo
The driver source you sent me dates back to 2016 and only is supposed to build for sure on a 4.4 kernel. It has some links in the readme that may have newer source, otherwise you'll have to practice your websearch-fu to see if anyone has patched it for newer kernels.