LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-19-2025, 04:39 PM   #1
koleq
LQ Newbie
 
Registered: May 2025
Location: Czechia
Distribution: Fedora, Slackware or Arch
Posts: 1

Rep: Reputation: 0
kernel 5.4.293 compile issues on x86 32bit host


Hello LinuxQuestions.org community,

I'm attempting to build modern-ish kernels under 32bit Slackware 11.
I've compiled new tool chain currently gcc-4.6.4, perl-5.16.3, openssl-3.0.16, wget-2.15.0, binutils-2.25.1, flex-2.5.39
(rest of the packages are old from the Slackware 11)
I've also updated the LILO to 24.2
and the latest kernel I've managed to build was 4.19.325 in which I just had to copy some headers to correct locations and than it pretty much just built.
I'm running Slackware in VMware Workstation 17 Pro, under a Windows 10 host.

I'm tackling Linux kernel 5.4.293 next, and I hit a snag

here is the error message (make -j6):
Code:
  HOSTCC  arch/x86/tools/relocs_64.o
In file included from arch/x86/tools/relocs_64.c:18:0:
arch/x86/tools/relocs.c: In function 'rel_type':
arch/x86/tools/relocs.c:201:3: error: 'R_X86_64_PC64' undeclared (first use in this function)
arch/x86/tools/relocs.c:201:3: note: each undeclared identifier is reported only once for each function it appears in
arch/x86/tools/relocs.c:201:3: error: array index in initializer not of integer type
arch/x86/tools/relocs.c:201:3: error: (near initialization for 'type_name')
arch/x86/tools/relocs.c: In function 'do_reloc64':
arch/x86/tools/relocs.c:819:7: error: 'R_X86_64_PC64' undeclared (first use in this function)
make[2]: *** [arch/x86/tools/relocs_64.o] Error 1
make[1]: *** [archscripts] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [sub-make] Error 2
here is my .config
https://pastebin.com/hnTEeNnr

I think it's trying to build something 64bit and failing but I'm not really sure.
I originally got a warning `You are building kernel with a non-retpoline compiler. Please update your compiler`
I got around that by disabling "Avoid speculation indirect branches in kernel"
So no specre or meltdown patches if I understand that correctly? But I don't mind.
I also tried looking up relocs_64 in the arch/x86/tools/Makefile and removing that but that only got me a different error

arch/x86/tools/Makefile (near the bottom):
Code:
HOST_EXTRACFLAGS += -I$(srctree)/tools/include
hostprogs-y     += relocs
relocs-objs     := relocs_32.o relocs_64.o relocs_common.o
PHONY += relocs
relocs: $(obj)/relocs
I removed the relocs_64.o and got this (make -j6):
Code:
  HOSTCC  scripts/basic/fixdep
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
arch/x86/tools/relocs_common.o: In function `main':
relocs_common.c:(.text.startup+0x1db): undefined reference to `process_64'
collect2: ld returned 1 exit status
make[2]: *** [arch/x86/tools/relocs] Error 1
make[1]: *** [archscripts] Error 2
make: *** [sub-make] Error 2
I'm not really skilled at building kernels I've built a few kernel-next's on a modern distro's like Fedora and Arch and my Slackware 11 currently has:
2.4.33.3, 2.6.16.62, 2.6.27.62, 3.0.101, 4.1.52, 4.14.336, 4.19.325

If I said something incorrectly I'm sorry. If you have questions or want me to runs some commands. Please let me know!
 
Old 05-24-2025, 03:25 AM   #2
___
Member
 
Registered: Apr 2023
Distribution: mll,4M
Posts: 296
Blog Entries: 1

Rep: Reputation: 60
welcome to LQ. Since no one answered (probably because of what you are attempting), ChatGPT says this:

The error messages suggest that the build process is attempting to compile 64-bit code on a 32-bit host, leading to undefined references such as R_X86_64_PC64.

The error messages indicate that the build process is trying to compile 64-bit code (relocs_64.o), which is incompatible with your 32-bit system. This mismatch often occurs when the kernel configuration or the build environment isn't properly set up for a 32-bit architecture.

Clean the build and try again. (At least rm relocs_common.o but IDK if HOSTCC indicates it did)
Maybe https://stackoverflow.com/questions/...ass-elfclass64
Esp https://patchwork.kernel.org/project...it@google.com/

Last edited by ___; 05-24-2025 at 04:25 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Vulkan 1.3.293 Released With NVIDIA Command Buffer Inheritance Extension LXer Syndicated Linux News 0 08-19-2024 04:30 AM
Can't compile kernel on x86 32bit while installing gentoo sumanta_x86 Gentoo 5 01-25-2015 06:37 AM
Fedora 13 32bit and then Linux Mint 32bit and then Ubuntu 10.04 32bit ciao303 Linux - Newbie 3 08-09-2010 11:03 PM
How to get g++293 into RH9 alanwolfen Linux - Software 1 04-16-2005 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration