I have been following the instructions of the LFS manual so far but have come to an error when making bash, I ran make in the bash-5.1 folder but it displayed an error at the end of the command output:

/mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/10.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: ./lib/sh/libsh.a(tmpfile.o): in function `sh_mktmpname':
/mnt/lfs/sources/bash-5.1/lib/sh/tmpfile.c:160: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
collect2: error: ld returned 1 exit status
make: *** [Makefile:583: bash] Error 1

All the commands I ran before this one have worked, I also ran echo $? and it outputted 2. I am on the latest version of manjaro.

  • 1
    What you've posted here is a warning... your ld error is something else that happened somewhere previously. It's always helpful to post the LFS Book version (10.1?) and the chapter/section you're currently on (6.4?). Additionally, please re-read help, specifically the section "Compilation Problems" which explains why the output you've posted here isn't enough to help you solve your problem. – rfmodulator May 7 at 0:53
  • ...also, something that often helps when tracking down an error is to (re)build with a single job: make -j1. This causes the build to exit quicker when there is an error, instead of waiting for multiple parallel, pending jobs to complete... the result is that the real error is closer to the bottom of the output. – rfmodulator May 7 at 1:56

Turns out I incorrectly compiled ncurses, deleting the ncurses directory and then starting from their did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.