Skip to contentSkip to conversation

2.5.51 breaks ALSA AWE32

DISCUSSION John Bradford 3 participants 8 messages Dec 10, 2002 – Dec 12, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

make -f scripts/Makefile.build obj=sound/synth/emux
ld -m elf_i386 -r -o sound/synth/built-in.o sound/synth/emux/built-in.o
ld: cannot open sound/synth/emux/built-in.o: No such file or directory make[2]: *** [sound/synth/built-in.o] Error 1
make[1]: *** [sound/synth] Error 2
make: *** [sound] Error 2

#
# Advanced Linux Sound Architecture
#
CONFIG_SND=y
# CONFIG_SND_SEQUENCER is not set
# CONFIG_SND_OSSEMUL is not set
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set

#
# Generic devices
#
CONFIG_SND_DUMMY=y
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set

#
# ISA devices
#
# CONFIG_SND_AD1848 is not set
# CONFIG_SND_CS4231 is not set
# CONFIG_SND_CS4232 is not set
# CONFIG_SND_CS4236 is not set
# CONFIG_SND_ES1688 is not set
# CONFIG_SND_ES18XX is not set
# CONFIG_SND_GUSCLASSIC is not set
# CONFIG_SND_GUSEXTREME is not set
# CONFIG_SND_GUSMAX is not set
# CONFIG_SND_INTERWAVE is not set
# CONFIG_SND_INTERWAVE_STB is not set
# CONFIG_SND_OPTI92X_AD1848 is not set
# CONFIG_SND_OPTI92X_CS4231 is not set
# CONFIG_SND_OPTI93X is not set
# CONFIG_SND_SB8 is not set
# CONFIG_SND_SB16 is not set
CONFIG_SND_SBAWE=y
# CONFIG_SND_SB16_CSP is not set
# CONFIG_SND_WAVEFRONT is not set
# CONFIG_SND_CMI8330 is not set
# CONFIG_SND_OPL3SA2 is not set
# CONFIG_SND_SGALAXY is not set

John

#1 lore raw
Quoted 6 lines · John Bradford

make -f scripts/Makefile.build obj=sound/synth/emux
ld -m elf_i386 -r -o sound/synth/built-in.o sound/synth/emux/built-in.o
ld: cannot open sound/synth/emux/built-in.o: No such file or directory make[2]: *** [sound/synth/built-in.o] Error 1
make[1]: *** [sound/synth] Error 2
make: *** [sound] Error 2

kbuild in 2.5.51 requires that there exist one variable named obj-* before built-in.o is generated.
In the Makefile for sound/synth/emux the variables obj-* is only set if CONFIG_SND_SEQUENCER is set to y or m.

The best approach may be a derived bool defined in Kconfig, but an alterneative solution is to rearrange the Makefile a bit.

Try the following (untested) patch.

Sam

===== Makefile 1.4 vs edited =====

Makefile renamed from sound/synth/emux/Makefile +6 -9
@@ -5,16 +5,13 @@
 
 export-objs  := emux.o
 
+snd-emux-synth-objs-$(CONFIG_SND_SEQUENCER_OSS) := emux_oss.o
 snd-emux-synth-objs := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
-		       emux_effect.o emux_proc.o soundfont.o
-ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
-  snd-emux-synth-objs += emux_oss.o
-endif
+		       emux_effect.o emux_proc.o soundfont.o \
+		       $(snd-emux-synth-objs-y)
 
 # Toplevel Module Dependency
-ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
-  obj-$(CONFIG_SND_SBAWE) += snd-emux-synth.o
-  obj-$(CONFIG_SND_EMU10K1) += snd-emux-synth.o
-endif
+sequencer-$(CONFIG_SND_SEQUENCER) += snd-emux-synth.o
+obj-$(CONFIG_SND_SBAWE)   := $(sequencer-y) $(sequencer-m)
+obj-$(CONFIG_SND_EMU10K1) += $(sequencer-y) $(sequencer-m)
 
-include $(TOPDIR)/Rules.make
#2 lore raw
Quoted 12 lines
Quoted 6 lines

make -f scripts/Makefile.build obj=sound/synth/emux
ld -m elf_i386 -r -o sound/synth/built-in.o sound/synth/emux/built-in.o
ld: cannot open sound/synth/emux/built-in.o: No such file or directory make[2]: *** [sound/synth/built-in.o] Error 1
make[1]: *** [sound/synth] Error 2
make: *** [sound] Error 2

