Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build (make) on Raspberry Pi 3b+ (Raspbian OS 10 Buster) #4

Open
ernestgwilsonii opened this issue Sep 8, 2019 · 4 comments

Comments

@ernestgwilsonii
Copy link

ernestgwilsonii commented Sep 8, 2019

Fails to build (make) on Raspberry Pi 3b+ (Raspbian OS 10 Buster)

root@raspberrypi:/tmp/mumpi/build# cat /etc/debian_version
10.0

uname -a
Linux raspberrypi 4.19.58-v7+ #1245 SMP Fri Jul 12 17:25:51 BST 2019 armv7l GNU/Linux

Installing dependencies worked fine:

apt-get install -y libboost-all-dev libssl-dev liblog4cpp5-dev libopus-dev protobuf-compiler libprotobuf-dev portaudio19-dev cmake

Cloning the repo worked fine:

cd /tmp/
git clone https://github.com/Hunter522/mumpi.git --recursive
cd mumpi/

cmake worked fine:

mkdir build && cd build
cmake ..

-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.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
-- 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
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   system
-- Found OpenSSL: /usr/lib/arm-linux-gnueabihf/libcrypto.so (found version "1.1.1c")  
-- Found Protobuf: /usr/lib/arm-linux-gnueabihf/libprotobuf.so;-lpthread (found version "3.6.1") 
-- Checking for module 'log4cpp'
--   Found log4cpp, version 1.1
-- Checking for module 'opus'
--   Found opus, version 1.3
-- Found PythonInterp: /usr/bin/python (found version "2.7.16") 
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/mumpi/build

make fails

make

[  3%] Running cpp protocol buffer compiler on Mumble.proto
[libprotobuf WARNING google/protobuf/compiler/parser.cc:562] No syntax specified for the proto file: Mumble.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
Scanning dependencies of target mumlib
[  7%] Building CXX object deps/mumlib/CMakeFiles/mumlib.dir/src/mumlib.cpp.o
[ 10%] Building CXX object deps/mumlib/CMakeFiles/mumlib.dir/src/Callback.cpp.o
[ 14%] Building CXX object deps/mumlib/CMakeFiles/mumlib.dir/src/CryptState.cpp.o
/tmp/mumpi/deps/mumlib/src/CryptState.cpp: In function ‘void S2(subblock*)’:
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:184:104: error: invalid 'asm': invalid operand for code 'q'
 #define SWAP64(x) ({register uint64_t __out, __in = (x); __asm__("bswap %q0" : "=r"(__out) : "0"(__in)); __out;})
                                                                                                        ^
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:196:22: note: in expansion of macro ‘SWAPPED’
     subblock carry = SWAPPED(block[0]) >> SHIFTBITS;
                      ^~~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:184:104: error: invalid 'asm': invalid operand for code 'q'
 #define SWAP64(x) ({register uint64_t __out, __in = (x); __asm__("bswap %q0" : "=r"(__out) : "0"(__in)); __out;})
                                                                                                        ^
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:198:20: note: in expansion of macro ‘SWAPPED’
         block[i] = SWAPPED((SWAPPED(block[i]) << 1) | (SWAPPED(block[i + 1]) >> SHIFTBITS));
                    ^~~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:198:29: note: in expansion of macro ‘SWAPPED’
         block[i] = SWAPPED((SWAPPED(block[i]) << 1) | (SWAPPED(block[i + 1]) >> SHIFTBITS));
                             ^~~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:184:104: error: invalid 'asm': invalid operand for code 'q'
 #define SWAP64(x) ({register uint64_t __out, __in = (x); __asm__("bswap %q0" : "=r"(__out) : "0"(__in)); __out;})
                                                                                                        ^
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:198:20: note: in expansion of macro ‘SWAPPED’
         block[i] = SWAPPED((SWAPPED(block[i]) << 1) | (SWAPPED(block[i + 1]) >> SHIFTBITS));
                    ^~~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:198:56: note: in expansion of macro ‘SWAPPED’
         block[i] = SWAPPED((SWAPPED(block[i]) << 1) | (SWAPPED(block[i + 1]) >> SHIFTBITS));
                                                        ^~~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:184:104: error: invalid 'asm': invalid operand for code 'q'
 #define SWAP64(x) ({register uint64_t __out, __in = (x); __asm__("bswap %q0" : "=r"(__out) : "0"(__in)); __out;})
                                                                                                        ^
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:198:20: note: in expansion of macro ‘SWAPPED’
         block[i] = SWAPPED((SWAPPED(block[i]) << 1) | (SWAPPED(block[i + 1]) >> SHIFTBITS));
                    ^~~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:184:104: error: invalid 'asm': invalid operand for code 'q'
 #define SWAP64(x) ({register uint64_t __out, __in = (x); __asm__("bswap %q0" : "=r"(__out) : "0"(__in)); __out;})
                                                                                                        ^
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:199:28: note: in expansion of macro ‘SWAPPED’
     block[BLOCKSIZE - 1] = SWAPPED((SWAPPED(block[BLOCKSIZE - 1]) << 1) ^ (carry * 0x87));
                            ^~~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:199:37: note: in expansion of macro ‘SWAPPED’
     block[BLOCKSIZE - 1] = SWAPPED((SWAPPED(block[BLOCKSIZE - 1]) << 1) ^ (carry * 0x87));
                                     ^~~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:184:104: error: invalid 'asm': invalid operand for code 'q'
 #define SWAP64(x) ({register uint64_t __out, __in = (x); __asm__("bswap %q0" : "=r"(__out) : "0"(__in)); __out;})
                                                                                                        ^
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:185:20: note: in expansion of macro ‘SWAP64’
 #define SWAPPED(x) SWAP64(x)
                    ^~~~~~
/tmp/mumpi/deps/mumlib/src/CryptState.cpp:199:28: note: in expansion of macro ‘SWAPPED’
     block[BLOCKSIZE - 1] = SWAPPED((SWAPPED(block[BLOCKSIZE - 1]) << 1) ^ (carry * 0x87));
                            ^~~~~~~
make[2]: *** [deps/mumlib/CMakeFiles/mumlib.dir/build.make:97: deps/mumlib/CMakeFiles/mumlib.dir/src/CryptState.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:205: deps/mumlib/CMakeFiles/mumlib.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

What now?

@ernestgwilsonii ernestgwilsonii changed the title Fails to build on Raspberry Pi 3b+ (Raspbian OS 10 Buster) Fails to build (make) on Raspberry Pi 3b+ (Raspbian OS 10 Buster) Sep 8, 2019
@silardg
Copy link

silardg commented Sep 10, 2019

@ernestgwilsonii did you get it to work? I'm planning on building a client for mumble.

@ernestgwilsonii
Copy link
Author

@silardg No. I really would like a command line Mumble client with VOX for Raspberry Pi too.

@kgoba
Copy link

kgoba commented Dec 13, 2019

I can confirm I have the same issue on a latest Raspbian image. It seems the newer GCC might have a different syntax for assembly, but I am not that familiar with the syntax.

@kgoba
Copy link

kgoba commented Dec 13, 2019

I was able to build and launch the code by changing the assembly code to a GCC-specific function in deps/mumlib/src/CryptState.cpp:

-#define SWAP64(x) ({register uint64_t __out, __in = (x); __asm__("bswap %q0" : "=r"(__out) : "0"(__in)); __out;})
+#define SWAP64(x) __builtin_bswap64(x)

And this change in test/RingBufferTest.cpp was necessary as well to compile:

 #include <iostream>
 #include <algorithm>
+#include <numeric>
 #include "gtest/gtest.h"
 #include "RingBuffer.hpp"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants