Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Dec 2024 23:20:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 283273] bin/csh: tc.const.h depends on host, not target, headers
Message-ID:  <bug-283273-227@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 283273
           Summary: bin/csh: tc.const.h depends on host, not target,
                    headers
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: emaste@freebsd.org

On my laptop I have WIP that has TIOCSTI removed. tcsh supports this (with
`#ifdef TIOCSTI` in its source). However, buildworld failed in tcsh:

.../contrib/tcsh/sh.set.c:761:15: error: use of undeclared identifier
'STRfilec'
  761 |     if (adrof(STRfilec) =3D=3D 0)
      |               ^

tc.const.h is generated via (bin/csh/Makefile):

tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
${BUILD_TOOLS_META}
        @rm -f ${.TARGET}
        @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
        @echo '#ifndef _h_tc_const' >> ${.TARGET}
        @echo '#define _h_tc_const' >> ${.TARGET}
        ${CC:N${CCACHE_BIN}} -E ${CFLAGS:C/-DHAVE_ICONV//} ${.ALLSRC}
-D_h_tc_const | \
            grep 'Char STR' | \
            sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
            sort >> ${.TARGET}
        @echo '#endif /* _h_tc_const */' >> ${.TARGET}

This uses the host's headers which in my case do not define TIOCSTI, and as=
 a
result there's no definition for STRfilec (comparing stock build on
ref14-amd64.freebsd with one on my machine):

$ diff -purw bin/csh/ref-obj/ bin/csh/obj/ | egrep -v 'Only in|Binary files'
diff -purw bin/csh/ref-obj/tc.const.h bin/csh/obj/tc.const.h
--- bin/csh/ref-obj/tc.const.h  2024-12-11 17:17:29.000000000 -0500
+++ bin/csh/obj/tc.const.h      2024-12-11 18:13:33.439537000 -0500
@@ -122,7 +122,6 @@ extern Char STRfignore[];
 extern Char STRfakecom1[];
 extern Char STRfakecom[];
 extern Char STRfignore[];
-extern Char STRfilec[];
 extern Char STRgid[];
 extern Char STRglobdot[];
 extern Char STRglobstar[];

--=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-283273-227>