This ensures that the __Fortran_builtins module is always used
as an intrinsic module by __Fortran_type_info, which avoids issues
when, for instance, the intrinsic modules dir is present in the
include paths.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Make sure that everything builds with this change even with completely clean build and install directories. The use of "intrinsic" in USE statements in intrinsic modules is problematic when building intrinsic modules, since they depend on intrinsic modules that haven't been built and installed yet.
Everything built fine, even after removing build and install directories.
I guess it's because __fortran_builtins.mod is set as a dependency of __fortran_type_info in flang/tools/f18/CMakeLists.txt.
How does semantics find the module fortran_builtins.mod as an intrinsic module while building fortran_type_info, when there are no intrinsic modules installed anywhere yet?
I haven't debugged semantics to confirm it, but it seems __fortran_builtins.mod is found because of the -module-dir flag. This is the command line used to build __fortran_type_info:
/home/leandro.lupori/git/flang-luporl/buildr/bin/flang-new -cpp -fsyntax-only -module-dir /home/leandro.lupori/git/flang-luporl/buildr/include/flang /home/leandro.lupori/git/flang-luporl/llvm-project/flang/module/__fortran_type_info.f90