Skip to content

[Flang] Switch flang-rt build to runtimes-based build #1392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: aomp-dev
Choose a base branch
from

Conversation

mjklemm
Copy link
Contributor

@mjklemm mjklemm commented Apr 23, 2025

This PR switches the build system from the in-tree build of the Fortran runtime to the new runtimes-style build.

@mjklemm mjklemm self-assigned this Apr 23, 2025
@mjklemm mjklemm requested a review from gregrodgers as a code owner April 23, 2025 19:02
Copy link
Contributor

@dpalermo dpalermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also seeing a build failure that Michael worked around by setting LD_LIBRARY_PATH. Looks like comgr ASAN build can no longer locate libcalgn_rt.asan-x86_64.so:

./bc2h: error while loading shared libraries: libclang_rt.asan-x86_64.so: cannot open shared object file: No such file or directory
make[2]: *** [CMakeFiles/oclc_abi_version_400_header.dir/build.make:75: include/oclc_abi_version_400.inc] Error 127
...
 !!!  build_aomp.sh: BUILD FAILED FOR COMPONENT comgr !!!
###     status: 1, allstat: 1
[r14 /work1/omp-nightly/build/git]$ ldd ./aomp21.0/build/comgr/asan/bc2h
        linux-vdso.so.1 (0x00007fffb19dd000)
        libclang_rt.asan-x86_64.so => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6a3d800000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6a3dbed000)

Even though it is in the same location is was before this change:

Build with this change:

[r14 /work1/omp-nightly/build/rocm]$ ll ./aomp_21.0-1/lib/llvm/lib/clang/21/lib/linux/libclang_rt.asan-x86_64.so
3160 -rw-r--r-- 1 dpalermo dpalermo 3231896 Apr 23 14:22 ./aomp_21.0-1/lib/llvm/lib/clang/21/lib/linux/libclang_rt.asan-x86_64.so

Previous build that worked fine:

[r14 /work1/omp-nightly/build/rocm-s0]$ ll ./aomp_21.0-1/lib/llvm/lib/clang/21/lib/linux/libclang_rt.asan-x86_64.so
3160 -rw-r--r-- 1 dpalermo dpalermo 3231896 Apr 23 12:19 ./aomp_21.0-1/lib/llvm/lib/clang/21/lib/linux/libclang_rt.asan-x86_64.so

@dpalermo
Copy link
Contributor

Also note that there isn't a libclang_rt dependency in comgr/bc2h, just the comgr/asan/bc2h:

[r14 /work1/omp-nightly/build/git]$ ldd aomp21.0/build/comgr/bc2h
        linux-vdso.so.1 (0x00007ffc55733000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb969c00000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb96a011000)

@dpalermo
Copy link
Contributor

Some logic in the comgr cmake looks like it breaks when flang-rt is added to LLVM_RUNTIMES.

@mjklemm
Copy link
Contributor Author

mjklemm commented Apr 24, 2025

Hm. I'm unsure how to fix that one. Help will be greatly appreciated!

@dpalermo dpalermo requested a review from ampandey-AMD April 24, 2025 18:17
@dpalermo
Copy link
Contributor

Same problem occurs even if compiler-rt is listed last (figured it was worth a try ;-)

LLVM_RUNTIMES="libcxx;libcxxabi;libunwind;openmp;offload;flang-rt;compiler-rt"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants