bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cross compiling with clang-8/9 to arm_32 target architecture Ofast fails


From: 윤형준
Subject: Cross compiling with clang-8/9 to arm_32 target architecture Ofast fails(hang)
Date: Sun, 5 Feb 2023 16:34:01 +0900

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 conatiner 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 및 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-8
- 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?

Thank you.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]