Bug 1835441 - /usr/include/c++/10/stdlib.h needed by /usr/include/c++/10/cstdlib cannot be found
Summary: /usr/include/c++/10/stdlib.h needed by /usr/include/c++/10/cstdlib cannot be ...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: qt5
Version: 32
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-13 19:18 UTC by jt@obs-sec.com
Modified: 2020-05-15 13:26 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-05-15 13:26:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description jt@obs-sec.com 2020-05-13 19:18:40 UTC
Description of problem:

When building a Qt application, a compile failure occurs because an include of cstdlib cannot be found, even though its in the same directory as cstdlib which was obviously found.

This may be the fault of something other than GCC, but it's the closest I could think of.  Please correct to the proper component if necessary. 

Version-Release number of selected component (if applicable):

F32 - KDE Spin

How reproducible:

I've run into this on every install I have done of F32 KDE. 

Steps to Reproduce:
1. Do default install of F32-KDE
3. DNF install necessary build tools.
4. Clone Lumina-Desktop Repository
5. Attempt to compile.

Actual results:

When compiling:
In file included from /usr/include/c++/10/bits/stl_algo.h:59,
                 from /usr/include/c++/10/algorithm:62,
                 from /usr/include/qt5/QtCore/qglobal.h:142,
                 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 ../libLumina/ResizeMenu.h 10,
                 from ../libLumina/ResizeMenu.cpp:7:
/usr/include/c++/10/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
   75 | #include_next <stdlib.h>
      |               ^~~~~~~~~~
compilation terminated.


Expected results:

I expect that an include for cstdlib that exists in the same directory as cstdlib would be found.

Additional info:

[q5sys@localhost lumina]$ find /usr -name stdlib.h
/usr/include/c++/10/tr1/stdlib.h
/usr/include/c++/10/stdlib.h
/usr/include/bits/stdlib.h
/usr/include/stdlib.h

[q5sys@localhost lumina]$ find /usr -name cstdlib
/usr/include/c++/10/tr1/cstdlib
/usr/include/c++/10/cstdlib

It finds cstdlib but cant find stdlib.h even though they're side by side.

Comment 1 Jonathan Wakely 2020-05-13 23:11:03 UTC
Because it's using #include_next and that's how it works:
https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html

It's supposed to find /usr/include/stdlib.h so if it isn't, it suggests you've messed up the include paths, probably by using -isystem /usr/include (so don't do that).

Comment 2 jt@obs-sec.com 2020-05-13 23:33:34 UTC
All I ever do on other distros and all I did on Fedora is enter the project directory and run qmake && make install.  My own qt source files only ever use something like: #include "ResizeMenu.h"
Would qmake be doing something different on Fedora than what I'm used to?
This is my first attempt at building this on Fedora in five years.  And as I mentioned, this is a fresh install with the dev packages installed and then a repo cloned.  I dont see how I could have messed up my include paths from simply installing required dev packages with DNF.  I dont run into this problem on Arch, Void, or Slackware... and I'm taking the same steps.  If I'm at fault, ok, I'm willing to learn what I need to do differently on Fedora.

Comment 3 jt@obs-sec.com 2020-05-13 23:40:13 UTC
Here's the specific file that shows my includes: 
https://github.com/lumina-desktop/lumina/blob/master/src-qt5/core/libLumina/ResizeMenu.h
https://github.com/lumina-desktop/lumina/blob/master/src-qt5/core/libLumina/ResizeMenu.cpp

What happens further down the include stack (or up, depending on your perspective) from what I have in my qt source files that would be changing compile flags; I'm not not 100% sure of.

