Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm experiencing this problem as well, using gcc 8.2.0 on Slackware64-current, working with the svn code for 0 A.D. (as a minor contributor)
Quote:
andy@demeter:~/src/0ad/trunk/build/workspaces/gcc$ make
==== Building mocks_real (release) ====
mocks_real.cpp
In file included from ../../../source/lib/sysdep/stl.h:32,
from ../../../source/lib/precompiled.h:68,
from ../../../source/mocks/mocks_real.cpp:26:
/usr/include/c++/8.2.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[1]: *** [mocks_real.make:123: obj/mocks_real_Release/mocks_real.o] Error 1
make: *** [Makefile:141: mocks_real] Error 2
This is all due to GCC's intrinsic complexity when it comes to C++. #include_next works
even less when you use an unusual directory layout. Note that with C I do not have this
problem AT ALL - all works fine via C, including my unusual directory layout. But with
C++ nope - it wants to search the directory where it put the cstdlib part and the
pre-generated "stdlib.h" which is different from glibc, so of course that does not work
and it fails like crazy.
In my opinion the madness started with fixincludes, and people should instead FAIL HARD
rather than try to make things work by "fixing" something which only leads up to more
breakage lateron down the road. Very annoying.
This is nasty error imo. Found it only on an attempt to build pcre-8.43 for aarch64/arm64 for my Rock64 board. Configue cmd goes fine but error with/wo jit (can't find a patch).
Code:
from pcrecpp_unittest.cc:44:
/usr/include/c++/9.2.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
75 | #include_next <stdlib.h>
| ^~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:2391: pcrecpp_unittest-pcrecpp_unittest.o] Error 1
Arch arm uses a patch for loop in their pcre PKGBUILD. I can't decipher it for blfs use however.
Google gives almost nothing on this but it has happened at gentoo. Ideas to get pcre to compile?
That's supposed to be finding stdlib.h in /usr/include (glibc's stdlib.h). That's why they are using #include_next in gcc's cstdlib rather than #include which would find stdlib.h in same directory.
It should be there if using glibc and not some other C library. Verify that your glibc installation is intact.
Thks Grogan for a clear answer. It is possible its my glibc since this is a build that has no precedent other than rpi-pilfs which I used as a guide with ubu-bionic-armbian as host. Somehow -isystem is in the ggc 9 config and it was told to me by a gcc guy in irc chan that that setting confuses the lib/header search order functions. Main sysd-lfs does not use it and I dont see how it got in my build or how to prevent it or get around it. Weird thing is all the other pkgs built up to pcre in blfs.
I'll run some glic tests other than just the one in the book which passed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.