Opened 3 years ago

Closed 2 months ago

#13085 closed Bug Report - General (Won't Fix)

Fedora 24 -> 26: RPM build error: fatal error: stdlib.h: No such file or directory

Reported by: udovdh@… Owned by:
Priority: minor Milestone: unknown
Component: Packaging Version: 0.28.1
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Another issue that popped up after the Fedora 24 -> Fedora 26 upgrade is this one. After being able to compile 0.27.6 without issue I checked out fixes/0.28. Trying to build 0.28 gives the error pasted below. When I replace all -isystem mentions by -I in all Makefiles the compilation succeeds.

make[2]: Entering directory '/usr/src/redhat/BUILD/mythtv-0.28.1/mythtv/external/libmythsoundtouch'
g++ -c -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -march=k8 -mtune=k8 -msse -msse2 -msse3 -m3dnow -O2 -g -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-stron
g --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -fomit-frame-pointer -fPIC -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -pthread -Wpointer-arith -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -fvisibility-
inlines-hidden -Wmissing-declarations -Wno-switch -Woverloaded-virtual -funit-at-a-time -fPIC -std=gnu++11 -w -D_REENTRANT -DMMX -Dusing_libcec -D_GNU_SOURCE -DALLOW_SSE2 -DALLOW_SSE3 -I. -isystem /usr/inclu
de/libxml2 -isystem /usr/include -I. -I../.. -I/usr/lib64/qt5/mkspecs/linux-g++ -o AAFilter.o AAFilter.cpp
g++ -c -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -march=k8 -mtune=k8 -msse -msse2 -msse3 -m3dnow -O2 -g -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-stron
g --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -fomit-frame-pointer -fPIC -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -pthread -Wpointer-arith -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -fvisibility-
inlines-hidden -Wmissing-declarations -Wno-switch -Woverloaded-virtual -funit-at-a-time -fPIC -std=gnu++11 -w -D_REENTRANT -DMMX -Dusing_libcec -D_GNU_SOURCE -DALLOW_SSE2 -DALLOW_SSE3 -I. -isystem /usr/inclu
de/libxml2 -isystem /usr/include -I. -I../.. -I/usr/lib64/qt5/mkspecs/linux-g++ -o FIRFilter.o FIRFilter.cpp
In file included from /usr/include/c++/7/ext/string_conversions.h:41:0,
                 from /usr/include/c++/7/bits/basic_string.h:6159,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from FIRFilter.cpp:46:
/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:369: FIRFilter.o] Error 1
make[2]: Leaving directory '/usr/src/redhat/BUILD/mythtv-0.28.1/mythtv/external/libmythsoundtouch'
make[1]: *** [Makefile:66: libmythsoundtouch-all] Error 2
make[1]: *** Waiting for unfinished jobs....

Change History (10)

comment:1 Changed 3 years ago by udovdh@…

It looks like only -isystem /usr/include needs to be changed into -I /usr/include. (i.e.: not all -isystem but this needs further testing)

comment:2 Changed 3 years ago by J.Pilk@…

I had built rpms of 30pre3 for my SL7x and f25 boxes, and realised that I ought to be able to do the same for f26. It worked - but I don't have an f26 box. The others are working fine.

$ mock -r fedora-25-x86_64-rpmfusion_free --buildsrpm --spec mythtvmasterexfusion30pre3mock.spec --sources=../SOURCES

$ mock -r fedora-26-x86_64-rpmfusion_nonfree --rebuild mythtv-master-30.3.a.fc25.src.rpm

I don't think the _nonfree repo is needed, but this was a test. For some reason the SL7x build pulled in a couple of nvidia-related packages, but the log shows none here.

comment:3 Changed 3 years ago by udovdh@…

I received a tip from Jonatan Lindblad to remove the line as shown at https://github.com/MythTV/packaging/blob/master/rpm/mythtv.spec#L931. This change makes mythtv compile but not yet the plugins that still fail with the stdlib.h error.

For the plugins an INCLUDEPATH is modified during the rpmbuild process: + echo 'INCLUDEPATH -= $${PREFIX}/include' + echo 'INCLUDEPATH -= $${SYSROOT}/$${PREFIX}/include' + echo 'INCLUDEPATH -= /usr/include' + echo 'INCLUDEPATH += /root/rpmbuild/BUILD/mythtv-0.28.1/temp/usr/include' + echo 'INCLUDEPATH += /usr/include'

In the resulting lines during the compile we can see that Qmake treats /usr/include differently from /root/rpmbuild/BUILD/mythtv-0.28.1/temp/usr/include w.r.t -isystem and -I. How can we influence this behaviour?

comment:4 Changed 3 years ago by udovdh@…

Or can someone please explain why the include-files on Fedora 26 do not work in a way that stdlib.h is found when configureing with -isystem stdlib.h ?

comment:5 Changed 3 years ago by martin.bantz@…

Does not compile on PCLinuxOS either - here trying 29.0

Quote from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129: "The real problem here is that "-isystem /usr/include" changes the include search path in a way that is incompatible with "-I /usr/include""

echo '#include <cstdlib>' > try.cc

g++ -c try.cc

g++ -I /usr/include -c try.cc

g++ -isystem /usr/include -c try.cc

In file included from try.cc:1:0: /usr/include/c++/7.2.1/cstdlib:75:15: fatal fejl: stdlib.h: Ingen sådan fil eller filkatalog

