<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/117011>117011</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            "SPEC CPU2017 specspeed test suite" built with libomp.a static link fails to run.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          edisonchan
      </td>
    </tr>
</table>

<pre>
    Device: vivo iQOO 12
OS: termux proot ubuntu 24.04

LLVM was installed with below step:
1. add repos:
deb http://apt.llvm.org/oracular/ llvm-toolchain-oracular-19 main
deb-src http://apt.llvm.org/oracular/ llvm-toolchain-oracular-19 main

2. install llvm-19
apt-get install libllvm-19-ocaml-dev libllvm19 llvm-19 llvm-19-dev llvm-19-doc llvm-19-examples llvm-19-runtime
apt-get install clang-19 clang-tools-19 clang-19-doc libclang-common-19-dev libclang-19-dev libclang1-19 clang-format-19 python3-clang-19 clangd-19 clang-tidy-19
apt-get install libclang-rt-19-dev
apt-get install lld-19
apt-get install libc++-19-dev libc++abi-19-dev
apt-get install libomp-19-dev
apt-get install flang-19
apt-get install libllvmlibc-19-dev

3. build openmp static libs:
git clone https://github.com/llvm/llvm-project.git
cd llvm-project

latest_version=$(git branch -a | grep release | grep -oE '[0-9]+\.x' | sort -t. -k1,1n -k2,2n | tail -n 1)
git checkout release/$latest_version

cd openmp
mkdir build
cd build

# setup INSTALLDIR
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_ENABLE_SHARED=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-19 ..
make
make install


4. part of spec cpu2017 cfg:
```
default:
preENV_OMP_THREAD_LIMIT  = 8
#preENV_GOMP_CPU_AFFINITY = 0-7

intrate,fprate:
        copies  = 1   # EDIT to change number of copies (see above)

intspeed,fpspeed:
        threads                 = 8
# ENV_GOMP_CPU_AFFINITY = 0-7

default:
%ifdef %{no-numa}
        submit = taskset -c 7 ${command}
%endif

default:
%ifndef %{llvm_dir}
%   define  llvm_dir        "/usr/lib/llvm-19"  # EDIT (see above)
%endif

preENV_LD_LIBRARY_PATH  = %{llvm_dir}/lib:/usr/local/lib

default=base:                           # flags for all base
        OPTIMIZE                                = -Ofast -march=armv8-a -static 

intrate,intspeed=base: # flags for integer base
        EXTRA_CFLAGS                    = -fno-strict-aliasing -fno-unsafe-math-optimizations -fno-finite-math-only -fgnu89-inline -fcommon
        
fprate,fpspeed=base:
        EXTRA_CFLAGS                    += -fno-strict-aliasing 
        EXTRA_CXXFLAGS                  = -fno-finite-math-only
        EXTRA_FFLAGS                    = #-fallow-argument-mismatch
```

5. runcpu -c llvm.cfg --noreportable -n 1 603

```
Running Benchmarks
  Running 603.bwaves_s refspeed (ref) base llvm_19_1_aarch64-m64 threads:8 [2024-11-20 23:44:15]
603.bwaves_s: copy 0 non-zero return code (exit code=139, signal=0)

****************************************
Contents of bwaves_1.err
****************************************
/usr/lib/llvm-19/lib/libarcher.so: undefined symbol: RunningOnValgrind
Segmentation fault

****************************************
****************************************
Contents of speccmds.out
****************************************
specinvoke r4356
 Invoked as: /home/edison/cpu2017/bin/specinvoke -d /home/edison/cpu2017/benchspec/CPU/603.bwaves_s/run/run_base_refspeed_llvm_19_1_aarch64-m64.0000 -f speccmds.cmd -q -e speccmds.err -o speccmds.stdout
timer ticks over every 1000 ns
 Environment in effect for these runs:
 # 1: COLORTERM=
 # 2: BOOTCLASSPATH=/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/qcom.fmradio.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/system/framework/vivo-framework.jar:/system/framework/vivo-media.jar:/system/framework/framework-adapter.jar:/system/framework/soc-framework.jar:/system/framework/vivo-vgcclient.jar:/system/framework/vivo-coworkclient.jar:/system/framework/vivo-emmclient.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/
apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.configinfrastructure/javalib/framework-configinfrastructure.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.devicelock/javalib/framework-devicelock.jar:/apex/com.android.healthfitness/javalib/framework-healthfitness.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/a
pex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar
 # 3: OMP_THREAD_LIMIT=8
 # 4: SHLVL=1
 # 5: DEX2OATBOOTCLASSPATH=/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/qcom.fmradio.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/system/framework/vivo-framework.jar:/system/framework/vivo-media.jar:/system/framework/framework-adapter.jar:/system/framework/soc-framework.jar:/system/framework/vivo-vgcclient.jar:/system/framework/vivo-coworkclient.jar:/system/framework/vivo-emmclient.jar:/apex/com.android.i18n/javalib/core-icu4j.jar
 # 6: PATH=/home/edison/cpu2017/bin:/usr/lib/llvm-19/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/data/data/com.termux/files/usr/bin:/system/bin:/system/xbin
 # 7: PWD=/home/edison/cpu2017
 # 8: LC_LANG=C
 # 9: PULSE_SERVER=127.0.0.1
 #10: OMP_STACKSIZE=192M
 #11: TMPDIR=/tmp
 #12: SPECPERLLIB=/home/edison/cpu2017/bin/lib:/home/edison/cpu2017/bin
 #13: SPECDB_PWD=/home/edison/cpu2017
 #14: USER=edison
 #15: SPEC=/home/edison/cpu2017
 #16: ANDROID_DATA=/data
 #17: ANDROID_ROOT=/system
 #18: TERM=xterm
 #19: HOME=/home/edison
 #20: OLDPWD=/usr/lib/llvm-19/lib
 #21: ANDROID_I18N_ROOT=/apex/com.android.i18n
 #22: ANDROID_ART_ROOT=/apex/com.android.art
 #23: ANDROID_TZDATA_ROOT=/apex/com.android.tzdata
 #24: LC_ALL=C
 #25: EXTERNAL_STORAGE=/sdcard
 #26: _=/home/edison/cpu2017/bin/runcpu
 #27: LANG=en_US.UTF-8
 #28: LD_LIBRARY_PATH=/usr/lib/llvm-19/lib:/usr/local/lib
 #29: MOZ_FAKE_NO_SANDBOX=1
 #30: MALLOC_CONF=retain:true
 #31: LIBC_FATAL_STDERR_=1
 #32: OMP_NUM_THREADS=8
running commands in speccmds.cmd 1 times
runs started at         1732117455, 107689000, Wed Nov 20 23:44:15 2024
run 1 started at        1732117455, 108105000, Wed Nov 20 23:44:15 2024
child started: 0,       1732117455, 108269000, pid=22437, '../run_base_refspeed_llvm_19_1_aarch64-m64.0000/speed_bwaves_base.llvm_19_1_aarch64-m64 bwaves_1 < bwaves_1.in > bwaves_1.out 2>> bwaves_1.err'
child finished: 0, 1732117455, 125259000, sec=0, nsec=16990000, pid=22437, rc=35584
run 1 finished at:      1732117455, 125311000, Wed Nov 20 23:44:15 2024
run 1 elapsed time:              0, 017206000, 0.017206000
runs finished at 1732117455, 125543000, Wed Nov 20 23:44:15 2024
runs elapsed time: 0, 017854000, 0.017854000
error: a total of 1 children finished with errors
specinvoke exit: rc=0

****************************************
Invalid run; unable to continue.
If you wish to ignore errors please use '-I' or ignore_errors
The log for this run is in /home/edison/cpu2017/result/CPU2017.009.log
The debug log for this run is in /home/edison/cpu2017/result/CPU2017.009.log.debug
*
* Temporary files were NOT deleted; keeping temporaries such as
* /home/edison/cpu2017/result/CPU2017.009.log.debug and
* /home/edison/cpu2017/tmp/CPU2017.009
* (These may be large!)
*
runcpu finished at 2024-11-20 23:44:15; 29 total seconds elapsed
```

If remove the -staitc option, the test runs OK.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsOk1z4jjTv8a5dNllyxDCIQc-d6klIQ9hZmf3Qgm7DVpsyY8kk2R__VuSbWyYQDL1bNU7h02ljKX-brVabUlUKbbliPdOd-h0xze00Dsh7zFmSvBoR_nNRsRv92M8sAidcAAHdhDA_rNYQEAcf-z4g8Wz6dcos-IVcimEhmJTcF0A6Xh-p0Qqn_P51wd4oQoYV5qmKcbwwvQONpiKF1AacyesUAMPaByDxFyoY2eMG9hpbbHI1CFTmmsvTQ-ZJ-TWIVMhaVSkVDpkCqbb1UKk0Y4y7tYgN-hDRhk_MnSVjP5ZpuWTeLWVJVXQL_tprt0t6gb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