The branch main has been updated by brooks:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=401d39e38937c130f4aaacc7817fabfaa4aeeee7

commit 401d39e38937c130f4aaacc7817fabfaa4aeeee7
Author:     Brooks Davis <bro...@freebsd.org>
AuthorDate: 2025-08-06 11:28:34 +0000
Commit:     Brooks Davis <bro...@freebsd.org>
CommitDate: 2025-08-06 11:31:24 +0000

    libsys: add a dependency for syscall stubs
    
    Make syscall stubs generated by lib/libsys/Makefile.sys depend on it.
    This will have some false positives, but generating and assembling them
    is fast.  Also add slightly dubious dependencies on compat.h and SYS.h.
    
    While here, fix the comment documenting the assembly origin.
    
    Reviewed by:    kib, emaste
    Differential Revision:  https://reviews.freebsd.org/D51671
---
 lib/libsys/Makefile.sys | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys
index 3eb4bf85153d..7871731dcdcd 100644
--- a/lib/libsys/Makefile.sys
+++ b/lib/libsys/Makefile.sys
@@ -135,15 +135,28 @@ FEATURE_NOTE='\#include 
<sys/elf_common.h>\nGNU_PROPERTY_AARCH64_FEATURE_1_NOTE(
 FEATURE_NOTE=''
 .endif
 
-${SASM}:
-       printf '/* %sgenerated by libc/sys/Makefile.inc */\n' @ > ${.TARGET}
+# Add this file as a dependency of the generated assembly along with
+# the two included files compat.h and SYS.h.  Depending on this Makefile
+# will cause some needless regenerations, but handles both changes in
+# generated assembly and movement between MIASM and PSEUDO/INTERPOSED.
+# The dependency on compat.h and SYS.h should properly be on the
+# <foo>.S-><foo>.o rules, but there are too many .o variants for it to
+# be easy and touching the geneated source files has the same effect in
+# practice.
+__makefile_sys:=       ${.PARSEDIR}/${.PARSEFILE}
+__asm_deps=    ${__makefile_sys} \
+               ${LIBC_SRCTOP}/include/compat.h \
+               ${LIBSYS_SRCTOP}/${LIBC_ARCH}/SYS.h
+
+${SASM}: ${__asm_deps}
+       printf '/* %sgenerated by libsys/Makefile.sys */\n' @ > ${.TARGET}
        printf '#include "compat.h"\n' >> ${.TARGET}
        printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET}
        printf  ${NOTE_GNU_STACK} >>${.TARGET}
        printf  ${FEATURE_NOTE} >> ${.TARGET}
 
-${SPSEUDO}:
-       printf '/* %sgenerated by libc/sys/Makefile.inc */\n' @ > ${.TARGET}
+${SPSEUDO}: ${__asm_deps}
+       printf '/* %sgenerated by libsys/Makefile.sys */\n' @ > ${.TARGET}
        printf '#include "compat.h"\n' >> ${.TARGET}
        printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \
            >> ${.TARGET}

Reply via email to