Skip to content
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

Clang-8/9 hangs when compiling gnu-gsl package with Ofast option targeting arm_32 architecture #60692

Closed
topcue opened this issue Feb 12, 2023 · 4 comments
Labels
obsolete Issues with old (unsupported) versions of LLVM

Comments

@topcue
Copy link

topcue commented Feb 12, 2023

(I have reported the same issue to bug-gsl using the GNU mailing list. But no response: bug-gsl link)

Hi.
I'm working on a project where I compile with different optimization options for different target architectures in different compile versions.

Cross-compilation failed when compiling GSL package. (compiler hang)

First, the compiled environment is inside the Docker container, and the Docker image is based on ubuntu:16.04. The host running that Docker container is x86_64 Ubuntu 20.04.5 LTS.

The following is the result of executing 'uname -a' in an environment where compiling GSL fails.

$ uname -a
Linux 30a3b73aab3b 5.4.0-125-generic #141-Ubuntu SMP Wed Aug 10 13:42:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Inside the ubuntu:16.04 Docker container, I tried to build GSL with the following options.

  • compiler version: GCC 4 ~ GCC 11 and Clang 4 ~ Clang 13
  • target architecture: x86_64, x86_32, arm_32, arm_64, mips(eb)_32, mips_64
  • optimization level: O0, O1, O2, O3, Os, Ofast

When I tried GSL for the above compiler options, it failed to compile in the following case.

  • compiler version: Clang 8 and Clang 9
  • target architecture: arm_32
  • optimization level: Ofast

i.e. it failed to cross-compile GSL with Ofast option with arm_32 target architecture with Clang 8 and Clang 9 in x86_64 environment. (In all other cases the GSL build succeeded.)

I also tried to build by downgrading the GSL version since the build failed on GSL 2.7.1. But GSL 2.7, GSL 2.6, GSL 2.5, GSL 2.4 all failed to build. (I haven't tried lower versions. I'd like to compile the highest version, GSL 2.7.1, if possible.)

The reason why the build failed was because of the 'compiler hang', and in particular, I analyzed which command the hang occurred when trying.

As a result of checking with the htop command, hang occurred while executing the two commands below, and it was confirmed that the size of the virtual memory occupied by the process executing these two commands increased to 42G.

  • Commands to induce hang
/home/user/tools/clang/clang-8.0/bin/clang-8 -cc1 -triple armv4t-ubuntu-linux-gnueabi -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name mathieu_charv.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -menable-no-infs -menable-no-nans -menable-unsafe-fp-math -fno-signed-zeros -mreassociate -freciprocal-math -fno-trapping-math -ffp-contract=fast -ffast-math -ffinite-math-only -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu arm7tdmi -target-feature +soft-float-abi -target-feature +strict-align -target-abi aapcs-linux -mfloat-abi soft -fallow-half-arguments-and-returns -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file /home/user/tmp1/sources/gsl/gsl-2.7.1_clang-8.0_arm_32_Ofast_normal/specfunc/.libs/mathieu_charv.gcno -resource-dir /home/user/tools/clang/clang-8.0/lib/clang/8.0.0 -dependency-file .deps/mathieu_charv.Tpo -sys-header-deps -MP -MT mathieu_charv.lo -isysroot /home/user/tools//arm-ubuntu-linux-gnueabi-8.2.0/arm-ubuntu-linux-gnueabi/sysroot -isystem  /home/user/tools//arm-ubuntu-linux-gnueabi-8.2.0/arm-ubuntu-linux-gnueabi/sysroot/usr/include -D HAVE_CONFIG_H -I . -I .. -I .. -I /home/user/tools//arm-ubuntu-linux-gnueabi-8.2.0/arm-ubuntu-linux-gnueabi/sysroot/usr/include -D PIC -internal-isystem /usr/local/include -internal-isystem /home/user/tools/clang/clang-8.0/lib/clang/8.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Ofast -fdebug-compilation-dir /home/user/tmp1/sources/gsl/gsl-2.7.1_clang-8.0_arm_32_Ofast_normal/specfunc -ferror-limit 19 -fmessage-length 172 -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o .libs/mathieu_charv.o -x c mathieu_charv.c -faddrsig

/home/user/tools/clang/clang-8.0/bin/clang-8 -cc1 -triple armv4t-ubuntu-linux-gnueabi -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name coulomb.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -menable-no-infs -menable-no-nans -menable-unsafe-fp-math -fno-signed-zeros -mreassociate -freciprocal-math -fno-trapping-math -ffp-contract=fast -ffast-math -ffinite-math-only -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu arm7tdmi -target-feature +soft-float-abi -target-feature +strict-align -target-abi aapcs-linux -mfloat-abi soft -fallow-half-arguments-and-returns -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file /home/user/tmp1/sources/gsl/gsl-2.7.1_clang-8.0_arm_32_Ofast_normal/specfunc/.libs/coulomb.gcno -resource-dir /home/user/tools/clang/clang-8.0/lib/clang/8.0.0 -dependency-file .deps/coulomb.Tpo -sys-header-deps -MP -MT coulomb.lo -isysroot  /home/user/tools//arm-ubuntu-linux-gnueabi-8.2.0/arm-ubuntu-linux-gnueabi/sysroot -isystem  /home/user/tools//arm-ubuntu-linux-gnueabi-8.2.0/arm-ubuntu-linux-gnueabi/sysroot/usr/include -D HAVE_CONFIG_H -I . -I .. -I .. -I /home/user/tools//arm-ubuntu-linux-gnueabi-8.2.0/arm-ubuntu-linux-gnueabi/sysroot/usr/include -D PIC -internal-isystem /usr/local/include -internal-isystem /home/user/tools/clang/clang-8.0/lib/clang/8.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Ofast -fdebug-compilation-dir /home/user/tmp1/sources/gsl/gsl-2.7.1_clang-8.0_arm_32_Ofast_normal/specfunc -ferror-limit 19 -fmessage-length 172 -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o .libs/coulomb.o -x c coulomb.c -faddrsig

Can you please confirm if it is possible to build (cross-compile) GSL with Ofast option with arm_32 target architecture with Clang 8 and Clang 9 in x86_64 environment?

I am new to bug report and issue open. Required information may be missing.
If you request additional information, we will respond faithfully.

Thank you.

@EugeneZelenko
Copy link
Contributor

Clang 8 is too old. Could you please try 16 release candidate or main branch? https://godbolt.org should be helpful.

@topcue
Copy link
Author

topcue commented Feb 13, 2023

I need to compile the package with version clang-3 to clang-13 to get the dataset.
Only versions 8 and 9 of clang-3 through clang-13 failed to build.

@EugeneZelenko
Copy link
Contributor

Only current release (16) is supported.

@topcue
Copy link
Author

topcue commented Feb 13, 2023

Okay. Thank you.

@topcue topcue closed this as completed Feb 26, 2023
@EugeneZelenko EugeneZelenko added obsolete Issues with old (unsupported) versions of LLVM and removed new issue labels Feb 26, 2023
@EugeneZelenko EugeneZelenko closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
obsolete Issues with old (unsupported) versions of LLVM
Projects
None yet
Development

No branches or pull requests

2 participants