Comment 4 Jonathan Wakely 2020-05-14 09:08:15 UTC
(In reply to jt from comment #0)
> Steps to Reproduce:
> 1. Do default install of F32-KDE
> 3. DNF install necessary build tools.
> 4. Clone Lumina-Desktop Repository
> 5. Attempt to compile.

This is not enough information for anybody to reproduce the problem you're seeing. What are the "necessary build tools"? How do you "Attempt to compile"?


(In reply to jt from comment #2)
> All I ever do on other distros and all I did on Fedora is enter the project
> directory and run qmake && make install.  My own qt source files only ever
> use something like: #include "ResizeMenu.h"

Neither is this.

GCC's headers work for everybody else, so we need to know what you're doing differently.

Comment 5 jt@obs-sec.com 2020-05-14 17:09:27 UTC
This is my entire shell history after doing a fresh install of Fedora-KDE-Live-x86_64-32-1.6 

[q5sys@localhost lumina]$ history
    1  sudo dnf groupinstall "Development Tools"
    2  sudo dnf install git qt5-qtbase qt5-qtwebkit qt5-qtwebkit-devel qt5-qtwebengine qt5-qtwebengine-devel qt5-qtwebengine-devtools qt5-qtx11extras qt5-qtx11extras-devel qt5-qtsvg qt5-qtsvg-devel qt5-qtmultimedia qt5-qtmultimedia-devel qt5-qttools qt5-qttools-devel qt5ct libqtxdg libqtxdg-devel qterminal qt-creator
    3  mkdir git
    4  cd git
    5  git clone http://github.com/Lumina-Desktop/lumina.git
    6  cd lumina/
    7  /usr/lib64/qt5/bin/qmake
    8  make
    9  history
[q5sys@localhost lumina]$

That is ALL I have done.

Comment 6 Jakub Jelinek 2020-05-14 17:29:42 UTC
So, one of those is buggy, either lumina, or some qt packages it uses, but that doesn't make it a gcc bug.

Comment 7 jt@obs-sec.com 2020-05-14 17:32:43 UTC
Ok, thanks for the feedback. Can I change the component on this over to qt or does that require someone from the component team to do it?

Comment 8 Jakub Jelinek 2020-05-14 17:34:38 UTC
Try it.  If it won't work, I can change it for you.

Comment 9 Jonathan Wakely 2020-05-15 06:40:37 UTC
Thank you, those are exactly (In reply to jt from comment #5)
> That is ALL I have done.

Thank you, that's what we needed you to show. Just saying "install necessary build tools" assumes everybody knows what's necessary for some repo on github, or wants to figure it out for themselves.

The g++ command that fails is:

g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DPREFIX=QString\(\"/usr\"\) -DL_ETCDIR=QString\(\"/etc\"\) -DL_SHAREDIR=QString\(\"/usr/share\"\) -DGIT_VERSION="\"82901d36\"" -DQT_NO_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -DQT_MULTIMEDIA_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -I../libLumina -isystem /usr/include/qt5 -I/usr -isystem /usr/include -I/tmp/lumina/src-qt5/core/lumina-desktop -I../../src-cpp -Isrc-screensaver -isystem /usr/include/qt5/QtMultimediaWidgets -isystem /usr/include/qt5/QtSvg -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtX11Extras -isystem /usr/include/qt5/QtMultimedia -isystem /usr/include/qt5/QtQuick -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtQml -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtConcurrent -isystem /usr/include/qt5/QtCore -I.build/moc -isystem /usr/include/libdrm -I.build/ui -I/usr/lib64/qt5/mkspecs/linux-g++ -o .build/obj/ResizeMenu.o ../libLumina/ResizeMenu.cpp

Which just like I guessed, says -isystem /usr/include

Comment 10 jt@obs-sec.com 2020-05-15 13:25:36 UTC
I'm going to go ahead and close this ticket as after doing a bit more research with QT it appears to be an upstream issue.

https://bugreports.qt.io/browse/QTBUG-53367
https://bugreports.qt.io/browse/QTBUG-53375

Qt says its a 3rd party application issue, but it occurs with their own packages in some cases.  So whatever the root cause and solution will be, its not a RH or Fedora issue.
Thanks for your help and giving me other ideas to think about.


Note You need to log in before you can comment on or make changes to this bug.