Page MenuHomeFreeBSD

Stop building assym.o in modules
ClosedPublic

Authored by andrew on Mar 17 2017, 11:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 2, 3:17 AM
Unknown Object (File)
Jan 9 2024, 5:46 AM
Unknown Object (File)
Dec 20 2023, 1:33 AM
Unknown Object (File)
Dec 12 2023, 2:07 AM
Unknown Object (File)
Nov 18 2023, 12:15 AM
Unknown Object (File)
Nov 10 2023, 9:10 AM
Unknown Object (File)
Nov 7 2023, 11:19 AM
Unknown Object (File)
Nov 4 2023, 10:42 PM
Subscribers

Details

Summary

DTrace includes assym.s, to build this we build assym.o, however
this is unneeded as assym.s only contains macros.

Remove the need to build this by removing it from OBJS, but keep assym.s
in the module dependencies.

This fixes the build when there is no assembler, e.g. on arm64 without
the external binutils.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I'm not fond of the kmod.mk changes, they are a bit obscure longterm. This seems to work and is cleaner:

diff --git sys/conf/kmod.mk sys/conf/kmod.mk
index 3402345aa11a..d2418224dc72 100644
--- sys/conf/kmod.mk
+++ sys/conf/kmod.mk
@@ -451,7 +451,7 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirk
 	${AWK} -f ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks
 .endif
 
-.if !empty(SRCS:Massym.s)
+.if !empty(SRCS:Massym.s) || !empty(DPSRCS:Massym.s)
 CLEANFILES+=	assym.s genassym.o
 assym.s: genassym.o
 .if defined(KERNBUILDDIR)
diff --git sys/modules/dtrace/dtrace/Makefile sys/modules/dtrace/dtrace/Makefile
index 40a0e6d08b26..162d5053dcd8 100644
--- sys/modules/dtrace/dtrace/Makefile
+++ sys/modules/dtrace/dtrace/Makefile
@@ -27,7 +27,7 @@ CFLAGS+=	-I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \
 SRCS+=		bus_if.h device_if.h vnode_if.h
 
 # Needed for dtrace_asm.S
-SRCS+=		assym.s
+DPSRCS+=		assym.s
 
 # These are needed for assym.s
 SRCS+=		opt_compat.h opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
@@ -55,20 +55,6 @@ EXPORT_SYMS=	dtrace_register \
 
 dtrace_asm.o:  assym.s
 
-.if ${MACHINE_CPUARCH} == "arm"
-assym.o: assym.s
-	${AS} -meabi=5 -o assym.o assym.s
-.endif
-
-.if ${MACHINE_CPUARCH} == "riscv"
-assym.o: assym.s
-.if ${TARGET_ARCH:Mriscv*sf}
-	${AS} -mfloat-abi=soft -o assym.o assym.s
-.else
-	${AS} -mfloat-abi=double -o assym.o assym.s
-.endif
-.endif
-
 .include <bsd.kmod.mk>
 
 CFLAGS+=	-include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h

Although I do see you're right that there's no reason to ever build assym.o or link it in. Hmm...

Once upon a time this was needed to create the assym.h file that encoded all the struct sizes and offsets the .S files used. No clue why it is here though....

@bdrewery Can you commit your change. It works for me building for arm64 with no external binutils.

This revision was automatically updated to reflect the committed changes.