LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 05-24-2020, 12:53 PM   #1
rsmereka
Member
 
Registered: Jul 2003
Location: Southwestern Ontario, Canada
Distribution: LFS, OpenBSD, UBPorts, MX, Gentoo
Posts: 85
Blog Entries: 3

Rep: Reputation: 17
LFS 9.1 i386 no-systemd 6.9 Glibc-2.31 'No module named msvcrt'


Hi All,

I am building LFS 9.1 i386 on a Lenovo x61s using MX Linux 18 i386 as the host. Chapter 5 built fine, no errors. I am near the beginning of chapter 6, building Glibc from section 6.9. I mounted the virtual file systems correctly from section 6.2.2. and chrooted correctly from 6.4.

I am getting what looks like a Python module ('subprocess.py') reporting 'msvcrt' module as not found. It appears as though the system type is being mis-identified. I have applied the Glibc patch and applied the case switch for LSB compliance, created the 'build' sub-directory and 'cd'ed into the build directory. In addition, I ran the 'configure' command without any errors.

The compile log output is:
Code:
make -r PARALLELMFLAGS="" -C .. objdir=`pwd` all
make[1]: Entering directory '/sources/glibc-2.31'

type "make help" for help with common glibc makefile targets

make  subdir=csu -C csu ..=../ subdir_lib
make[2]: Entering directory '/sources/glibc-2.31/csu'
python3 -B ../scripts/gen-as-const.py --cc="gcc -ffile-prefix-map=/tools=/usr -std=gnu11 -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -fmerge-all-constants -frounding-math -fstack-protector-strong -Wstrict-prototypes -Wold-style-definition -fmath-errno     -ftls-model=initial-exec      -I../include -I/sources/glibc-2.31/build/csu  -I/sources/glibc-2.31/build  -I../sysdeps/unix/sysv/linux/i386/i686  -I../sysdeps/i386/i686/nptl  -I../sysdeps/unix/sysv/linux/i386  -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86  -I../sysdeps/x86/nptl  -I../sysdeps/i386/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/i386  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/i386/i686/fpu/multiarch  -I../sysdeps/i386/i686/fpu  -I../sysdeps/i386/i686/multiarch  -I../sysdeps/i386/i686  -I../sysdeps/i386/fpu  -I../sysdeps/x86/fpu/include -I../sysdeps/x86/fpu  -I../sysdeps/i386  -I../sysdeps/x86  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/float128  -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem /tools/lib/gcc/i686-pc-linux-gnu/9.2.0/include -isystem /tools/lib/gcc/i686-pc-linux-gnu/9.2.0/include-fixed -isystem /usr/include -D_LIBC_REENTRANT -include /sources/glibc-2.31/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -DGEN_AS_CONST_HEADERS \
		   -MD -MP -MF /sources/glibc-2.31/build/tcb-offsets.h.dT \
		   -MT '/sources/glibc-2.31/build/tcb-offsets.h.d /sources/glibc-2.31/build/tcb-offsets.h'" \
	  ../sysdeps/i386/nptl/tcb-offsets.sym > /sources/glibc-2.31/build/tcb-offsets.hT
Traceback (most recent call last):
  File "/tools/lib/python3.8/subprocess.py", line 64, in <module>
    import msvcrt
ModuleNotFoundError: No module named 'msvcrt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "../scripts/gen-as-const.py", line 28, in <module>
    import glibcextract
  File "/sources/glibc-2.31/scripts/glibcextract.py", line 22, in <module>
    import subprocess
  File "/tools/lib/python3.8/subprocess.py", line 69, in <module>
    import _posixsubprocess
ModuleNotFoundError: No module named '_posixsubprocess'
make[2]: *** [../Makerules:271: /sources/glibc-2.31/build/tcb-offsets.h] Error 1
make[2]: Leaving directory '/sources/glibc-2.31/csu'
make[1]: *** [Makefile:470: csu/subdir_lib] Error 2
make[1]: Leaving directory '/sources/glibc-2.31'
make: *** [Makefile:9: all] Error 2
I would greatly appreciate any insights/suggestions as to how to correct this (if it is correctable).
 
Old 05-25-2020, 01:28 AM   #2
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
I suggest to rebuild python3 first as per chapter 5 first and try glibc as in chapter 6 again. You don't have to exit the chroot.
 
