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

Compile Error: ALLPERMS not defined in libc-musl #187

Closed
ConiKost opened this issue Feb 8, 2022 · 2 comments
Closed

Compile Error: ALLPERMS not defined in libc-musl #187

ConiKost opened this issue Feb 8, 2022 · 2 comments

Comments

@ConiKost
Copy link

ConiKost commented Feb 8, 2022

If QDirStat is being compiled on a system, which is using musl instead of glibc, compilation will fail, as musl is stricter than glibc here.

x86_64-gentoo-linux-musl-g++ -c -O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -Wno-deprecated -Wno-deprecated-declarations -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I.moc -I. -I/usr/lib/qt5/mkspecs/linux-g++ -o .obj/GeneralConfigPage.o GeneralConfigPage.cpp
FileInfo.cpp: In member function 'QString QDirStat::FileInfo::octalPermissions() const':
FileInfo.cpp:564:25: error: 'ALLPERMS' was not declared in this scope
  564 |     return formatOctal( ALLPERMS & _mode );
      |                         ^~~~~~~~
In file included from /usr/include/qt5/QtGui/qtguiglobal.h:44,
                 from /usr/include/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qapplication.h:43,
                 from /usr/include/qt5/QtWidgets/QApplication:1,
                 from ui_general-config-page.h:13,
                 from GeneralConfigPage.h:13,
                 from GeneralConfigPage.cpp:10:
/usr/include/qt5/QtGui/qtgui-config.h:26: warning: "QT_NO_IMAGEFORMAT_JPEG" redefined
   26 | #define QT_NO_IMAGEFORMAT_JPEG true
      | 
In file included from /usr/include/qt5/QtCore/qconfig.h:1,
                 from /usr/include/qt5/QtCore/qglobal.h:66,
                 from /usr/include/qt5/QtCore/qatomic.h:41,
                 from /usr/include/qt5/QtCore/qvariant.h:43,
                 from /usr/include/qt5/QtCore/QVariant:1,
                 from ui_general-config-page.h:12,
                 from GeneralConfigPage.h:13,
                 from GeneralConfigPage.cpp:10:
/usr/include/qt5/Gentoo/gentoo-qconfig.h:5: note: this is the location of the previous definition
    5 | #define QT_NO_IMAGEFORMAT_JPEG
      | 
x86_64-gentoo-linux-musl-g++ -c -O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -Wno-deprecated -Wno-deprecated-declarations -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I.moc -I. -I/usr/lib/qt5/mkspecs/linux-g++ -o .obj/HeaderTweaker.o HeaderTweaker.cpp
make[1]: *** [Makefile:1934: .obj/FileInfo.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/qt5/QtGui/qtguiglobal.h:44,
                 from /usr/include/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qmenu.h:43,
                 from /usr/include/qt5/QtWidgets/QMenu:1,
                 from HeaderTweaker.cpp:10:
/usr/include/qt5/QtGui/qtgui-config.h:26: warning: "QT_NO_IMAGEFORMAT_JPEG" redefined
   26 | #define QT_NO_IMAGEFORMAT_JPEG true
      | 
In file included from /usr/include/qt5/QtCore/qconfig.h:1,
                 from /usr/include/qt5/QtCore/qglobal.h:66,
                 from /usr/include/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qmenu.h:43,
                 from /usr/include/qt5/QtWidgets/QMenu:1,
                 from HeaderTweaker.cpp:10:
/usr/include/qt5/Gentoo/gentoo-qconfig.h:5: note: this is the location of the previous definition
    5 | #define QT_NO_IMAGEFORMAT_JPEG
      | 
FormatUtil.cpp: In function 'QString QDirStat::formatPermissions(mode_t)':
FormatUtil.cpp:117:61: error: 'ALLPERMS' was not declared in this scope
  117 |     return symbolicMode( mode, true ) + "  " + formatOctal( ALLPERMS & mode );
      |                                                             ^~~~~~~~
make[1]: *** [Makefile:2092: .obj/FormatUtil.o] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-apps/qdirstat-1.8/work/qdirstat-1.8/src'
make: *** [Makefile:51: sub-src-make_first-ordered] Error 2
@shundhammer
Copy link
Owner

shundhammer commented Feb 9, 2022

Well, no: Actually, musl is not stricter, libc-musl is simply incomplete; it's not at all a drop-in replacement for glibc, as this example shows.

To me it looks as if they reinvented the wheel with whatever noble intentions, but it's not exactly round; an octagon as an improved version of their intitial hexagon; but it's still a bumpy ride... ;-)

Expect more trouble on the way ahead. That's one reason why I put that #define in a new separate header file: I don't want to pollute my code with a ton of #ifdefs because of this kind of thing.

@shundhammer shundhammer changed the title FileInfo.cpp:564:25: error: ALLPERMS was not declared in this scope Compile Error: ALLPERMS not defined in libc-musl Feb 9, 2022
@ConiKost
Copy link
Author

ConiKost commented Feb 9, 2022

Thank you :-)

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

2 participants