Project

General

Profile

Actions

Emulator Issues #11780

closed

Failure to build on Musl

Added by PureTryOut almost 5 years ago. Updated about 1 month ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
Linux
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Dolphin currently is impossible to build on Musl based systems like Alpine Linux due to using non-POSIX functions.

/usr/bin/c++  -DDATA_DIR=\"/usr/share/dolphin-emu/\" -DHAVE_BLUEZ=1 -DHAVE_EGL=1 -DHAVE_FFMPEG -DHAVE_HIDAPI=1 -DHAVE_LIBEVDEV=1 -DHAVE_LIBUDEV=1 -DHAVE_X11=1 -DHAVE_XRANDR=0 -DUSE_ANALYTICS=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -DUSE_UPNP -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -D__LIBUSB__ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I../Source/Core -I../Externals/enet/include -I../External/minizip -I/usr/include/libpng16 -I../Externals -I/usr/include/libusb-1.0 -ISource/Core -I../Externals/fmt/include -I../Externals/cubeb/include -Iexports -I../Externals/Bochs_disasm -isystem /usr/include/hidapi -Os -fomit-frame-pointer -O2 -g -DNDEBUG   -msse2 -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -std=c++17 -MD -MT Source/Core/Core/CMakeFiles/core.dir/HW/WiimoteReal/IOLinux.cpp.o -MF Source/Core/Core/CMakeFiles/core.dir/HW/WiimoteReal/IOLinux.cpp.o.d -o Source/Core/Core/CMakeFiles/core.dir/HW/WiimoteReal/IOLinux.cpp.o -c ../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp: In member function 'virtual int WiimoteReal::WiimoteLinux::IORead(u8*)':
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:227:3: error: 'fd_set' was not declared in this scope
   fd_set fds;
   ^~~~~~
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:227:3: note: suggested alternative: 'tzset'
   fd_set fds;
   ^~~~~~
   tzset
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:228:12: error: 'fds' was not declared in this scope
   FD_ZERO(&fds);
            ^~~
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:228:12: note: suggested alternative: 'ffs'
   FD_ZERO(&fds);
            ^~~
            ffs
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:228:3: error: 'FD_ZERO' was not declared in this scope
   FD_ZERO(&fds);
   ^~~~~~~
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:228:3: note: suggested alternative: 'CPU_ZERO'
   FD_ZERO(&fds);
   ^~~~~~~
   CPU_ZERO
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:229:3: error: 'FD_SET' was not declared in this scope
   FD_SET(m_int_sock, &fds);
   ^~~~~~
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:229:3: note: suggested alternative: 'L_SET'
   FD_SET(m_int_sock, &fds);
   ^~~~~~
   L_SET
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:232:7: error: 'select' was not declared in this scope
   if (select(m_int_sock + 1, &fds, nullptr, nullptr, nullptr) == -1)
       ^~~~~~
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:232:7: note: suggested alternative: 'setenv'
   if (select(m_int_sock + 1, &fds, nullptr, nullptr, nullptr) == -1)
       ^~~~~~
       setenv
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:238:7: error: 'FD_ISSET' was not declared in this scope
   if (FD_ISSET(m_wakeup_pipe_r, &fds))
       ^~~~~~~~
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:238:7: note: suggested alternative: 'CPU_ISSET'
   if (FD_ISSET(m_wakeup_pipe_r, &fds))
       ^~~~~~~~
       CPU_ISSET
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:248:8: error: 'FD_ISSET' was not declared in this scope
   if (!FD_ISSET(m_int_sock, &fds))
        ^~~~~~~~
../Source/Core/Core/HW/WiimoteReal/IOLinux.cpp:248:8: note: suggested alternative: 'CPU_ISSET'
   if (!FD_ISSET(m_int_sock, &fds))
        ^~~~~~~~
        CPU_ISSET

Files

build.log (248 KB) build.log PureTryOut, 06/27/2019 06:32 PM
build.log (240 KB) build.log PureTryOut, 06/28/2019 02:19 PM
Actions #1

Updated by Shiz almost 5 years ago

This seems to be more an issue of missing includes: all these types and macros are defined in , which other libc implementations may implicitly include in one of their other headers and as such work by coincidence.

Does it work if you add an #include stanza at the top of said file?

Actions #2

Updated by Shiz almost 5 years ago

Redmine ate my angle brackets -- the file in question is sys/select.h, to clarify.

Actions #3

Updated by PureTryOut almost 5 years ago

That did seem to fix this particular issue. Now a new one appeared though:

