Bug 19108

Summary: recompiling kernel made more difficult
Product: [Retired] Red Hat Linux Reporter: Michal Jaegermann <michal>
Component: kernelAssignee: Michael K. Johnson <johnsonm>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-14 16:52:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Jaegermann 2000-10-14 16:52:34 UTC
An attempt to recompile a non-Red Hat supplied kernel ends up with

gcc tools/objstrip.c -o tools/objstrip
tools/objstrip.c: In function `main':
tools/objstrip.c:153: invalid type argument of `->'
make[1]: *** [tools/objstrip] Error 1
make[1]: Leaving directory `/usr/src/linux-2.2.18px/arch/alpha/boot'
make: *** [boot] Error 2

In fact creating this executable is mostly irrelevant but "general
users" will be quite spooked.

A reason for this failure is an apparently gratituous change in
/usr/include/linux/asm/elf.h which looks like this:

--- include/asm/elf.h	Wed Jun 24 15:30:11 1998
+++ /usr/include/asm/elf.h	Tue Jul 11 16:43:45 2000
@@ -22,7 +22,7 @@
 /*
  * This is used to ensure we don't load something for the wrong
architecture.
  */
-#define elf_check_arch(x) ((x) == EM_ALPHA)
+#define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
 
 /*
  * These are used to set parameters in the core dumps.
@@ -127,8 +127,7 @@
 
 #ifdef __KERNEL__
 #define SET_PERSONALITY(EX, IBCS2)				\
-	current->personality =					\
-	  ((EX).e_flags & EF_ALPHA_32BIT			\
+	set_personality((EX).e_flags & EF_ALPHA_32BIT		\
 	   ? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX)
 #endif
 
and more precisely and more precisely a change to 'elf_check_arch' macro.

True, arch/alpha/boot/Makefile from Red Hat sources is doctored to
run
   gcc -I../../../include tools/objstrip.c -o tools/objstrip
and this will pick up a correct definition, but in standard kernel
sources one ends up running
   gcc tools/objstrip.c -o tools/objstrip
which pick up a wrong macro and fails like above.

It is quite likely that other tools for Alpha which need that header
will end up with similar troubles.  Why this modification?

  Michal
  michal

Comment 1 Phil Copeland 2001-05-06 04:58:08 UTC
I'm assuming this is no longer a problem?

Phil
=--=

Comment 2 Michal Jaegermann 2001-05-06 06:22:33 UTC
Indeed I did not notice anything of that sort in recent times.