kernel/hpt*: Mangle names of foreign binary objects.
authorzrj <rimvydas.jasinskas@gmail.com>
Mon, 28 May 2018 14:51:38 +0000 (17:51 +0300)
committerzrj <zrj@dragonflybsd.org>
Tue, 29 May 2018 07:07:39 +0000 (10:07 +0300)
We already do it for the firmware objects (.fwo). Explictly handle
unpacked precompiled objects to separate them from other generic ones.
These are not device firmware and they do run on CPU, also they have
different osabi tag, so without adjustment the ld.gold (default ld)
will change osabi for the whole linked object.
Having them seprated from the rest simplifies the depend logic, such
objects have no source or headers dependencies other than hardcoded
one in Makefiles. Add missing dependencies on .uu in kernel modules.

sys/dev/raid/hpt27xx/Makefile
sys/dev/raid/hptmv/Makefile
sys/dev/raid/hptrr/Makefile
sys/platform/pc64/conf/files

index 33f1345..bafc987 100644 (file)
@@ -4,10 +4,12 @@ KMOD= hpt27xx
 SRCS=  bus_if.h device_if.h pci_if.h
 SRCS+= opt_cam.h opt_scsi.h
 SRCS+= hpt27xx_os_bsd.c hpt27xx_osm_bsd.c hpt27xx_config.c
-OBJS+= hpt27xx_lib.o
+OBJS+= hpt27xx_lib.bo
 
-hpt27xx_lib.o:
-       uudecode -p < ${.CURDIR}/$(MACHINE_ARCH)-elf.hpt27xx_lib.o.uu > ${.TARGET}
+hpt27xx_lib.bo:        $(MACHINE_ARCH)-elf.hpt27xx_lib.o.uu
+       uudecode -o ${.TARGET} < ${.ALLSRC}
        elfedit --output-osabi none ${.TARGET}
 
+CLEANFILES+= hpt27xx_lib.bo
+
 .include <bsd.kmod.mk>
index 728beea..dc5e789 100644 (file)
@@ -8,12 +8,14 @@ KMOD= hptmv
 SRCS= opt_scsi.h opt_cam.h
 SRCS+= bus_if.h device_if.h pci_if.h
 SRCS+= mv.c entry.c ioctl.c hptproc.c gui_lib.c
-OBJS+= hptmvraid.o
+OBJS+= hptmvraid.bo
 
-hptmvraid.o:
-       uudecode -p < ${.CURDIR}/$(MACHINE_ARCH)-elf.raid.o.uu > ${.TARGET}
+hptmvraid.bo:  $(MACHINE_ARCH)-elf.raid.o.uu
+       uudecode -o ${.TARGET} < ${.ALLSRC}
        elfedit --output-osabi none ${.TARGET}
 
+CLEANFILES+= hptmvraid.bo
+
 #
 # Debug Options:
 #
index 44f3c69..7924a62 100644 (file)
@@ -4,10 +4,12 @@
 KMOD = hptrr
 SRCS = opt_scsi.h opt_cam.h bus_if.h device_if.h pci_if.h os_bsd.h
 SRCS+= hptrr_os_bsd.c hptrr_osm_bsd.c hptrr_config.c
-OBJS = hptrr_lib.o
+OBJS = hptrr_lib.bo
 
-hptrr_lib.o:
-       uudecode -p < ${.CURDIR}/$(MACHINE_ARCH)-elf.hptrr_lib.o.uu > ${.TARGET}
+hptrr_lib.bo:  $(MACHINE_ARCH)-elf.hptrr_lib.o.uu
+       uudecode -o ${.TARGET} < ${.ALLSRC}
        elfedit --output-osabi none ${.TARGET}
 
+CLEANFILES+= hptrr_lib.bo
+
 .include <bsd.kmod.mk>
index f7b6114..a44de54 100644 (file)
@@ -16,20 +16,23 @@ ukbdmap.h                   optional        ukbd_dflt_keymap        \
        no-obj no-implicit-rule before-depend                           \
        clean           "ukbdmap.h"
 #
-hpt27xx_lib.                 optional        hpt27xx                 \
+hpt27xx_lib.bo                 optional        hpt27xx                 \
        dependency      "$S/dev/raid/hpt27xx/x86_64-elf.hpt27xx_lib.o.uu" \
-       compile-with    "uudecode < $S/dev/raid/hpt27xx/x86_64-elf.hpt27xx_lib.o.uu; elfedit --output-osabi none ${.TARGET}" \
-       no-implicit-rule
+       compile-with    "uudecode -o ${.TARGET} < $S/dev/raid/hpt27xx/x86_64-elf.hpt27xx_lib.o.uu; elfedit --output-osabi none ${.TARGET}" \
+       no-implicit-rule                                                \
+       clean           "hpt27xx_lib.bo"
 #
-hptmvraid.                   optional        hptmv                   \
+hptmvraid.bo                   optional        hptmv                   \
        dependency      "$S/dev/raid/hptmv/x86_64-elf.raid.o.uu"        \
-       compile-with    "uudecode < $S/dev/raid/hptmv/x86_64-elf.raid.o.uu; elfedit --output-osabi none ${.TARGET}" \
-       no-implicit-rule
+       compile-with    "uudecode -o ${.TARGET} < $S/dev/raid/hptmv/x86_64-elf.raid.o.uu; elfedit --output-osabi none ${.TARGET}" \
+       no-implicit-rule                                                \
+       clean           "hptmvraid.bo"
 #
-hptrr_lib.                   optional        hptrr                   \
+hptrr_lib.bo                   optional        hptrr                   \
        dependency      "$S/dev/raid/hptrr/x86_64-elf.hptrr_lib.o.uu"   \
-       compile-with    "uudecode < $S/dev/raid/hptrr/x86_64-elf.hptrr_lib.o.uu; elfedit --output-osabi none ${.TARGET}" \
-       no-implicit-rule
+       compile-with    "uudecode -o ${.TARGET} < $S/dev/raid/hptrr/x86_64-elf.hptrr_lib.o.uu; elfedit --output-osabi none ${.TARGET}" \
+       no-implicit-rule                                                \
+       clean           "hptrr_lib.bo"
 #
 emulation/ndis/kern_ndis.c     optional        ndisapi pci
 emulation/ndis/kern_windrv.c   optional        ndisapi pci