d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
670 stars 47 forks source link

Build failure due to unknown assembler pseudo-op on Ubuntu 20.04 with GCC 9.4.0 #104

Closed Kreijstal closed 1 year ago

Kreijstal commented 1 year ago

Description:

I'm attempting to build the project, but encounter a build failure with an error message from the assembler stating Error: unknown pseudo-op: .quat. This error occurs during the compilation of Td.cpp in the tdcore directory.

How to reproduce it:

  1. Clone the repository.
  2. Navigate to the project's root directory.
  3. Run the build commands:
    • mkdir build && cd build
    • cmake ..
    • make
  4. The build fails with an assembler error during the compilation of Td.cpp.

Environment:

Please advise on how to resolve this issue. Thank you.

Logs! ``` -- The CXX compiler identification is GNU 9.4.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using build type 'RelWithDebInfo' (default). -- Dummy: ON -- Telegram: ON -- WhatsApp: ON -- Dynamic Load: ON CMake Warning at CMakeLists.txt:61 (message): Go version 1.13.8 (need v1.18 to build WhatsApp). -- Found SQLite3: /usr/include (found version "3.31.1") -- Performing Test HAVE_BUILTIN_ATOMIC -- Performing Test HAVE_BUILTIN_ATOMIC - Success -- Using built-in atomic. -- The C compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Found ccache -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1f") -- Found OpenSSL: /usr/include /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE -- Performing Test HAVE_STD14 -- Performing Test HAVE_STD14 - Success -- Performing Test HAVE_CXX_FLAG_WALL -- Performing Test HAVE_CXX_FLAG_WALL - Success -- Performing Test HAVE_CXX_FLAG_WEXTRA -- Performing Test HAVE_CXX_FLAG_WEXTRA - Success -- Performing Test HAVE_CXX_FLAG_WIMPLICIT_FALLTHROUGH_2 -- Performing Test HAVE_CXX_FLAG_WIMPLICIT_FALLTHROUGH_2 - Success -- Performing Test HAVE_CXX_FLAG_WPOINTER_ARITH -- Performing Test HAVE_CXX_FLAG_WPOINTER_ARITH - Success -- Performing Test HAVE_CXX_FLAG_WCAST_QUAL -- Performing Test HAVE_CXX_FLAG_WCAST_QUAL - Success -- Performing Test HAVE_CXX_FLAG_WSIGN_COMPARE -- Performing Test HAVE_CXX_FLAG_WSIGN_COMPARE - Success -- Performing Test HAVE_CXX_FLAG_WDUPLICATED_BRANCHES -- Performing Test HAVE_CXX_FLAG_WDUPLICATED_BRANCHES - Success -- Performing Test HAVE_CXX_FLAG_WDUPLICATED_COND -- Performing Test HAVE_CXX_FLAG_WDUPLICATED_COND - Success -- Performing Test HAVE_CXX_FLAG_WALLOC_ZERO -- Performing Test HAVE_CXX_FLAG_WALLOC_ZERO - Success -- Performing Test HAVE_CXX_FLAG_WLOGICAL_OP -- Performing Test HAVE_CXX_FLAG_WLOGICAL_OP - Success -- Performing Test HAVE_CXX_FLAG_WTAUTOLOGICAL_COMPARE -- Performing Test HAVE_CXX_FLAG_WTAUTOLOGICAL_COMPARE - Success -- Performing Test HAVE_CXX_FLAG_WVLA -- Performing Test HAVE_CXX_FLAG_WVLA - Success -- Performing Test HAVE_CXX_FLAG_WNON_VIRTUAL_DTOR -- Performing Test HAVE_CXX_FLAG_WNON_VIRTUAL_DTOR - Success -- Performing Test HAVE_CXX_FLAG_WUNUSED_PARAMETER -- Performing Test HAVE_CXX_FLAG_WUNUSED_PARAMETER - Success -- Performing Test HAVE_CXX_FLAG_WCONVERSION -- Performing Test HAVE_CXX_FLAG_WCONVERSION - Success -- Performing Test HAVE_CXX_FLAG_WSIGN_CONVERSION -- Performing Test HAVE_CXX_FLAG_WSIGN_CONVERSION - Success -- Performing Test HAVE_CXX_FLAG_WCXX14_COMPAT_PEDANTIC -- Performing Test HAVE_CXX_FLAG_WCXX14_COMPAT_PEDANTIC - Failed -- Performing Test HAVE_CXX_FLAG_WDEPRECATED -- Performing Test HAVE_CXX_FLAG_WDEPRECATED - Success -- Performing Test HAVE_CXX_FLAG_WUNUSED_COMMAND_LINE_ARGUMENT -- Performing Test HAVE_CXX_FLAG_WUNUSED_COMMAND_LINE_ARGUMENT - Failed -- Performing Test HAVE_CXX_FLAG_QUNUSED_ARGUMENTS -- Performing Test HAVE_CXX_FLAG_QUNUSED_ARGUMENTS - Failed -- Performing Test HAVE_CXX_FLAG_WODR -- Performing Test HAVE_CXX_FLAG_WODR - Success -- Performing Test HAVE_CXX_FLAG_FLTO_ODR_TYPE_MERGING -- Performing Test HAVE_CXX_FLAG_FLTO_ODR_TYPE_MERGING - Success -- Performing Test HAVE_CXX_FLAG_WMAYBE_UNINITIALIZED -- Performing Test HAVE_CXX_FLAG_WMAYBE_UNINITIALIZED - Success -- Performing Test HAVE_CXX_FLAG_WREDUNDANT_MOVE -- Performing Test HAVE_CXX_FLAG_WREDUNDANT_MOVE - Success -- Git state: GITDIR-NOTFOUND -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") -- Found ZLIB: /usr/include /usr/lib/x86_64-linux-gnu/libz.so -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success -- Performing Test COMPILER_HAS_DEPRECATED_ATTR -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success -- Performing Test GNU_READLINE_FOUND -- Performing Test GNU_READLINE_FOUND - Success -- Found Readline: /usr/include -- Found Readline: /usr/include /usr/lib/x86_64-linux-gnu/libreadline.so -- Performing Test USABLE_READLINE_FOUND -- Performing Test USABLE_READLINE_FOUND - Success -- Looking for include file xcb/xcb.h -- Looking for include file xcb/xcb.h - not found -- Looking for wsyncup in /usr/lib/x86_64-linux-gnu/libcurses.so -- Looking for wsyncup in /usr/lib/x86_64-linux-gnu/libcurses.so - found -- Looking for cbreak in /usr/lib/x86_64-linux-gnu/libncursesw.so -- Looking for cbreak in /usr/lib/x86_64-linux-gnu/libncursesw.so - found -- Found Curses: /usr/lib/x86_64-linux-gnu/libncursesw.so -- Using fallback man dir: /usr/local/man -- Configuring done -- Generating done -- Build files have been written to: /home/ispardoa/ok/nchat/build Scanning dependencies of target clip [ 0%] Building CXX object ext/clip/CMakeFiles/clip.dir/clip.cpp.o [ 0%] Building CXX object ext/clip/CMakeFiles/clip.dir/image.cpp.o [ 0%] Building CXX object ext/clip/CMakeFiles/clip.dir/clip_none.cpp.o [ 0%] Linking CXX static library ../../lib/libclip.a [ 0%] Built target clip Scanning dependencies of target ncutil [ 0%] Building CXX object lib/ncutil/CMakeFiles/ncutil.dir/src/appconfig.cpp.o [ 0%] Building CXX object lib/ncutil/CMakeFiles/ncutil.dir/src/apputil.cpp.o [ 1%] Building CXX object lib/ncutil/CMakeFiles/ncutil.dir/src/clipboard.cpp.o [ 1%] Building CXX object lib/ncutil/CMakeFiles/ncutil.dir/src/config.cpp.o [ 1%] Building CXX object lib/ncutil/CMakeFiles/ncutil.dir/src/emojilist.cpp.o [ 1%] Building CXX object lib/ncutil/CMakeFiles/ncutil.dir/src/emojiutil.cpp.o [ 1%] Building CXX object lib/ncutil/CMakeFiles/ncutil.dir/src/fileutil.cpp.o [ 1%] Building CXX object lib/ncutil/CMakeFiles/ncutil.dir/src/log.cpp.o ....... /StickersManager.cpp.o [ 91%] Building CXX object lib/tgchat/ext/td/CMakeFiles/tdcore.dir/td/telegram/StickerType.cpp.o [ 91%] Building CXX object lib/tgchat/ext/td/CMakeFiles/tdcore.dir/td/telegram/StorageManager.cpp.o [ 92%] Building CXX object lib/tgchat/ext/td/CMakeFiles/tdcore.dir/td/telegram/SuggestedAction.cpp.o [ 92%] Building CXX object lib/tgchat/ext/td/CMakeFiles/tdcore.dir/td/telegram/Support.cpp.o [ 92%] Building CXX object lib/tgchat/ext/td/CMakeFiles/tdcore.dir/td/telegram/Td.cpp.o /tmp/ccNgcdya.s: Assembler messages: /tmp/ccNgcdya.s:14865089: Error: unknown pseudo-op: `.quat' make[2]: *** [lib/tgchat/ext/td/CMakeFiles/tdcore.dir/build.make:2351: lib/tgchat/ext/td/CMakeFiles/tdcore.dir/td/telegram/Td.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:715: lib/tgchat/ext/td/CMakeFiles/tdcore.dir/all] Error 2 make: *** [Makefile:130: all] Error 2 ```
d99kris commented 1 year ago

Hi @Kreijstal - thanks for the detailed bug report! 👍

Unfortunately I'm unable to reproduce this problem on Ubuntu 20.04 LTS x86_64 using the same GCC and CMake versions.

Td.cpp (well entire lib/tgchat/ext/td) comes from td (official Telegram library) which I seldom encounter build problems with across the distros and platforms I've tested.

This leads me to suspect there's some environment problem. The td build is quite resource hungry - can I check how much RAM your computer has (free -h), and roughly how much free disk space (df -h /)?

Lastly, does the system have just GCC compiler or other C/C++ toolchains (like clang or cross-compilers) installed? I googled the error message and it seemed it can occur if there's some mismatch between assembler and compiler.

Edit: It could also be useful to know the output of the following commands:

c++ --version
cc --version
as --version
ld --version

to try see if there's any mismatch in the toolchain.

d99kris commented 1 year ago

Hi - I will proceed to close this issue for now. Feel free to re-open it again if/when you get a chance to provide the requested details.