Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Oct 2017 07:58:39 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 223180] Bug in kmod.mk when SRCS is empty/not defined
Message-ID:  <bug-223180-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223180

            Bug ID: 223180
           Summary: Bug in kmod.mk when SRCS is empty/not defined
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: conf
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: johalun0@gmail.com

I discovered a bug/flaw in kmod.mk when building a kernel module where I do=
 not
have any c source files. Objects files are built using Rust and specified in
OBJS variable.

If SRCS is empty/not defined these lines

# Conditionally include SRCS based on kernel config options.
.for _o in ${KERN_OPTS}
SRCS+=3D${SRCS.${_o}}
.endfor

generate an entry in SRCS with one space: SRCS=3D" "

Causing this line to add a " .o" to OBJS.=20

OBJS+=3D  ${SRCS:N*.h:R:S/$/.o/g}

Which of course cause the make command to fail since there is no ".o" file.

By replacing it with these lines I could temporary fix the problem.

.for _o in ${SRCS}
OBJS+=3D${_o:R:S/$/.o/g}
.endfor

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223180-8>