#include_next <stdlib.h>

~

comment:6 Changed 3 years ago by Jonatan Lindblad

Component: MythTV - GeneralPackaging

comment:7 in reply to:  3 Changed 3 years ago by Jonatan Lindblad

Replying to udovdh@…:

I received a tip from Jonatan Lindblad to remove the line as shown at https://github.com/MythTV/packaging/blob/master/rpm/mythtv.spec#L931. This change makes mythtv compile but not yet the plugins that still fail with the stdlib.h error.

For the plugins an INCLUDEPATH is modified during the rpmbuild process: + echo 'INCLUDEPATH -= $${PREFIX}/include' + echo 'INCLUDEPATH -= $${SYSROOT}/$${PREFIX}/include' + echo 'INCLUDEPATH -= /usr/include' + echo 'INCLUDEPATH += /root/rpmbuild/BUILD/mythtv-0.28.1/temp/usr/include' + echo 'INCLUDEPATH += /usr/include'

In the resulting lines during the compile we can see that Qmake treats /usr/include differently from /root/rpmbuild/BUILD/mythtv-0.28.1/temp/usr/include w.r.t -isystem and -I. How can we influence this behaviour?

You have to modify the spec file so that /usr/include never ends up in the INCLUDEPATH variable. Then it should work.

comment:8 Changed 2 years ago by udovdh@…

I commented out lines 1004 and 1005 from the spec file: https://github.com/MythTV/packaging/blob/master/rpm/mythtv.spec#L1004

This did not fix the issue:

# cd /usr/src/redhat/BUILD/mythtv-0.28.2/mythplugins/
# make
cd mytharchive/ && ( test -e Makefile || /usr/bin/qmake-qt5 -o Makefile /usr/src/redhat/BUILD/mythtv-0.28.2/mythplugins/mytharchive/mytharchive.pro QMAKE=/usr/bin/qmake-qt5 ) && make -f Makefile 
make[1]: Entering directory '/usr/src/redhat/BUILD/mythtv-0.28.2/mythplugins/mytharchive'
cd mytharchive/ && ( test -e Makefile || /usr/bin/qmake-qt5 -o Makefile /usr/src/redhat/BUILD/mythtv-0.28.2/mythplugins/mytharchive/mytharchive/mytharchive.pro QMAKE=/usr/bin/qmake-qt5 ) && make -f Makefile 
make[2]: Entering directory '/usr/src/redhat/BUILD/mythtv-0.28.2/mythplugins/mytharchive/mytharchive'
g++ -c -pipe -march=k8 -mtune=k8 -msse -msse2 -msse3 -m3dnow -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -fomit-frame-pointer -fomit-frame-pointer -fPIC -msse -pthread -g -Wall -Wpointer-arith -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -fvisibility-inlines-hidden -Wmissing-declarations -Wno-switch -Woverloaded-virtual -funit-at-a-time -fvisibility=hidden -fomit-frame-pointer -std=gnu++11 -D_REENTRANT -Wall -W -DPIC -fPIC -D_GNU_SOURCE -DPREFIX="/usr" -DMMX -Dusing_libcec -D_FILE_OFFSET_BITS=64 -DMPLUGIN_API -DQT_NO_DEBUG -DQT_PLUGIN -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/libxml2 -isystem /usr/include/X11 -I/root/rpmbuild/BUILD/mythtv-0.28.2/temp/usr/include -isystem /usr/include -I/root/rpmbuild/BUILD/mythtv-0.28.2/temp/usr/include/mythtv -I/root/rpmbuild/BUILD/mythtv-0.28.2/temp/usr/include/mythtv/libmythbase -I/root/rpmbuild/BUILD/mythtv-0.28.2/temp/usr/include/mythtv/libmythui -I/root/rpmbuild/BUILD/mythtv-0.28.2/temp/usr/include/mythtv/libmyth -I/root/rpmbuild/BUILD/mythtv-0.28.2/temp/usr/include/mythtv/libavformat -I/root/rpmbuild/BUILD/mythtv-0.28.2/temp/usr/include/mythtv/libswscale -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtOpenGL -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtXml -isystem /usr/include/qt5/QtSql -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib64/qt5/mkspecs/linux-g++ -o main.o main.cpp
In file included from /usr/include/c++/7/ext/string_conversions.h:41:0,
                 from /usr/include/c++/7/bits/basic_string.h:6349,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:8:
/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:796: main.o] Error 1
make[2]: Leaving directory '/usr/src/redhat/BUILD/mythtv-0.28.2/mythplugins/mytharchive/mytharchive'
make[1]: *** [Makefile:48: sub-mytharchive-make_first] Error 2
make[1]: Leaving directory '/usr/src/redhat/BUILD/mythtv-0.28.2/mythplugins/mytharchive'
make: *** [Makefile:46: sub-mytharchive-make_first] Error 2

comment:9 Changed 2 years ago by udovdh@…

Also this line needed to be commented out: https://github.com/MythTV/packaging/blob/master/rpm/mythtv.spec#L1008 After that change MythTV builds OK.

comment:10 Changed 2 months ago by Stuart Auchterlonie

Milestone: needs_triageunknown
Resolution: Won't Fix
Status: newclosed

Fedora 29 and below are EOL and Fedora 30 is due to EOL shortly. If this still occurs with either Fedora 31 or 32 then feel free to reopen.

Regards Stuart

Note: See TracTickets for help on using tickets.