Re: linux-kernel-digest V1 #4344

Michael Elizabeth Chastain (mec@shout.net)
Tue, 24 Aug 1999 01:36:53 -0500


Thomas Molina reports:

> uart401.o: In function `uart401intr':
> uart401.o(.text+0xa8): multiple definition of `uart401intr'
> uart401.o(.text+0xa8): first defined here
> uart401.o: In function `attach_uart401':
> uart401.o(.text+0x2a4): multiple definition of `attach_uart401'
> uart401.o(.text+0x2a4): first defined here

Shit, I know what this is. The bag is mine.

drivers/sound/Makefile uses my new list-based Makefile techniques.
It used to be a total mess and random combinations of options would
give bad builds. Now it works, but it's weird and different from all
the other Makefiles.

The problem is that I used to use $(sort ...) to remove the duplicates
and also because I like things in sorted order. With the new ELF init
sections, the $(sort ...) has to go, so the sound driver is sticking a
lot of duplicates into the O_OBJS list.

Here's an alternate way to remove the duplicates. I tried it on your
configuration and It Works For Me (TM). It ought to work with everybody's
version of Gnu Make. Can you give it a spin?

Michael Elizabeth Chastain
<mailto:mec@shout.net>
"love without fear"

===

--- linux-2.3.14/Rules.make Mon Aug 2 17:09:47 1999
+++ linux/Rules.make Mon Aug 23 23:27:44 1999
@@ -73,11 +73,11 @@
ALL_O = $(OX_OBJS) $(O_OBJS)
$(O_TARGET): $(ALL_O)
rm -f $@
-ifneq "$(strip $(ALL_O))" ""
- $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(ALL_O)
-else
- $(AR) rcs $@
-endif
+ ifneq "$(strip $(ALL_O))" ""
+ $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(ALL_O), $^)
+ else
+ $(AR) rcs $@ $(filter $(ALL_O), $^)
+ endif
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(ALL_O))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFLAGS) $$(ALL_O))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/