magic/extflat
Darryl L. Miles b3d6540f13 build: isolate build-info defines into utils/buildinfo.c (ccache-friendly)
MAGIC_VERSION / MAGIC_REVISION / MAGIC_COMMIT / MAGIC_BUILDDATE were on the
global DFLAGS, so every object's compile command line carried them.  Because
the command line is part of ccache/sccache's hash key and MAGIC_BUILDDATE
changes every second, that meant a cache miss on every unit on every build;
it also smeared the baked-in date/commit across "whenever each file last
recompiled".

Move the four values into a single translation unit:
  * utils/magic_buildinfo.h -- extern MagicVersion/MagicRevision/MagicCommit/
    MagicCompileTime (MagicCommit is new; the other three moved here from
    utils/magic.h, which now includes this header).
  * utils/buildinfo.c -- the ONLY unit compiled with the version defines
    (target-specific `buildinfo.o: DFLAGS += ${DFLAGS_MAGICVERSION}` in
    utils/Makefile.in); it defines the four globals.  ${DFLAGS_MAGICVERSION}
    is removed from the global DFLAGS/DFLAGS_NOSTUB.

Consumers updated to read the runtime symbol instead of the compile-time
macro:
  * magicTop.c / tclmagic.c no longer define the globals (the MAGIC_WRAPPER
    duplicate-symbol guard is gone -- buildinfo.o owns them for every variant,
    including WASM, which links both mains).
  * Tcl_PkgProvide/PkgRequire in router/ext2spice/lef/ext2sim/plot/tclmagic
    now pass MagicVersion.
  * extflat: EFVersion (a static-initialized copy of MAGIC_VERSION) is dropped;
    EFread.c compares the .ext version against MagicVersion directly -- the same
    value ExtCell.c already *writes* into .ext files, so read and write are now
    consistent.

Verified: only buildinfo.o carries -DMAGIC_* (hash/DBio/windCmdSZ carry none);
Tcl (375 files) and --without-tcl builds rc=0, version/commit/date embedded in
tclmagic.so, magicTop.o no longer defines MagicVersion; in-tree source clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 14:54:11 -04:00
..
COMPRESS Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00
EFantenna.c First cut of pulling the TT_SIDE bit out of the tile database 2026-01-09 12:05:03 -05:00
EFargs.c build: isolate build-info defines into utils/buildinfo.c (ccache-friendly) 2026-07-26 14:54:11 -04:00
EFbuild.c Corrected an error when merging nodes during "ext2spice". The code 2026-05-29 14:06:50 -04:00
EFdef.c Significant overhaul of the extresist code. The purpose of this 2026-05-28 13:12:13 -04:00
EFerr.c Final work on the first stage of the extresist overhaul. The 2026-01-28 14:31:38 -05:00
EFflat.c Corrected two errors related to extraction: 2026-01-30 16:47:36 -05:00
EFhier.c Additional corrections fix the problem of devices being removed from 2026-06-04 17:45:03 -04:00
EFint.h Significant overhaul of the extresist code. The purpose of this 2026-05-28 13:12:13 -04:00
EFname.c Made another update to go along with the previous commit, that 2026-01-31 13:02:35 -05:00
EFread.c build: isolate build-info defines into utils/buildinfo.c (ccache-friendly) 2026-07-26 14:54:11 -04:00
EFsym.c 38 x warning: suggest parentheses around assignment used as truth value 2024-10-09 21:12:55 -04:00
EFtypes.h codebase-wide: use flexible arrays where appropriate 2026-07-01 12:37:44 -04:00
EFvisit.c Added a new device type "dsubcircuit" which basically behaves like 2025-10-07 16:45:22 -04:00
Makefile.in build: include rules.mak from source, drop the build-top copy 2026-07-26 14:54:11 -04:00
READ_ME Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00
extflat.h build: isolate build-info defines into utils/buildinfo.c (ccache-friendly) 2026-07-26 14:54:11 -04:00
extparse.h Significant overhaul of the extresist code. The purpose of this 2026-05-28 13:12:13 -04:00