[PATCH] attempt for multiple linking the same file

From: Andrzej Krzysztofowicz (ankry@green.mif.pg.gda.pl)
Date: Wed Aug 02 2000 - 04:00:30 EST


Hi,
    The following patch fixes attemmpts to link some files (common for more
than one driver) multiple into kernel. This situation happens if a few
drivers using the same common file (eg. 8390.o) are compiled into kernel.

The patch filters out multiple occurence of these files in the link list.

Regards
   Andrzej

diff -u --recursive linux-2.4test/drivers/net/Makefile linux/drivers/net/Makefile
--- linux-2.4test/drivers/net/Makefile Wed Jul 12 20:20:29 2000
+++ linux/drivers/net/Makefile Mon Jul 17 23:46:17 2000
@@ -29,6 +29,8 @@
 export-objs := 8390.o arlan.o aironet4500_core.o aironet4500_card.o ppp_async.o \
                         ppp_generic.o slhc.o pppox.o
 
+list-common := 7990.o 8390.o slhc.o aironet4500_core.o
+
 ifeq ($(CONFIG_PCMCIA),y)
   SUB_DIRS += pcmcia
   MOD_IN_SUB_DIRS += pcmcia
@@ -279,6 +281,10 @@
 # HIPPI adapters
 #
 
+# Remove duplicates
+
+common-y := $(filter $(obj-y), $(list-common))
+obj-y := $(filter-out $(common-y), $(obj-y)) $(common-y)
 
 # Extract lists of the multi-part drivers.
 # The 'int-*' lists are the intermediate files used to build the multi's.
diff -u --recursive linux-2.4test/drivers/sound/Makefile linux/drivers/sound/Makefile
--- linux-2.4test/drivers/sound/Makefile Fri Jul 14 21:25:48 2000
+++ linux/drivers/sound/Makefile Mon Jul 17 23:54:06 2000
@@ -20,7 +20,7 @@
                     sound_core.o sound_syms.o uart401.o \
                     nm256_audio.o ac97.o ac97_codec.o
 
-
+list-common := ad1848.o mpu401.o uart401.o sb_lib.o opl3.o ac97_codec.o
 
 # Object file lists.
 
@@ -122,6 +122,11 @@
 vidc_mod-objs := vidc.o vidc_fill.o
 wavefront-objs := wavfront.o wf_midi.o yss225.o
 
+
+# Remove duplicates
+
+common-y := $(filter $(obj-y), $(list-common))
+obj-y := $(filter-out $(common-y), $(obj-y)) $(common-y)
 
 # Extract lists of the multi-part drivers.
 # The 'int-*' lists are the intermediate files used to build the multi's.

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  tel.  (0-58) 347 14 61
Wydz.Fizyki Technicznej i Matematyki Stosowanej Politechniki Gdanskiej

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



This archive was generated by hypermail 2b29 : Mon Aug 07 2000 - 21:00:08 EST