Closed s117 closed 10 months ago
futex
was called because glibc was compiled with multithread support (thread model: posix).
$ riscv64-unknown-linux-gnu-clang -v
clang version 17.0.2 (https://github.com/llvm/llvm-project.git b2417f51dbbd7435eb3aaf203de24de6754da50e)
Target: riscv64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/s117/Research/toolchain/anycore/gcc13.2.0_clang17.0.2/install-linux/bin
Found candidate GCC installation: /home/s117/Research/toolchain/anycore/gcc13.2.0_clang17.0.2/install-linux/bin/../sysroot/lib/gcc/riscv64-unknown-linux-gnu/13.2.0
Selected GCC installation: /home/s117/Research/toolchain/anycore/gcc13.2.0_clang17.0.2/install-linux/bin/../sysroot/lib/gcc/riscv64-unknown-linux-gnu/13.2.0
$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/s117/Research/toolchain/anycore/gcc13.2.0_clang17.0.2/install-linux/libexec/gcc/riscv64-unknown-linux-gnu/13.2.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /home/s117/Research/toolchain/anycore/gcc13.2.0_clang17.0.2/riscv-gnu-toolchain/build_linux/../gcc/configure --target=riscv64-unknown-linux-gnu --prefix=/home/s117/Research/toolchain/anycore/gcc13.2.0_clang17.0.2/install-linux --with-sysroot=/home/s117/Research/toolchain/anycore/gcc13.2.0_clang17.0.2/install-linux/sysroot --with-pkgversion=gc891d8dc23e --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap --src=../../gcc --disable-multilib --with-abi=lp64d --with-arch=rv64imafd --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2 -g -g -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2 -g -g -mcmodel=medlow'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (gc891d8dc23e)
Since PK is a single-threaded environment, multithread support should be disabled in the compiler and glibc.
Related links on how to set the thread model to single: https://gcc.gnu.org/install/configure.html https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html https://gcc.gnu.org/onlinedocs/gcc-4.8.5/libstdc++/manual/manual/using_concurrency.html https://llvm.org/docs/CMake.html
See the log below: