diff --git a/App/lib/Phase/Phase2/__init__.vp b/App/lib/Phase/Phase2/__init__.vp index ca8fd8d..2134031 100644 --- a/App/lib/Phase/Phase2/__init__.vp +++ b/App/lib/Phase/Phase2/__init__.vp @@ -1433,7 +1433,7 @@ def RunMultiFileProject(mb: memhub.MemBuddy*, source_dir: str, temp_dir: str, ou string.strcpy(final_obj_paths, main_obj_path) fop_pos = mlen - # Merge the App non-main modules' .obj (obj_paths, space-separated) compiled by Phase B/B+. + # Merge the App non-main modules' .obj (obj_paths, space-separated) compiled by Phase B/B+. # final_obj_paths must include main_obj + reachable includes + App deps, else linking hits undefined symbols. if obj_pos > 0: if fop_pos + obj_pos + 1 < OBJ_PATHS_SIZE + 512: diff --git a/App/lib/Projectrans/Config.vp b/App/lib/Projectrans/Config.vp index ea5aa7a..ddb47a4 100644 --- a/App/lib/Projectrans/Config.vp +++ b/App/lib/Projectrans/Config.vp @@ -354,19 +354,17 @@ def resolve_paths(project_dir: str) -> int: SourceDir = _join_path(SourceDir, project_dir) BuildDir = _join_path(BuildDir, project_dir) - # TempDir = {BuildDir}/temp (single-track MLIR always appends the _mlir isolation suffix) + # TempDir = {BuildDir}/temp; OutputDir = {BuildDir}/output if BuildDir is not None: bd_len: sizet = string.strlen(BuildDir) - suf_dir: str = mlir_dir_suffix() - suf_dir_len: sizet = string.strlen(suf_dir) - temp_buf: str = _mbuddy.alloc(bd_len + suf_dir_len + 8) + temp_buf: str = _mbuddy.alloc(bd_len + 8) if temp_buf is not None: - viperlib.snprintf(temp_buf, bd_len + suf_dir_len + 8, "%s/temp%s", BuildDir, suf_dir) + viperlib.snprintf(temp_buf, bd_len + 8, "%s/temp", BuildDir) TempDir = temp_buf # OutputDir = {BuildDir}/output - output_buf: str = _mbuddy.alloc(bd_len + suf_dir_len + 8) + output_buf: str = _mbuddy.alloc(bd_len + 8) if output_buf is not None: - viperlib.snprintf(output_buf, bd_len + suf_dir_len + 8, "%s/output%s", BuildDir, suf_dir) + viperlib.snprintf(output_buf, bd_len + 8, "%s/output", BuildDir) OutputDir = output_buf # includes paths may be of the form ../includes, resolved against project_dir. @@ -545,10 +543,13 @@ def get_includes_binary_dir() -> str: return buf -# Directory isolation suffix for single-track MLIR. -# Emitter is always mlirlite, so the suffix is "_mlir": Temp/Output/includes caches live under *_mlir, separate from old LLVM caches. +# Directory isolation suffix for the includes binary cache only. +# TempDir/OutputDir are plain {BuildDir}/temp and {BuildDir}/output (same layout as TPC and as +# the project scripts expect). The includes cache keeps "_mlir": it holds MLIR-era artifacts +# (sha1 subdirectories) while TPC's includes cache at {IncludesDir}.binary/ holds flat +# "..pic.obj" files, so sharing one directory would mix the two layouts. def mlir_dir_suffix() -> str: - """Directory isolation suffix for the MLIR backend (always "_mlir").""" + """Directory isolation suffix for the includes cache of the MLIR backend (always "_mlir").""" return "_mlir"