Problems compiling on Raspberry Pi

Need help with MPD?
Post Reply
drtebi
Posts: 1
Joined: August 24th, 2019, 11:39 am

Problems compiling on Raspberry Pi

Post by drtebi » August 24th, 2019, 11:49 am

Hello,

I am running piCore on my Raspberry Pi and am trying to install the latest mpd.

I thought I had everything to get the compilation going:
- gcc (piCore) 7.1.0
- meson 0.51.1
- ninja 1.9.0
- boost 1.61
- pkg-config 0.29.1

Also python 3.5

Building the source tree worked:

Code: Select all

meson . output/release --buildtype=debugoptimized -Db_ndebug=true
But when I run:

Code: Select all

ninja -C output/release
I get the following errors:

Code: Select all

ninja: Entering directory `output/release'
[1/492] Compiling C++ object 'src/util/ed6d25d@@util@sta/Exception.cxx.o'.
FAILED: src/util/ed6d25d@@util@sta/Exception.cxx.o
c++ -Isrc/util/ed6d25d@@util@sta -Isrc/util -I../../src/util -Isrc -I../../src -I. -I../../ -fdiagnostics-color=always -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -Wall -Wextra -fvisibility=hidden -ffast-math -ftree-vectorize -fno-threadsafe-statics -fmerge-all-constants -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -Wno-non-virtual-dtor -Wno-noexcept-type -D_GNU_SOURCE -O2 -fno-exceptions -fno-rtti -fPIC -MD -MQ 'src/util/ed6d25d@@util@sta/Exception.cxx.o' -MF 'src/util/ed6d25d@@util@sta/Exception.cxx.o.d' -o 'src/util/ed6d25d@@util@sta/Exception.cxx.o' -c ../../src/util/Exception.cxx
../../src/util/Exception.cxx: In function 'std::__cxx11::string GetFullMessage(std::__exception_ptr::exception_ptr, const char*, const char*)':
../../src/util/Exception.cxx:66:33: error: exception handling disabled, use -fexceptions to enable
  } catch (const std::exception &e) {
                                 ^
../../src/util/Exception.cxx:67:25: error: 'e' was not declared in this scope
   return GetFullMessage(e, fallback, separator);
                         ^
../../src/util/Exception.cxx:67:25: note: suggested alternative: 'ep'
   return GetFullMessage(e, fallback, separator);
                         ^
                         ep
../../src/util/Exception.cxx:69:25: error: 'ne' was not declared in this scope
   return GetFullMessage(ne.nested_ptr(), fallback, separator);
                         ^~
../../src/util/Exception.cxx:66:4: error: '...' handler must be the last handler for its try block [-fpermissive]
  } catch (const std::exception &e) {
    ^~~~~
../../src/util/Exception.cxx:68:4: error: '...' handler must be the last handler for its try block [-fpermissive]
  } catch (const std::nested_exception &ne) {
    ^~~~~
../../src/util/Exception.cxx: In instantiation of 'void AppendNestedMessage(std::__cxx11::string&, T&&, const char*, const char*) [with T = const std::exception&; std::__cxx11::string = std::__cxx11::basic_string<char>]':
../../src/util/Exception.cxx:56:52:   required from here
../../src/util/Exception.cxx:39:4: error: '...' handler must be the last handler for its try block [-fpermissive]
  } catch (const std::exception &nested) {
    ^~~~~
../../src/util/Exception.cxx:43:4: error: '...' handler must be the last handler for its try block [-fpermissive]
  } catch (const std::nested_exception &ne) {
    ^~~~~
../../src/util/Exception.cxx: In instantiation of 'void AppendNestedMessage(std::__cxx11::string&, T&&, const char*, const char*) [with T = const std::nested_exception&; std::__cxx11::string = std::__cxx11::basic_string<char>]':
../../src/util/Exception.cxx:44:22:   required from 'void AppendNestedMessage(std::__cxx11::string&, T&&, const char*, const char*) [with T = const std::exception&; std::__cxx11::string = std::__cxx11::basic_string<char>]'
../../src/util/Exception.cxx:56:52:   required from here
../../src/util/Exception.cxx:39:4: error: '...' handler must be the last handler for its try block [-fpermissive]
  } catch (const std::exception &nested) {
    ^~~~~
../../src/util/Exception.cxx:43:4: error: '...' handler must be the last handler for its try block [-fpermissive]
  } catch (const std::nested_exception &ne) {
    ^~~~~
In file included from /usr/include/c++/7.1.0/exception:143:0,
                 from ../../src/util/Exception.hxx:35,
                 from ../../src/util/Exception.cxx:30:
/usr/include/c++/7.1.0/bits/nested_exception.h: In instantiation of 'std::__rethrow_if_nested_cond<_Ex> std::__rethrow_if_nested_impl(const _Ex*) [with _Ex = std::exception; std::__rethrow_if_nested_cond<_Ex> = void]':
/usr/include/c++/7.1.0/bits/nested_exception.h:150:36:   required from 'void std::rethrow_if_nested(const _Ex&) [with _Ex = std::exception]'
../../src/util/Exception.cxx:38:25:   required from 'void AppendNestedMessage(std::__cxx11::string&, T&&, const char*, const char*) [with T = const std::exception&; std::__cxx11::string = std::__cxx11::basic_string<char>]'
../../src/util/Exception.cxx:56:52:   required from here
/usr/include/c++/7.1.0/bits/nested_exception.h:137:27: error: 'dynamic_cast' not permitted with -fno-rtti
       if (auto __ne_ptr = dynamic_cast<const nested_exception*>(__ptr))
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2/492] Compiling C++ object 'src/util/ed6d25d@@util@sta/Tokenizer.cxx.o'.
FAILED: src/util/ed6d25d@@util@sta/Tokenizer.cxx.o
c++ -Isrc/util/ed6d25d@@util@sta -Isrc/util -I../../src/util -Isrc -I../../src -I. -I../../ -fdiagnostics-color=always -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -Wall -Wextra -fvisibility=hidden -ffast-math -ftree-vectorize -fno-threadsafe-statics -fmerge-all-constants -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -Wno-non-virtual-dtor -Wno-noexcept-type -D_GNU_SOURCE -O2 -fno-exceptions -fno-rtti -fPIC -MD -MQ 'src/util/ed6d25d@@util@sta/Tokenizer.cxx.o' -MF 'src/util/ed6d25d@@util@sta/Tokenizer.cxx.o.d' -o 'src/util/ed6d25d@@util@sta/Tokenizer.cxx.o' -c ../../src/util/Tokenizer.cxx
../../src/util/Tokenizer.cxx: In member function 'char* Tokenizer::NextWord()':
../../src/util/Tokenizer.cxx:59:45: error: exception handling disabled, use -fexceptions to enable
   throw std::runtime_error("Letter expected");
                                             ^
[3/492] Compiling C++ object 'src/util/ed6d25d@@util@sta/TimeConvert.cxx.o'.
FAILED: src/util/ed6d25d@@util@sta/TimeConvert.cxx.o
c++ -Isrc/util/ed6d25d@@util@sta -Isrc/util -I../../src/util -Isrc -I../../src -I. -I../../ -fdiagnostics-color=always -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -Wall -Wextra -fvisibility=hidden -ffast-math -ftree-vectorize -fno-threadsafe-statics -fmerge-all-constants -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -Wno-non-virtual-dtor -Wno-noexcept-type -D_GNU_SOURCE -O2 -fno-exceptions -fno-rtti -fPIC -MD -MQ 'src/util/ed6d25d@@util@sta/TimeConvert.cxx.o' -MF 'src/util/ed6d25d@@util@sta/TimeConvert.cxx.o.d' -o 'src/util/ed6d25d@@util@sta/TimeConvert.cxx.o' -c ../../src/util/TimeConvert.cxx
../../src/util/TimeConvert.cxx: In function 'tm GmTime(std::chrono::_V2::system_clock::time_point)':
../../src/util/TimeConvert.cxx:49:47: error: exception handling disabled, use -fexceptions to enable
   throw std::runtime_error("gmtime_r() failed");
                                               ^
[4/492] Compiling C++ object 'src/util/ed6d25d@@util@sta/TimeParser.cxx.o'.
FAILED: src/util/ed6d25d@@util@sta/TimeParser.cxx.o
c++ -Isrc/util/ed6d25d@@util@sta -Isrc/util -I../../src/util -Isrc -I../../src -I. -I../../ -fdiagnostics-color=always -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -Wall -Wextra -fvisibility=hidden -ffast-math -ftree-vectorize -fno-threadsafe-statics -fmerge-all-constants -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -Wno-non-virtual-dtor -Wno-noexcept-type -D_GNU_SOURCE -O2 -fno-exceptions -fno-rtti -fPIC -MD -MQ 'src/util/ed6d25d@@util@sta/TimeParser.cxx.o' -MF 'src/util/ed6d25d@@util@sta/TimeParser.cxx.o.d' -o 'src/util/ed6d25d@@util@sta/TimeParser.cxx.o' -c ../../src/util/TimeParser.cxx
../../src/util/TimeParser.cxx: In function 'std::chrono::_V2::system_clock::time_point ParseTimePoint(const char*, const char*
':
../../src/util/TimeParser.cxx:71:56: error: exception handling disabled, use -fexceptions to enable
   throw std::runtime_error("Failed to parse time stamp");
                                                        ^
[6/492] Generating GitVersion.cxx with a custom command.
ninja: build stopped: subcommand failed.
All seems to be related to exception handling?

I am not a Linux newbie, however, I don't know too much about compiling....

If anyone could give me a clue of what's going on, that would be great :)

max
Forum team
Posts: 922
Joined: January 15th, 2013, 3:43 pm

Re: Problems compiling on Raspberry Pi

Post by max » August 25th, 2019, 4:18 pm

I see you used the compiler flags "-fno-exceptions -fno-rtti". Where do those come from? That's what breaks your build.

Post Reply