2 members found this post helpful.
Old 05-25-2020, 10:38 AM   #3
rsmereka
Member
 
Registered: Jul 2003
Location: Southwestern Ontario, Canada
Distribution: LFS, OpenBSD, UBPorts, MX, Gentoo
Posts: 85

Original Poster
Blog Entries: 3

Rep: Reputation: 17
Quote:
Originally Posted by hendrickxm View Post
I suggest to rebuild python3 first as per chapter 5 first and try glibc as in chapter 6 again. You don't have to exit the chroot.
Thanks for that,

Worked well for me.

+rep
 
1 members found this post helpful.
Old 06-07-2020, 02:07 PM   #4
richt
LQ Newbie
 
Registered: May 2020
Location: San Miguel de Allende, Mexico
Distribution: Fedora
Posts: 5

Rep: Reputation: Disabled
I had a similar problem with Section 6.9 related to Python 3 as I received the following error when executing the configure command:

Code:
checking for python3... no
checking for python... no
configure: error: 
*** These critical programs are missing or too old: python
*** Check the INSTALL file for required versions.
I thought the proposed solution of rebuilding python 3 as in Chapter 5 could also solve my problem. I changed to the sources directory, executed "tar -xvf Python-3.8.1.tar.xz", changed to the new Python-3.8.1 directory, and executed the sed and configure commands in Section 5.30. All seemed to go well with the configure command and the Makefile was created. However, when I executed the make command, I received a lot of the following kind of output:

Code:
(lfs chroot) root:/sources/Python-3.8.1# make
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c

... and ending with:

IndentationError: expected an indented block
make: *** [Makefile:614: sharedmods] Error 1
I expect rebuilding python may well solve my problem as it did the OP, but I'm clearly not rebuilding it correctly.

Any suggestions?
Thanks!
 
Old 06-07-2020, 03:45 PM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi richt

Are you by any chacce using a pdf copy of the book? if so use an html version, pdf has issue with copy and paste
 
1 members found this post helpful.
Old 06-07-2020, 07:30 PM   #6
richt
LQ Newbie
 
Registered: May 2020
Location: San Miguel de Allende, Mexico
Distribution: Fedora
Posts: 5

Rep: Reputation: Disabled
Hello Spiky0011,
I am using the pdf book, but yes learned that lesson early on the hard way. Now I'm always careful to copy and paste multiple line commands to a text editor first to clean it up. Then I scroll back up in the terminal just to confirm.
 
Old 06-08-2020, 11:08 AM   #7
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Just try copy and paste from html because that error looks like spacing in command error
 
1 members found this post helpful.
Old 06-09-2020, 07:03 PM   #8
richt
LQ Newbie
 
Registered: May 2020
Location: San Miguel de Allende, Mexico
Distribution: Fedora
Posts: 5

Rep: Reputation: Disabled
Well spiky0011, yet another humbling learning experience! I can't identify the difference between the commands I carefully cut and checked from the pdf and then again from the html page today, but it seems to have worked.

When I was reinstalling Python-3.8.1 following Section 5.30, after executing "make" I still received a number of lines of the following which suggested to me that I failed as before:

Code:
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.
...
However, I received the notification that "Python build finished successfully!" rather than the "Indentation Error" I'd received before. And this time I was able to execute make and make install.

Hoping I had successfully reinstalled python following 5.30, I went back to Section 6.9 to again try installing Glibc-2.31 (which had been my original problem as with this OP) and sure enough was able to complete it this time!

Thanks again!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
v8.4 LFS systemd - chpt 6.9 Glibc: Error during "make" No module named '_posixsubprocess' GeekBoy Linux From Scratch 15 06-23-2019 05:04 PM
problem installing glibc-2.3.2-4.80.i686, glibc-common-2.3.2-4.80.8.i386.rpm martianpackets Red Hat 8 05-01-2009 03:22 PM
(bind) named: couldn't open pid file '/var/run/named/named.pid' - any help? samengr Linux - Server 6 04-01-2009 06:22 AM
file /var/lib/named/var/named/reverse/named.zero failed: file not found Toadman Linux - Software 15 03-18-2009 07:01 PM
chown -R named:named /var/named crash the system? joangopan Fedora 2 09-09-2007 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 04:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration