[Chapel Merge] dlopen: Add C++ "script" to populate the contents of a `chpl_rt_prginfo`

Branch: refs/heads/main
Revision: ed33d7db8f4a3fe4f19d6f0b320acf4e21d04f3c
Author: dlongnecke-cray
Link: dlopen: Add C++ "script" to populate the contents of a `chpl_rt_prginfo` by dlongnecke-cray · Pull Request #28724 · chapel-lang/chapel · GitHub
Log Message:
dlopen: Add C++ "script" to populate the contents of a chpl_rt_prginfo (#28724)

This PR introduces a script that generates an internal Chapel module.
The module contains a function that populates the contents of a
chpl_rt_prginfo.

The script is a C++ program that is built and run as part of the make modules step. This PR also introduces two new procedures in
ChapelDynamicLoading.chpl and renames an existing export procedure.
These procedures are needed to populate program data entries.

Currently, the generated module does not vary based on the Chapel
config, so it is always dumped in $CHPL_HOME/modules/internal/gen.

This PR also adjusts the declaration of several constant arrays created
at codegen-time under the C backend. It adjusts their declarations in
both the compiler and the runtime in order to make them consistent and
to reduce grief caused by nested const qualifiers.

It also moves some declarations for compiler-created symbols out of the
runtime header chpl-comm.h and into chplcgfns.h which was made to
contain such symbols. This header will be removed soon, but adjusting it
makes it a bit easier for me to keep track of things.

TESTING

  • standard
  • COMM=gasnet
  • CHPL_LLVM=none, COMPILER=gnu

Reviewed by @jabraham17. Thanks!

Compare: Comparing 28dc9fd69aa8331a93a464c1ae5be17f7774c214...7217e7ecc7b0bd9a9248940ed967eb35acbff0ba · chapel-lang/chapel · GitHub

Diff:
M compiler/codegen/codegen.cpp
M compiler/passes/parseAndConvert.cpp
M frontend/lib/parsing/parsing-queries.cpp
M modules/Makefile
M modules/internal/ChapelDynamicLoading.chpl
M modules/internal/ChapelProgramRegistration.chpl
M runtime/include/chpl-comm.h
M runtime/include/chpl-prginfo-data-macro.h
M runtime/include/chpl-prginfo.h
M runtime/include/chplcgfns.h
M runtime/src/chpl-comm.c
M test/compflags/ferguson/print-module-resolution.good
M test/dynamic-loading/CodegenTimeArrays.chpl
M test/modules/sungeun/init/printModuleInitOrder.good
A util/config/gen-set-program-data-module.cpp
https://github.com/chapel-lang/chapel/pull/28724.diff