Skip to contentSkip to conversation

IDE module problem

DISCUSSION Jun Sun 3 participants 7 messages Dec 10, 2002 – Dec 17, 2002 MIPS

lore
Share & tools
lore

Jun Sun

author
#0 lore raw

If you configure IDE support as a module (CONFIG_IDE), you will soon find that ide-std.o and ide-no.o are missing. This is because arch/mips/lib/Makefile says:

obj-$(CONFIG_IDE) += ide-std.o ide-no.o

Here are the possible fixes. I'd like to hear your feedbacks.

1) change config-shared.in file so that CONFIG_IDE only has a binary state (y or n)

2) change Makefile so that ide-std.o and ide-no.o are always included. Waste about 1K for systems don't use them at all.

3) use some smart trick in Makefile so that we include those two files only if CONFIG_IDE is 'y' or 'm'. (How?)

Jun

#1 lore raw
Quoted 5 lines · Jun Sun

If you configure IDE support as a module (CONFIG_IDE), you will soon find that ide-std.o and ide-no.o are missing. This is because arch/mips/lib/Makefile says:

obj-$(CONFIG_IDE) += ide-std.o ide-no.o

[...]

Quoted 2 lines

3) use some smart trick in Makefile so that we include those two files only if CONFIG_IDE is 'y' or 'm'. (How?)

obj-$(CONFIG_IDE_MODULE)

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
author
#2 lore raw
Quoted 6 lines · Maciej W. Rozycki
Quoted 4 lines · Jun Sun

If you configure IDE support as a module (CONFIG_IDE), you will soon find that ide-std.o and ide-no.o are missing. This is because arch/mips/lib/Makefile says:

Quoted 7 lines
Quoted 1 line

obj-$(CONFIG_IDE) += ide-std.o ide-no.o

[...]

Quoted 2 lines

3) use some smart trick in Makefile so that we include those two files only if CONFIG_IDE is 'y' or 'm'. (How?)

obj-$(CONFIG_IDE_MODULE)

This does not work. Apparently, CONFIG_IDE_MODULE is not created for makefile part.

Jun

#3 lore raw
Quoted 11 lines · Jun Sun
Quoted 8 lines
Quoted 3 lines

This is because arch/mips/lib/Makefile says:

obj-$(CONFIG_IDE) += ide-std.o ide-no.o

[...]

Quoted 2 lines

3) use some smart trick in Makefile so that we include those two files only if CONFIG_IDE is 'y' or 'm'. (How?)

obj-$(CONFIG_IDE_MODULE)

This does not work. Apparently, CONFIG_IDE_MODULE is not created for makefile part.

Indeed -- my fault. Variables such as $(CONFIG_IDE) are four-state and
for the module case they are simply set to "m". But then you can use "ifeq ($(CONFIG_IDE),m)". Another approach is to invent an additional variable automatically set to "y" whenever CONFIG_IDE is enabled.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#4 lore raw
Quoted 11 lines · Maciej W. Rozycki
Quoted 9 lines · Jun Sun
Quoted 8 lines
Quoted 3 lines

This is because arch/mips/lib/Makefile says:

obj-$(CONFIG_IDE) += ide-std.o ide-no.o

[...]

Quoted 2 lines

3) use some smart trick in Makefile so that we include those two files only if CONFIG_IDE is 'y' or 'm'. (How?)

obj-$(CONFIG_IDE_MODULE)

Quoted 7 lines
Quoted 2 lines

This does not work. Apparently, CONFIG_IDE_MODULE is not created for makefile part.

Indeed -- my fault. Variables such as $(CONFIG_IDE) are four-state and for the module case they are simply set to "m". But then you can use "ifeq ($(CONFIG_IDE),m)". Another approach is to invent an additional variable automatically set to "y" whenever CONFIG_IDE is enabled.

obj-$(subst m,y,$(CONFIG_IDE)) += ide-std.o ide-no.o

ide-std.o ide-no.o are built in if CONFIG_IDE is m or y.

author
#5 lore raw
Quoted 16 lines · Keith Owens
Quoted 14 lines · Maciej W. Rozycki
Quoted 11 lines · Jun Sun
Quoted 8 lines
Quoted 3 lines

This is because arch/mips/lib/Makefile says:

obj-$(CONFIG_IDE) += ide-std.o ide-no.o

[...]

Quoted 2 lines

3) use some smart trick in Makefile so that we include those two files only if CONFIG_IDE is 'y' or 'm'. (How?)

obj-$(CONFIG_IDE_MODULE)

This does not work. Apparently, CONFIG_IDE_MODULE is not created for makefile part.

Quoted 9 lines
Quoted 4 lines

Indeed -- my fault. Variables such as $(CONFIG_IDE) are four-state and for the module case they are simply set to "m". But then you can use "ifeq ($(CONFIG_IDE),m)". Another approach is to invent an additional variable automatically set to "y" whenever CONFIG_IDE is enabled.

obj-$(subst m,y,$(CONFIG_IDE)) += ide-std.o ide-no.o

ide-std.o ide-no.o are built in if CONFIG_IDE is m or y.

This is the most clean solution so far. Anybody would object this change?

See the attached patch.

Jun

arch/mips/lib/Makefile renamed from arch/mips/lib/Makefile.orig +1 -1
diff -Nru linux/arch/mips/lib/Makefile.orig linux/arch/mips/lib/Makefile
@@ -18,7 +18,7 @@
 endif
 
 obj-$(CONFIG_BLK_DEV_FD)	+= floppy-no.o floppy-std.o
-obj-$(CONFIG_IDE)		+= ide-std.o ide-no.o
+obj-$(subst m,y,$(CONFIG_IDE))	+= ide-std.o ide-no.o
 obj-$(CONFIG_PC_KEYB)		+= kbd-std.o kbd-no.o
 
 include $(TOPDIR)/Rules.make
arch/mips64/lib/Makefile renamed from arch/mips64/lib/Makefile.orig +1 -1
diff -Nru linux/arch/mips64/lib/Makefile.orig linux/arch/mips64/lib/Makefile
@@ -11,7 +11,7 @@
 	  strnlen_user.o watch.o
 
 obj-$(CONFIG_BLK_DEV_FD)	+= floppy-no.o floppy-std.o
-obj-$(CONFIG_IDE)		+= ide-std.o ide-no.o
+obj-$(subst m,y,$(CONFIG_IDE))	+= ide-std.o ide-no.o
 obj-$(CONFIG_PC_KEYB)		+= kbd-std.o kbd-no.o
 
 include $(TOPDIR)/Rules.make
#6 lore raw
Quoted 7 lines · Jun Sun
Quoted 1 line · Keith Owens

obj-$(subst m,y,$(CONFIG_IDE)) += ide-std.o ide-no.o

This is the most clean solution so far. Anybody would object this change?

See the attached patch.

Add a comment to the end of the line, any nonstandard build entries should have comments :)

obj-$(subst m,y,$(CONFIG_IDE)) += ide-std.o ide-no.o # must be builtin if ide is builtin or a module