kbuild in 2.5.51 requires that there exist one variable named obj-* before built-in.o is generated.
In the Makefile for sound/synth/emux the variables obj-* is only set if CONFIG_SND_SEQUENCER is set to y or m.

Quoted 4 lines

The best approach may be a derived bool defined in Kconfig, but an alterneative solution is to rearrange the Makefile a bit.

Try the following (untested) patch.

Same error I'm afraid :-/

John.

#3 lore raw
Quoted 11 lines · John Bradford
Quoted 9 lines

kbuild in 2.5.51 requires that there exist one variable named obj-* before built-in.o is generated.
In the Makefile for sound/synth/emux the variables obj-* is only set if CONFIG_SND_SEQUENCER is set to y or m.

The best approach may be a derived bool defined in Kconfig, but an alterneative solution is to rearrange the Makefile a bit.

Try the following (untested) patch.

Same error I'm afraid :-/

Yep, sorry.
kbuild check if any obj-* value has been assigned a value, so an empty assignment does not help.

I have made a patch that works this time.

Kai, any ideas how to do this in a better way?
- I have considered a derived symbol in sound/isa/Kconfig, something like:
bool SND_EMUX_SYNTH
depends on SND && SND_SEQUENCER && SND_SBAWE

and then in the Makefile:
obj-$(CONFIG_SND_EMUX_SYNTH) := snd-emux-synth.o

That would make the Makefile trivial, but sound/ did not use any derived symbols in the Kconfig file, so I did not test this approach.

I'm prepared to clean up all sound/ makefiles if this approach is considered better than what is used today.

Sam

===== sound/synth/emux/Makefile 1.4 vs edited =====

sound/synth/emux/Makefile +6 -9
@@ -5,16 +5,13 @@
 
 export-objs  := emux.o
 
+snd-emux-synth-objs-$(CONFIG_SND_SEQUENCER_OSS) := emux_oss.o
 snd-emux-synth-objs := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
-		       emux_effect.o emux_proc.o soundfont.o
-ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
-  snd-emux-synth-objs += emux_oss.o
-endif
+		       emux_effect.o emux_proc.o soundfont.o \
+		       $(snd-emux-synth-objs-y)
 
 # Toplevel Module Dependency
-ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
-  obj-$(CONFIG_SND_SBAWE) += snd-emux-synth.o
-  obj-$(CONFIG_SND_EMU10K1) += snd-emux-synth.o
-endif
+seq := $(filter m y,$(CONFIG_SND_SEQUENCER))
+obj-$(if $(seq),$(CONFIG_SND_SBAWE))   += snd-emux-synth.o
+obj-$(if $(seq),$(CONFIG_SND_EMU10K1)) += snd-emux-synth.o
 
-include $(TOPDIR)/Rules.make
#4 lore raw
Quoted 6 lines · Sam Ravnborg

kbuild check if any obj-* value has been assigned a value, so an empty assignment does not help.

I have made a patch that works this time.

Kai, any ideas how to do this in a better way?

The minimal fix I can think of would be

===== sound/synth/Makefile 1.8 vs edited =====

sound/synth/Makefile +1 -1
@@ -14,6 +14,6 @@
   obj-$(CONFIG_SND_SBAWE) += snd-util-mem.o
 endif
 
-obj-$(CONFIG_SND) += emux/
+obj-$(CONFIG_SND_SEQUENCER) += emux/
 
 include $(TOPDIR)/Rules.make

While we're at it, a bit of cleaning up shouldn't hurt, though, so the complete suggested patch would be

===== sound/synth/Makefile 1.8 vs edited =====

sound/synth/Makefile +2 -2
@@ -10,10 +10,10 @@
 # Toplevel Module Dependency
 obj-$(CONFIG_SND_EMU10K1) += snd-util-mem.o
 obj-$(CONFIG_SND_TRIDENT) += snd-util-mem.o
-ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
+ifdef CONFIG_SND_SEQUENCER
   obj-$(CONFIG_SND_SBAWE) += snd-util-mem.o
 endif
 
-obj-$(CONFIG_SND) += emux/
+obj-$(CONFIG_SND_SEQUENCER) += emux/
 
 include $(TOPDIR)/Rules.make

===== sound/synth/emux/Makefile 1.4 vs edited =====

sound/synth/emux/Makefile +5 -10
@@ -5,16 +5,11 @@
 
 export-objs  := emux.o
 
-snd-emux-synth-objs := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
-		       emux_effect.o emux_proc.o soundfont.o
-ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
-  snd-emux-synth-objs += emux_oss.o
-endif
+snd-emux-synth-y := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
+		    emux_effect.o emux_proc.o soundfont.o
+snd-emux-synth-$(CONFIG_SND_SEQUENCER_OSS) += emux_oss.o
 
-# Toplevel Module Dependency
-ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
-  obj-$(CONFIG_SND_SBAWE) += snd-emux-synth.o
-  obj-$(CONFIG_SND_EMU10K1) += snd-emux-synth.o
-endif
+obj-$(CONFIG_SND_SBAWE) += snd-emux-synth.o
+obj-$(CONFIG_SND_EMU10K1) += snd-emux-synth.o
 
 include $(TOPDIR)/Rules.make

However, synth/Makefile still has the ugly ifdef in there, which wouldn't be necessary if we entered synth/ just when CONFIG_SND_SEQUENCER is set. It looks like more generic routines are in synth/ (util-mem), though, which IMO shouldn't be there, but rather in some lib/ or whatever dir. So there's the opportunity for further cleanup, but I'll leave that to the ALSA people. Anybody care for testing the second patch above?

--Kai

#5 lore raw
Quoted 3 lines · Kai Germaschewski
Quoted 1 line

Kai, any ideas how to do this in a better way?

The minimal fix I can think of would be

Looks good - thanks.

One detail when looking at the patch:

Quoted 5 lines

===== sound/synth/emux/Makefile 1.4 vs edited =====

sound/synth/emux/Makefile +0 -0
@@ -5,16 +5,11 @@
 

sound/synth/emux/Makefile line 10

Quoted 10 lines
sound/synth/emux/Makefile +3 -5
 export-objs  := emux.o
 
-snd-emux-synth-objs := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
-		       emux_effect.o emux_proc.o soundfont.o
-ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
-  snd-emux-synth-objs += emux_oss.o
-endif
+snd-emux-synth-y := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
+		    emux_effect.o emux_proc.o soundfont.o
+snd-emux-synth-$(CONFIG_SND_SEQUENCER_OSS) += emux_oss.o

snd-emux-synth-objs := $(snd-emux-synth-y)

Quoted 20 lines
sound/synth/emux/Makefile +2 -5
-# Toplevel Module Dependency
-ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
-  obj-$(CONFIG_SND_SBAWE) += snd-emux-synth.o
-  obj-$(CONFIG_SND_EMU10K1) += snd-emux-synth.o
-endif
+obj-$(CONFIG_SND_SBAWE) += snd-emux-synth.o
+obj-$(CONFIG_SND_EMU10K1) += snd-emux-synth.o
 
 include $(TOPDIR)/Rules.make
 

However, synth/Makefile still has the ugly ifdef in there, which wouldn't be necessary if we entered synth/ just when CONFIG_SND_SEQUENCER is set. It looks like more generic routines are in synth/ (util-mem), though, which IMO shouldn't be there, but rather in some lib/ or whatever dir. So there's the opportunity for further cleanup, but I'll leave that to the ALSA people. Anybody care for testing the second patch above?

--Kai

#6 lore raw
Quoted 9 lines · Sam Ravnborg

One detail when looking at the patch:

Quoted 7 lines

===== sound/synth/emux/Makefile 1.4 vs edited =====

sound/synth/emux/Makefile +0 -0
@@ -5,16 +5,11 @@
 
 export-objs  := emux.o
 
Quoted 10 lines

sound/synth/emux/Makefile line 10

Quoted 8 lines
sound/synth/emux/Makefile +3 -5
-snd-emux-synth-objs := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
-		       emux_effect.o emux_proc.o soundfont.o
-ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
-  snd-emux-synth-objs += emux_oss.o
-endif
+snd-emux-synth-y := emux.o emux_synth.o emux_seq.o emux_nrpn.o \
+		    emux_effect.o emux_proc.o soundfont.o
+snd-emux-synth-$(CONFIG_SND_SEQUENCER_OSS) += emux_oss.o

snd-emux-synth-objs := $(snd-emux-synth-y)

Nope, kbuild does that for you ;)
(And yes, lots of places still do it manually, but it's not necessary anymore).

--Kai

#7 lore raw
Quoted 1 line · Kai Germaschewski

Nope, kbuild does that for you ;)

I recall this - now. Anyway the following fragment teels the full story :-)
cmd_link_multi-y = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^)

In clear text:
For all prerequisite .o files (file.o) where there exist a -objs (file-objs) or a -y (file-y) variable use the value of that variable instead.

Quoted 2 lines

(And yes, lots of places still do it manually, but it's not necessary anymore).

I will take a look some day.

Sam