Skip to contentSkip to conversation

: Fix 3.7 mips build if !CONFIG_MODULES

PATCH Superseded Joshua Kinard 2 participants 4 messages Dec 27, 2012 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix 3.7 mips build if !CONFIG_MODULES

The attached patch fixes a build failure if building a monolithic kernel due to arch/mips/kernel/Kconfig selecting MODULES_USE_ELF_REL[A] without checking to see if MODULES is set or not. This leads to 'struct module' not existing, which triggers a compile failure in arch/mips/kernel/module-rela.c when the compiler attempts to dereference me->name on lines 36, 48, and 133.

---

 Kconfig |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/Kconfig +2 -2
diff -Naurp a/arch/mips/Kconfig b/arch/mips/Kconfig
@@ -39,8 +39,8 @@ config MIPS
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_CMOS_UPDATE
 	select HAVE_MOD_ARCH_SPECIFIC
-	select MODULES_USE_ELF_REL
-	select MODULES_USE_ELF_RELA if 64BIT
+	select MODULES_USE_ELF_REL && MODULES
+	select MODULES_USE_ELF_RELA if MODULES && 64BIT
 
 menu "Machine selection"
#1 lore raw
Quoted 17 lines · Joshua Kinard

The attached patch fixes a build failure if building a monolithic kernel due to arch/mips/kernel/Kconfig selecting MODULES_USE_ELF_REL[A] without checking to see if MODULES is set or not. This leads to 'struct module' not existing, which triggers a compile failure in arch/mips/kernel/module-rela.c when the compiler attempts to dereference me->name on lines 36, 48, and 133.

---

 Kconfig |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -Naurp a/arch/mips/Kconfig b/arch/mips/Kconfig

arch/mips/Kconfig 2012-12-26 23:00:46.202996691 -0500 config MIPS · line 42

Quoted 6 lines
arch/mips/Kconfig 2012-12-26 23:00:46.202996691 -0500 renamed from arch/mips/Kconfig 2012-12-22 22:52:28.264461836 -0500 +1 -2
@@ -39,8 +39,8 @@ config MIPS
        select GENERIC_CLOCKEVENTS
        select GENERIC_CMOS_UPDATE
        select HAVE_MOD_ARCH_SPECIFIC
-       select MODULES_USE_ELF_REL
-       select MODULES_USE_ELF_RELA if 64BIT
+       select MODULES_USE_ELF_REL && MODULES

Shouldn't that be

select MODULES_USE_ELF_REL if MODULES

?

arch/mips/Kconfig 2012-12-26 23:00:46.202996691 -0500 config MIPS · line 43

Quoted 1 line
arch/mips/Kconfig 2012-12-26 23:00:46.202996691 -0500 renamed from arch/mips/Kconfig 2012-12-22 22:52:28.264461836 -0500 +1 -0
+       select MODULES_USE_ELF_RELA if MODULES && 64BIT

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 27 lines · Geert Uytterhoeven
Quoted 17 lines · Joshua Kinard

The attached patch fixes a build failure if building a monolithic kernel due to arch/mips/kernel/Kconfig selecting MODULES_USE_ELF_REL[A] without checking to see if MODULES is set or not. This leads to 'struct module' not existing, which triggers a compile failure in arch/mips/kernel/module-rela.c when the compiler attempts to dereference me->name on lines 36, 48, and 133.

---

 Kconfig |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -Naurp a/arch/mips/Kconfig b/arch/mips/Kconfig

arch/mips/Kconfig 2012-12-26 23:00:46.202996691 -0500 config MIPS · line 42

Quoted 6 lines
arch/mips/Kconfig 2012-12-26 23:00:46.202996691 -0500 renamed from arch/mips/Kconfig 2012-12-22 22:52:28.264461836 -0500 +1 -2
@@ -39,8 +39,8 @@ config MIPS
        select GENERIC_CLOCKEVENTS
        select GENERIC_CMOS_UPDATE
        select HAVE_MOD_ARCH_SPECIFIC
-       select MODULES_USE_ELF_REL
-       select MODULES_USE_ELF_RELA if 64BIT
+       select MODULES_USE_ELF_REL && MODULES

Shouldn't that be

Quoted 5 lines

select MODULES_USE_ELF_REL if MODULES

?

Quoted 1 line
arch/mips/Kconfig 2012-12-26 23:00:46.202996691 -0500 renamed from arch/mips/Kconfig 2012-12-22 22:52:28.264461836 -0500 +1 -0
+       select MODULES_USE_ELF_RELA if MODULES && 64BIT

Whoops, yep! Thanks for the catch, I'll resend a fixed patch.

Signature · 9 lines
Joshua Kinard
Gentoo/MIPS
[email protected]
4096R/D25D95E3 2011-03-28

"The past tempts us, the present confuses us, the future frightens us.  And
our lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic
#3 lore raw

PATCH v2 1/1 : Fix 3.7 mips build if !CONFIG_MODULES

In reply to Joshua Kinard

The attached patch fixes a build failure if building a monolithic kernel due to arch/mips/kernel/Kconfig selecting MODULES_USE_ELF_REL[A] without checking to see if MODULES is set or not. This leads to 'struct module' not existing, which triggers a compile failure in arch/mips/kernel/module-rela.c when the compiler attempts to dereference me->name on lines 36, 48, and 133.

---

 Kconfig |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/Kconfig +2 -2
diff -Naurp a/arch/mips/Kconfig b/arch/mips/Kconfig
@@ -39,8 +39,8 @@ config MIPS
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_CMOS_UPDATE
 	select HAVE_MOD_ARCH_SPECIFIC
-	select MODULES_USE_ELF_REL
-	select MODULES_USE_ELF_RELA if 64BIT
+	select MODULES_USE_ELF_REL if MODULES
+	select MODULES_USE_ELF_RELA if MODULES && 64BIT
 
 menu "Machine selection"