FEX: failure to build with -DBUILD_TESTS=True on 18.04

I shoved a few PPAs into 18.04 to attempt to build it on a Jetson Nano - are the following errors a result of my dependencies probably being a mess, or is this something that can be fixed on FEX’s end?

Relevant dependencies below, let me know if I’m missing anything:

cobalt@nano-sd:~/FEX/Build$ cmake --version
cmake version 3.22.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

cobalt@nano-sd:~/FEX/Build$ clang-13 --version
Ubuntu clang version 13.0.1-++20211124042925+19b8368225dc-1~exp1~20211124043458.31
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
cobalt@nano-sd:~/FEX/Build$ 

Also I’ve got libstdc++-11-dev and libstdc++6, llvm.org mentioned those were needed from a PPA.

Full log:

cobalt@nano-sd:~/FEX/Build$ CC=clang-13 CXX=clang++-13 cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_LTO=True -DBUILD_TESTS=False -G Ninja ..
-- The C compiler identification is Clang 13.0.1
-- The CXX compiler identification is Clang 13.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang-13 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++-13 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test ENUM_ENUM_WARNING
-- Performing Test ENUM_ENUM_WARNING - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Found Python: /usr/bin/python3.8 (found suitable version "3.8.6", minimum required is "3.0") found components: Interpreter 
-- xxHash not found. Using Externals
-- Version: 7.1.3
-- Build type: RELEASE
-- CXX_STANDARD: 20
-- Performing Test has_std_20_flag
-- Performing Test has_std_20_flag - Success
-- Performing Test has_std_2a_flag
-- Performing Test has_std_2a_flag - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Required features: cxx_variadic_templates
-- Performing Test HAS_NULLPTR_WARNING
-- Performing Test HAS_NULLPTR_WARNING - Success
-- Looking for strtod_l
-- Looking for strtod_l - not found
-- Performing Test GCC_COLOR
-- Performing Test GCC_COLOR - Success
-- Performing Test CLANG_COLOR
-- Performing Test CLANG_COLOR - Success
-- Performing Test COMPILER_SUPPORTS_CPU_TYPE
-- Performing Test COMPILER_SUPPORTS_CPU_TYPE - Success
-- Found Git: /usr/bin/git (found version "2.17.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cobalt/FEX/Build


cobalt@nano-sd:~/FEX/Build$ ninja
[0/2] Re-checking globbed directories...
[69/327] Building CXX object External/imgui/CMakeFiles/imgui.dir/imgui_widgets.cpp.o
/home/cobalt/FEX/External/imgui/imgui_widgets.cpp:5415:98: warning: bitwise operation between different enumeration types ('ImGuiTreeNodeFlags_' and 'ImGuiTreeNodeFlagsPrivate_') is deprecated [-Wdeprecated-enum-enum-conversion]
    flags |= ImGuiTreeNodeFlags_CollapsingHeader | (p_open ? ImGuiTreeNodeFlags_AllowItemOverlap | ImGuiTreeNodeFlags_ClipLabelForTrailingButton : 0);
                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[75/327] Building CXX object Source/Tools/FEX...emon/CMakeFiles/FEXMountDaemon.dir/Main.cpp.o
FAILED: Source/Tools/FEXMountDaemon/CMakeFiles/FEXMountDaemon.dir/Main.cpp.o 
/usr/bin/clang++-13 -DENABLE_JEMALLOC=1 -DGLOBAL_DATA_DIRECTORY=\"/usr/share/fex-emu/\" -D_M_ARM_64=1 -I/home/cobalt/FEX/Build/Source/Tools/FEXMountDaemon -I/home/cobalt/FEX/Source/Tools/FEXMountDaemon -I/home/cobalt/FEX/External/jemalloc/pregen/include -I/home/cobalt/FEX/External/vixl/src -I/home/cobalt/FEX/External/xxhash -I/home/cobalt/FEX/External/cpp-optparse -I/home/cobalt/FEX/External/imgui -I/home/cobalt/FEX/External/json-maker -I/home/cobalt/FEX/External/tiny-json -I/home/cobalt/FEX/External/xbyak -I/home/cobalt/FEX/Source -I/home/cobalt/FEX/Build/Source -mcpu=cortex-a57 -O3 -DNDEBUG -fomit-frame-pointer -flto=thin -fPIE   -Wno-trigraphs -fdiagnostics-color=always -fcolor-diagnostics -Wno-deprecated-enum-enum-conversion -Wall -std=gnu++20 -MD -MT Source/Tools/FEXMountDaemon/CMakeFiles/FEXMountDaemon.dir/Main.cpp.o -MF Source/Tools/FEXMountDaemon/CMakeFiles/FEXMountDaemon.dir/Main.cpp.o.d -o Source/Tools/FEXMountDaemon/CMakeFiles/FEXMountDaemon.dir/Main.cpp.o -c /home/cobalt/FEX/Source/Tools/FEXMountDaemon/Main.cpp
/home/cobalt/FEX/Source/Tools/FEXMountDaemon/Main.cpp:78:24: error: no member named 'gettid' in the global namespace
    EPollThreadTID = ::gettid();
                     ~~^
/home/cobalt/FEX/Source/Tools/FEXMountDaemon/Main.cpp:125:5: error: use of undeclared identifier 'tgkill'
    tgkill(::getpid(), EPollThreadTID, SIGUSR1);
    ^
/home/cobalt/FEX/Source/Tools/FEXMountDaemon/Main.cpp:143:25: error: no member named 'gettid' in the global namespace
    SocketThreadTID = ::gettid();
                      ~~^
/home/cobalt/FEX/Source/Tools/FEXMountDaemon/Main.cpp:285:5: error: use of undeclared identifier 'tgkill'
    tgkill(::getpid(), SocketThreadTID, SIGUSR1);
    ^
4 errors generated.
[80/327] Building CXX object External/FEXCore...ir/Interface/Core/Interpreter/VectorOps.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/Interpreter/VectorOps.cpp:1404:11: warning: unused variable 'OpSize' [-Wunused-variable]
  uint8_t OpSize = IROp->Size;
          ^
1 warning generated.
ninja: build stopped: subcommand failed.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (18 by maintainers)

Commits related to this issue

Most upvoted comments

I pulled off a successful build on 18.04! I’m gonna try another one with -DBUILD_TESTS=True, but for now here’s the warning log if anyone’s interested:

-- Build files have been written to: /home/cobalt/FEX/Build
[0/2] Re-checking globbed directories...
[66/334] Building CXX object External/imgui/CMakeFiles/imgui.dir/imgui_widgets.cpp.o
/home/cobalt/FEX/External/imgui/imgui_widgets.cpp:5415:98: warning: bitwise operation between different enumeration types ('ImGuiTreeNodeFlags_' and 'ImGuiTreeNodeFlagsPrivate_') is deprecated [-Wdeprecated-enum-enum-conversion]
    flags |= ImGuiTreeNodeFlags_CollapsingHeader | (p_open ? ImGuiTreeNodeFlags_AllowItemOverlap | ImGuiTreeNodeFlags_ClipLabelForTrailingButton : 0);
                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[158/334] Building CXX object External/FEXCor...ore_object.dir/Interface/Core/GdbServer.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/GdbServer.cpp:973:8: warning: variable 'Set' set but not used [-Wunused-but-set-variable]
  bool Set{};
       ^
1 warning generated.
[170/334] Building CXX object External/FEXCor...ect.dir/Interface/Core/OpcodeDispatcher.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp:4498:3: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
  RealNode->Op(DualListData.DataBegin());
  ^~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[171/334] Building CXX object External/FEXCor...terface/Core/Dispatcher/Arm64Dispatcher.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/Dispatcher/Arm64Dispatcher.cpp:182:34: warning: offset of on non-standard-layout type 'FEXCore::Context::Context' [-Winvalid-offsetof]
          ldr(w0, MemOperand(x0, offsetof(FEXCore::Context::Context, Config.RunningMode)));
                                 ^                                   ~~~~~~
/usr/lib/llvm-13/lib/clang/13.0.1/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
1 warning generated.
[173/334] Building CXX object External/FEXCor...t.dir/Interface/Core/Interpreter/ALUOps.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/Interpreter/ALUOps.cpp:838:11: warning: unused variable 'OpSize' [-Wunused-variable]
  uint8_t OpSize = IROp->Size;
          ^
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/Interpreter/ALUOps.cpp:851:11: warning: unused variable 'OpSize' [-Wunused-variable]
  uint8_t OpSize = IROp->Size;
          ^
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/Interpreter/ALUOps.cpp:892:11: warning: unused variable 'OpSize' [-Wunused-variable]
  uint8_t OpSize = IROp->Size;
          ^
3 warnings generated.
[174/334] Building CXX object External/FEXCor...Interface/Core/Dispatcher/X86Dispatcher.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/Dispatcher/X86Dispatcher.cpp:165:34: warning: offset of on non-standard-layout type 'FEXCore::Core::InternalThreadState' [-Winvalid-offsetof]
        mov(rax, qword [STATE + (offsetof(FEXCore::Core::InternalThreadState, CTX))]);
                                 ^                                            ~~~
/usr/lib/llvm-13/lib/clang/13.0.1/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/Dispatcher/X86Dispatcher.cpp:168:27: warning: offset of on non-standard-layout type 'FEXCore::Context::Context' [-Winvalid-offsetof]
        cmp(dword [rax + (offsetof(FEXCore::Context::Context, Config.RunningMode))], 0);
                          ^                                   ~~~~~~
/usr/lib/llvm-13/lib/clang/13.0.1/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
2 warnings generated.
[189/334] Building CXX object External/FEXCor...ir/Interface/Core/Interpreter/VectorOps.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/Interpreter/VectorOps.cpp:1405:11: warning: unused variable 'OpSize' [-Wunused-variable]
  uint8_t OpSize = IROp->Size;
          ^
1 warning generated.
[203/334] Building CXX object External/FEXCor...e/IR/Passes/DeadContextStoreElimination.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/IR/Passes/DeadContextStoreElimination.cpp:257:12: warning: variable 'ClassifiedStructSize' set but not used [-Wunused-but-set-variable]
    size_t ClassifiedStructSize{};
           ^
/home/cobalt/FEX/External/FEXCore/Source/Interface/IR/Passes/DeadContextStoreElimination.cpp:50:15: warning: unused function 'IsInvalidAccess' [-Wunused-function]
  static bool IsInvalidAccess(LastAccessType Type) {
              ^
/home/cobalt/FEX/External/FEXCore/Source/Interface/IR/Passes/DeadContextStoreElimination.cpp:54:15: warning: unused function 'IsPartialAccess' [-Wunused-function]
  static bool IsPartialAccess(LastAccessType Type) {
              ^
3 warnings generated.
[204/334] Building CXX object External/FEXCor...bject.dir/Interface/IR/Passes/ConstProp.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp:358:14: warning: variable 'mask' set but not used [-Wunused-but-set-variable]
        auto mask = getMask(IROp);
             ^
1 warning generated.
[221/334] Building CXX object External/FEXCor...ct.dir/Interface/Core/ArchHelpers/Arm64.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/ArchHelpers/Arm64.cpp:538:15: warning: unused variable 'mcontext' [-Wunused-variable]
  mcontext_t* mcontext = &reinterpret_cast<ucontext_t*>(_ucontext)->uc_mcontext;
              ^
1 warning generated.
[222/334] Building CXX object External/FEXCor...erface/IR/Passes/RegisterAllocationPass.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/IR/Passes/RegisterAllocationPass.cpp:1118:14: warning: variable 'Found' set but not used [-Wunused-but-set-variable]
        bool Found{};
             ^
1 warning generated.
[223/334] Building CXX object External/FEXCor...object.dir/Interface/Core/JIT/Arm64/JIT.cpp.o
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/JIT/Arm64/JIT.cpp:660:28: warning: offset of on non-standard-layout type 'FEXCore::Core::InternalThreadState' [-Winvalid-offsetof]
    ldr(x0, MemOperand(x0, offsetof(FEXCore::Core::InternalThreadState, CTX))); // Get Context
                           ^                                            ~~~
/usr/lib/llvm-13/lib/clang/13.0.1/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
/home/cobalt/FEX/External/FEXCore/Source/Interface/Core/JIT/Arm64/JIT.cpp:661:28: warning: offset of on non-standard-layout type 'FEXCore::Context::Context' [-Winvalid-offsetof]
    ldr(w0, MemOperand(x0, offsetof(FEXCore::Context::Context, Config.RunningMode)));
                           ^                                   ~~~~~~
/usr/lib/llvm-13/lib/clang/13.0.1/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
2 warnings generated.
[243/334] Building CXX object Source/Linux/CM...eFiles/FEX_Utils.dir/Utils/ELFContainer.cpp.o
/home/cobalt/FEX/Source/Linux/Utils/ELFContainer.cpp:880:23: warning: variable 'GOTHeader' set but not used [-Wunused-but-set-variable]
    Elf64_Shdr const *GOTHeader {nullptr};
                      ^
/home/cobalt/FEX/Source/Linux/Utils/ELFContainer.cpp:969:23: warning: variable 'GOTHeader' set but not used [-Wunused-but-set-variable]
    Elf64_Shdr const *GOTHeader {nullptr};
                      ^
2 warnings generated.
[334/334] Linking CXX executable Bin/TestHarnessRunner

FEX itself doesn’t use statx directly. So you could define SYS_statx correctly and hope whatever application you’re attempting to run doesn’t use it. It was added in kernel 4.11 and we don’t expose that low of a kernel version to the guest. Just need to be careful with the syscall numbering on the host

ag "statx" Source/Tests/LinuxSyscalls/*/SyscallsEnum.h

Source/Tests/LinuxSyscalls/Arm64/SyscallsEnum.h
288:  SYSCALL_Arm64_statx = 291,

Source/Tests/LinuxSyscalls/x32/SyscallsEnum.h
407:  SYSCALL_x86_statx = 383,

Source/Tests/LinuxSyscalls/x64/SyscallsEnum.h
357:  SYSCALL_x64_statx = 332,