/usr/bin/c++  -DDATA_DIR=\"/usr/share/dolphin-emu/\" -DHAVE_EGL=1 -DHAVE_FFMPEG -DHAVE_LIBEVDEV=1 -DHAVE_LIBUDEV=1 -DHAVE_X11=1 -DHAVE_XRANDR=0 -DUSE_ANALYTICS=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -DUSE_UPNP -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -D__LIBUSB__ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I../Source/Core -I../Externals/enet/include -I../External/minizip -I/usr/include/libpng16 -I../Externals -I/usr/include/libusb-1.0 -ISource/Core -I../Externals/fmt/include -I../Externals/cpp-optparse/. -I../Externals/minizip/. -I../Externals/Bochs_disasm -Os -fomit-frame-pointer -O2 -g -DNDEBUG   -msse2 -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -std=c++17 -MD -MT Source/Core/UICommon/CMakeFiles/uicommon.dir/UICommon.cpp.o -MF Source/Core/UICommon/CMakeFiles/uicommon.dir/UICommon.cpp.o.d -o Source/Core/UICommon/CMakeFiles/uicommon.dir/UICommon.cpp.o -c ../Source/Core/UICommon/UICommon.cpp
../Source/Core/UICommon/UICommon.cpp:371:24: error: variable or field 'EnableScreenSaver' declared void
 void EnableScreenSaver(Window win, bool enable)
                        ^~~~~~
../Source/Core/UICommon/UICommon.cpp:371:24: error: 'Window' was not declared in this scope
../Source/Core/UICommon/UICommon.cpp:371:24: note: suggested alternative: 'rindex'
 void EnableScreenSaver(Window win, bool enable)
                        ^~~~~~
                        rindex
../Source/Core/UICommon/UICommon.cpp:371:36: error: expected primary-expression before 'bool'
 void EnableScreenSaver(Window win, bool enable)
                                    ^~~~
Actions #4

Updated by Shiz almost 5 years ago

Looks like a typo in UICommon.cpp:371:

#if defined(HAVE_XRANDR) && HAVE_X11

should be

#if defined(HAVE_XRANDR) && HAVE_XRANDR

Does that fix it?

Actions #5

Updated by PureTryOut almost 5 years ago

It did indeed, I also needed to change the same thing on line 379 in that file.

Next error, we're getting there!:

/usr/bin/c++  -DDATA_DIR=\"/usr/share/dolphin-emu/\" -DHAVE_EGL=1 -DHAVE_FFMPEG -DHAVE_LIBEVDEV=1 -DHAVE_LIBUDEV=1 -DHAVE_X11=1 -DHAVE_XRANDR=0 -DUSE_ANALYTICS=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -DUSE_UPNP -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -D__LIBUSB__ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I../Source/Core -I../Externals/enet/include -I../External/minizip -I/usr/include/libpng16 -I../Externals -I/usr/include/libusb-1.0 -ISource/Core -I../Externals/fmt/include -I../Externals/cubeb/include -Iexports -I../Externals/cpp-optparse/. -I../Externals/minizip/. -isystem /usr/include/hidapi -Os -fomit-frame-pointer -O2 -g -DNDEBUG   -msse2 -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -std=c++17 -MD -MT Source/Core/DolphinNoGUI/CMakeFiles/dolphin-nogui.dir/PlatformX11.cpp.o -MF Source/Core/DolphinNoGUI/CMakeFiles/dolphin-nogui.dir/PlatformX11.cpp.o.d -o Source/Core/DolphinNoGUI/CMakeFiles/dolphin-nogui.dir/PlatformX11.cpp.o -c ../Source/Core/DolphinNoGUI/PlatformX11.cpp
../Source/Core/DolphinNoGUI/PlatformX11.cpp: In member function 'virtual bool {anonymous}::PlatformX11::Init()':
../Source/Core/DolphinNoGUI/PlatformX11.cpp:96:5: error: 'XTextProperty' was not declared in this scope
     XTextProperty wmClientMachine = {reinterpret_cast<unsigned char*>(host_name), XA_STRING, 8,
     ^~~~~~~~~~~~~
../Source/Core/DolphinNoGUI/PlatformX11.cpp:96:5: note: suggested alternative: 'XDeleteProperty'
     XTextProperty wmClientMachine = {reinterpret_cast<unsigned char*>(host_name), XA_STRING, 8,
     ^~~~~~~~~~~~~
     XDeleteProperty
../Source/Core/DolphinNoGUI/PlatformX11.cpp:98:47: error: 'wmClientMachine' was not declared in this scope
     XSetWMClientMachine(m_display, m_window, &wmClientMachine);
                                               ^~~~~~~~~~~~~~~
../Source/Core/DolphinNoGUI/PlatformX11.cpp:98:47: note: suggested alternative: 'ClientMessage'
     XSetWMClientMachine(m_display, m_window, &wmClientMachine);
                                               ^~~~~~~~~~~~~~~
                                               ClientMessage
../Source/Core/DolphinNoGUI/PlatformX11.cpp:98:5: error: 'XSetWMClientMachine' was not declared in this scope
     XSetWMClientMachine(m_display, m_window, &wmClientMachine);
     ^~~~~~~~~~~~~~~~~~~
Actions #6

Updated by Shiz almost 5 years ago

Edit the top include section:

#include
#include
#include
#include "UICommon/X11Utils.h"

to include

#include

in that file. That should fix it.

Actions #7

Updated by Shiz almost 5 years ago

Agh, forgot about the angle brackets again. The missing include is X11/Xutil.h.

Actions #8

Updated by Billiard26 about 1 month ago

  • Status changed from New to Fixed
  • Operating system Linux added
  • Operating system deleted (N/A)

The mentioned HAVE_X11 typos have been fixed. Assuming fixed. Will re-open upon request.

Actions

Also available in: Atom PDF