2002-12-10 11:39:13

by John Bradford

[permalink] [raw]
Subject: 2.5.51 breaks ALSA AWE32

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


2002-12-10 20:46:36

by Sam Ravnborg

[permalink] [raw]
Subject: Re: 2.5.51 breaks ALSA AWE32

On Tue, Dec 10, 2002 at 11:58:28AM +0000, John Bradford wrote:
> 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 =====
--- 1.4/sound/synth/emux/Makefile Tue Jun 18 11:16:20 2002
+++ edited/Makefile Tue Dec 10 21:49:49 2002
@@ -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

2002-12-11 13:31:40

by John Bradford

[permalink] [raw]
Subject: Re: 2.5.51 breaks ALSA AWE32

> > 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.

Same error I'm afraid :-/

John.

2002-12-12 19:45:23

by Sam Ravnborg

[permalink] [raw]
Subject: Re: 2.5.51 breaks ALSA AWE32

On ons, dec 11, 2002 at 01:47:00 +0000, John Bradford wrote:
> > 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 =====
--- 1.4/sound/synth/emux/Makefile Tue Jun 18 11:16:20 2002
+++ edited/sound/synth/emux/Makefile Thu Dec 12 20:38:42 2002
@@ -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

2002-12-12 20:18:49

by Kai Germaschewski

[permalink] [raw]
Subject: Re: 2.5.51 breaks ALSA AWE32

On Thu, 12 Dec 2002, Sam Ravnborg wrote:

> 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 =====
--- 1.8/sound/synth/Makefile Mon Jun 10 19:49:43 2002
+++ edited/sound/synth/Makefile Thu Dec 12 14:16:02 2002
@@ -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 =====
--- 1.8/sound/synth/Makefile Mon Jun 10 19:49:43 2002
+++ edited/sound/synth/Makefile Thu Dec 12 14:20:47 2002
@@ -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 =====
--- 1.4/sound/synth/emux/Makefile Tue Jun 18 04:16:20 2002
+++ edited/sound/synth/emux/Makefile Thu Dec 12 14:20:08 2002
@@ -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


2002-12-12 20:47:44

by Kai Germaschewski

[permalink] [raw]
Subject: Re: 2.5.51 breaks ALSA AWE32

On Thu, 12 Dec 2002, Sam Ravnborg wrote:

> One detail when looking at the patch:
>
> > ===== sound/synth/emux/Makefile 1.4 vs edited =====
> > --- 1.4/sound/synth/emux/Makefile Tue Jun 18 04:16:20 2002
> > +++ edited/sound/synth/emux/Makefile Thu Dec 12 14:20:08 2002
> > @@ -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
>
> 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


2002-12-12 20:44:42

by Sam Ravnborg

[permalink] [raw]
Subject: Re: 2.5.51 breaks ALSA AWE32

On tor, dec 12, 2002 at 02:26:26 -0600, Kai Germaschewski wrote:
> > 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:

> ===== sound/synth/emux/Makefile 1.4 vs edited =====
> --- 1.4/sound/synth/emux/Makefile Tue Jun 18 04:16:20 2002
> +++ edited/sound/synth/emux/Makefile Thu Dec 12 14:20:08 2002
> @@ -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

snd-emux-synth-objs := $(snd-emux-synth-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
> +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
>

2002-12-12 21:25:36

by Sam Ravnborg

[permalink] [raw]
Subject: Re: 2.5.51 breaks ALSA AWE32

On tor, dec 12, 2002 at 02:55:28 -0600, Kai Germaschewski wrote:
> 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.

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

I will take a look some day.

Sam