LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problems with compiling the M4 packet for my LFS system (LFS 10.1) (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-compiling-the-m4-packet-for-my-lfs-system-lfs-10-1-a-4175699442/)

Luxvoo 08-20-2021 08:46 AM

Problems with compiling the M4 packet for my LFS system (LFS 10.1)
 
Hello.

I'm quite new to LFS systems and this is my second one. When I try to compile the M4 packet I get this error:

mnt/sys/usr/include/bits/stdlib.h: In function 'wctomb':
/mnt/sys/usr/include/bits/stdlib.h:94:3: error: #error "Assumed value of MB_LEN_MAX wrong"
94 | # error "Assumed value of MB_LEN_MAX wrong"
| ^~~~~

Can you explain what this error is and how to fix it?
Thank you!

hazel 08-22-2021 04:32 AM

The stdlib.h header is part of glibc, so you have a glibc incompatibility there. The first question to ask is what chapter are you on? That's the first thing you always have to tell us if you want help with LFS because most LFS software gets built twice: once as part of the toolkit and then a final build using the tools.

My guess is that this is the first build of M4 in Chapter 6, because that comes immediately after building glibc but I could be wrong. If you are already on Chapter 8, then something is badly wrong with your build and you will have to scrap it and start again.

If you are in Chapter 6, the likeliest thing is that you have skipped setting limits.h at the end of the gcc chapter 5.3. It's rather easy to do that. I did it once. You could try setting it now, then rebuild M4 and hope it works this time, but it would probably be safer to start again from the beginning.

GentleThotSeaMonkey 08-22-2021 12:53 PM

Welcome to LQ! I know zero about this, but web-searching your quoted error with intitle:lfs finds:
Quote:

Package-specific errors

M4: Assumed value of MB_LEN_MAX wrong

This error message usually indicates that limits.h provided by GCC isn't including limits.h from Glibc as it should be. There are two commands as a workaround for limits.h in Chapter 5, one in GCC Pass 1 and another in Glibc. Forgetting any of them will lead to this issue. You can rerun the forgotten commands (untar GCC tarball if necessary) and retry to build M4. Note that if you forgot the command in GCC Pass 1, you'll have to rerun both of these two workarounds, as the workaround in Glibc copies from the file created in the workaround in GCC Pass 1.
https://www.linuxfromscratch.org/lfs/faq.html

CopBlockDev 02-08-2024 02:52 PM

Well, looks like it is back to ch5 for me.
 
Thanks for posting this. I'm glad I'm doing this as a docker project so I don't have to do all that crap by hand again ...


All times are GMT -5. The time now is 10:19 AM.