Open jandrovins opened 2 months ago
When I compile with clang 18.1.8, it fails on src/lib/CMakeFiles/libsimeng.dir/models/emulation/Core.cc.o with:
(base) vincent@vanjaro at build-clang >:/ ninja -j 1
[1/14] Building CXX object src/lib/CMakeFiles/libsimeng.dir/models/emulation/Core.cc.o
FAILED: src/lib/CMakeFiles/libsimeng.dir/models/emulation/Core.cc.o
/usr/bin/clang++ -Dlibsimeng_EXPORTS -I/home/vincent/SimEng/src/include -I/home/vincent/SimEng/build-clang/_deps/capstone-lib-build/include -I/home/vincent/SimEng/build-clang/_deps/capstone-lib-src/include -I/home/vincent/SimEng/src/lib -I/home/vincent/SimEng/build-clang/src/lib -O2 -g -DNDEBUG -std=c++17 -fPIC -fno-rtti -Wall -pedantic -Werror -MD -MT src/lib/CMakeFiles/libsimeng.dir/models/emulation/Core.cc.o -MF src/lib/CMakeFiles/libsimeng.dir/models/emulation/Core.cc.o.d -o src/lib/CMakeFiles/libsimeng.dir/models/emulation/Core.cc.o -c /home/vincent/SimEng/src/lib/models/emulation/Core.cc
In file included from /home/vincent/SimEng/src/lib/models/emulation/Core.cc:1:
In file included from /home/vincent/SimEng/src/include/simeng/models/emulation/Core.hh:7:
In file included from /home/vincent/SimEng/src/include/simeng/ArchitecturalRegisterFileSet.hh:3:
In file included from /home/vincent/SimEng/src/include/simeng/RegisterFileSet.hh:5:
/home/vincent/SimEng/src/include/simeng/Register.hh:10:3: error: unknown type name 'uint8_t'
10 | uint8_t type;
| ^
/home/vincent/SimEng/src/include/simeng/Register.hh:14:3: error: unknown type name 'uint16_t'
14 | uint16_t tag;
| ^
In file included from /home/vincent/SimEng/src/lib/models/emulation/Core.cc:1:
In file included from /home/vincent/SimEng/src/include/simeng/models/emulation/Core.hh:8:
In file included from /home/vincent/SimEng/src/include/simeng/Core.hh:9:
In file included from /home/vincent/SimEng/src/include/simeng/config/SimInfo.hh:8:
In file included from /home/vincent/SimEng/src/include/simeng/arch/aarch64/ArchInfo.hh:3:
In file included from /home/vincent/SimEng/src/include/simeng/arch/ArchInfo.hh:7:
/home/vincent/SimEng/src/include/simeng/config/yaml/ryml.hh:9872:5: error: 'memcpy' will always overflow; destination buffer has size 4, but size argument is 8 [-Werror,-Wfortify-source]
9872 | ::memcpy(&bits, &value, sizeof(T));
| ^
/home/vincent/SimEng/src/include/simeng/config/yaml/ryml.hh:9909:26: note: in instantiation of function template specialization 'fast_float::to_extended<double>' requested here
9909 | adjusted_mantissa am = to_extended(value);
| ^
/home/vincent/SimEng/src/include/simeng/config/yaml/ryml.hh:10171:29: note: in instantiation of function template specialization 'fast_float::to_extended_halfway<double>' requested here
10171 | adjusted_mantissa theor = to_extended_halfway(b);
| ^
/home/vincent/SimEng/src/include/simeng/config/yaml/ryml.hh:10235:12: note: in instantiation of function template specialization 'fast_float::negative_digit_comp<double>' requested here
10235 | return negative_digit_comp<T>(bigmant, am, exponent);
| ^
/home/vincent/SimEng/src/include/simeng/config/yaml/ryml.hh:10350:28: note: in instantiation of function template specialization 'fast_float::digit_comp<double>' requested here
10350 | if(am.power2 < 0) { am = digit_comp<T>(pns, am); }
| ^
/home/vincent/SimEng/src/include/simeng/config/yaml/ryml.hh:10312:10: note: in instantiation of function template specialization 'fast_float::from_chars_advanced<double>' requested here
10312 | return from_chars_advanced(first, last, value, parse_options{fmt});
| ^
/home/vincent/SimEng/src/include/simeng/config/yaml/ryml.hh:12628:30: note: in instantiation of function template specialization 'fast_float::from_chars<double>' requested here
12628 | result = fast_float::from_chars(str.str, str.str + str.len, *v);
| ^
3 errors generated.
ninja: build stopped: subcommand failed.
Please try and use the additional-sme-support
branch with GCC. Clang is likely failing due to missing header files that aren't being pointed to properly at compile time
The first error was solved with the new commit in additional-sme-support
, but I still found errors from the unknown type name 'uint8_t
. Are you sure it is failing for missing headers? I solved it with the following patch. It seems src/include/simeng/Register.hh is missing the cstdint
header. With this change the clang compilation works as well:
diff --git a/src/include/simeng/Register.hh b/src/include/simeng/Register.hh
index 4b60772e..579ffae7 100644
--- a/src/include/simeng/Register.hh
+++ b/src/include/simeng/Register.hh
@@ -1,5 +1,6 @@
#pragma once
#include <iostream>
+#include <cstdint>
namespace simeng {
@@ -26,4 +27,4 @@ struct Register {
bool operator!=(const Register& other) const { return !(other == *this); }
};
-} // namespace simeng
\ No newline at end of file
+} // namespace simeng
Thanks for letting me know. I'll add this header to Register.hh now and update the branch
System Description Please provide the following as a list:
SimEng Version The tip of main branch, commit 7af3bc3fe7deb703756def31a208839bc5bdc4c2
SimEng CMAKE Options Used
-GNinja
-DCMAKE_INSTALL_PREFIX=$PWD/install
-DCMAKE_BUILD_TYPE=RelWithDebInfo
Problem Description Compilation fails while generating: src/lib/CMakeFiles/libsimeng.dir/arch/aarch64/ExceptionHandler.cc.o