[libc-commits] [libc] [libc][stdfix] Implement fixed point bitsfx functions in llvm-libc (PR #116599)

via libc-commits libc-commits at lists.llvm.org
Fri Nov 22 04:27:13 PST 2024


braw-lee wrote:

I am getting a linker error for just one test file `bitshr_test.cpp`

```
[1250/1256] Linking CXX executable libc/test/src/stdfix/libc.test.src.stdfix.bitshr_test.__unit__.__build__                                                   
FAILED: libc/test/src/stdfix/libc.test.src.stdfix.bitshr_test.__unit__.__build__                                                                              
: && /home/ikasama/oss/llvm_related/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -fPIC -fno-semantic-interposition -fvisibility-inlines-
hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimp
licit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading
-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fpie -ffixed-point -Wno-c99-extensions -Wno-gnu-im
aginary-constant -Wno-pedantic -O3 libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.bitshr_test.__unit__.__build__.dir/bitshr_test.cpp.o -o libc/test/src/
stdfix/libc.test.src.stdfix.bitshr_test.__unit__.__build__  libc/src/stdfix/CMakeFiles/libc.src.stdfix.bitshr.__internal__.dir/./bitshr.cpp.o  libc/src/errno/
CMakeFiles/libc.src.errno.errno.__internal__.dir/./libc_errno.cpp.o  libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/./error_to_string.cpp.o  libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/./exit.cpp.o  libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/./fcntl.cpp.o  libc/test/UnitTest/libLibcDeathTestExecutors.unit.a  libc/test/UnitTest/libLibcTest.unit.a && :
/usr/bin/ld: libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.bitshr_test.__unit__.__build__.dir/bitshr_test.cpp.o: in function `LlvmLibcBitshrTest_SpecialNumbers::Run()':
bitshr_test.cpp:(.text._ZN33LlvmLibcBitshrTest_SpecialNumbers3RunEv+0x48): undefined reference to `bool __llvm_libc_20_0_0_git::testing::internal::test<signed char>(__llvm_libc_20_0_0_git::testing::internal::RunContext*, __llvm_libc_20_0_0_git::testing::TestCond, signed char, signed char, char const*, char const*, __llvm_libc_20_0_0_git::testing::internal::Location)'
/usr/bin/ld: bitshr_test.cpp:(.text._ZN33LlvmLibcBitshrTest_SpecialNumbers3RunEv+0x89): undefined reference to `bool __llvm_libc_20_0_0_git::testing::internal::test<signed char>(__llvm_libc_20_0_0_git::testing::internal::RunContext*, __llvm_libc_20_0_0_git::testing::TestCond, signed char, signed char, char const*, char const*, __llvm_libc_20_0_0_git::testing::internal::Location)'
/usr/bin/ld: bitshr_test.cpp:(.text._ZN33LlvmLibcBitshrTest_SpecialNumbers3RunEv+0xca): undefined reference to `bool __llvm_libc_20_0_0_git::testing::internal::test<signed char>(__llvm_libc_20_0_0_git::testing::internal::RunContext*, __llvm_libc_20_0_0_git::testing::TestCond, signed char, signed char, char const*, char const*, __llvm_libc_20_0_0_git::testing::internal::Location)'
/usr/bin/ld: bitshr_test.cpp:(.text._ZN33LlvmLibcBitshrTest_SpecialNumbers3RunEv+0x10b): undefined reference to `bool __llvm_libc_20_0_0_git::testing::internal::test<signed char>(__llvm_libc_20_0_0_git::testing::internal::RunContext*, __llvm_libc_20_0_0_git::testing::TestCond, signed char, signed char, char const*, char const*, __llvm_libc_20_0_0_git::testing::internal::Location)'
/usr/bin/ld: libc/test/src/stdfix/libc.test.src.stdfix.bitshr_test.__unit__.__build__: hidden symbol `_ZN22__llvm_libc_20_0_0_git7testing8internal4testIaEEbPNS1_10RunContextENS0_8TestCondET_S6_PKcS8_NS1_8LocationE' isn't defined
/usr/bin/ld: final link failed: bad value
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[1251/1256] Running unit test libc.test.src.math.smoke.nanf_test.__unit__
```

the problematic test file is similar to other test files (which are working fine)
can anyone help me out here?

https://github.com/llvm/llvm-project/pull/116599


More information about the libc-commits mailing list