LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-01-2016, 01:16 PM   #1
Michael Farthing
LQ Newbie
 
Registered: Jan 2016
Location: Morecambe England
Distribution: Fedora moving to LFS
Posts: 10

Rep: Reputation: Disabled
LFS 7.8-systemd 5.7 glibc error: Need linker with .init_array/.fini_array support


I have received this error on several occasions, having retracked and recompiled from scratch and have been as meticulous as can be. Little hair is now left on my head. I have scripted each section of the build process and can supply the scripts if useful, though I have checked consistency with the manual several times.

Two suspicious things have happened in compiling gcc, though this appeared to complete satisfactorily:

a) libtool: install: warning: remember to run `libtool --finish /tools/libexec/gcc/x86_64-lfs-linux-gnu/5.2.0'

As this location seems to be linked to tools/lib it seemed unlikely to me that it could be my problem.

b) cc1: error: no include path in which to search for stdc-predef.h

This looks more frightening to me

Internet discussions of this problem are few and do not seem to be relevant to my situation.
I have confirmed $PATH $LFS and $LFS_TGT to be as expected and symbolic links are in place. The host requirements script ran as expected.
My host system is Fedora 22 workstation, to which I had to add gcc.

Any ideas? Is there some library or whatever that might not be being found or might be in the wrong place?

I can supply other logs etc but didn't want to prematurely post too much.
 
Old 02-01-2016, 08:17 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
There seems to be a number of weird and wonderful errors when using fedora, you may be better off, if you have the spare disk space, temporarily installing slackware, build your LFS then delete the slackware install, just a thought.

http://www.linuxquestions.org/questi...ed-4175485207/

Last edited by Keith Hedger; 02-01-2016 at 08:21 PM.
 
Old 02-02-2016, 12:18 PM   #3
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Fedora, RHEL, and CentOS have been reported to have numerous issues as of last year or so.

Slackware currently, is the only known OOTB distribution that builds LFS without issue.
 
Old 02-02-2016, 02:17 PM   #4
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
Debian and Debian-based distros work too (when the book is properly followed and all the requirements are met) and also Archlinux.
 
Old 02-02-2016, 02:53 PM   #5
Michael Farthing
LQ Newbie
 
Registered: Jan 2016
Location: Morecambe England
Distribution: Fedora moving to LFS
Posts: 10

Original Poster
Rep: Reputation: Disabled
Intermediate response:

The verdict seems clear. I've installed a Slackware but have got too drunk to deal with the Grub.
 
Old 02-02-2016, 03:02 PM   #6
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Quote:
Originally Posted by Michael Farthing View Post
... have got too drunk to deal with the Grub.
Best way to deal with grub in my opinion!
 
Old 02-02-2016, 03:55 PM   #7
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Rep: Reputation: 55
Quote:
Originally Posted by Keith Hedger View Post
There seems to be a number of weird and wonderful errors when using fedora, you may be better off, if you have the spare disk space, temporarily installing slackware, build your LFS then delete the slackware install, just a thought.

http://www.linuxquestions.org/questi...ed-4175485207/
Seems too late for this particular thread, but Salix is a Slackware derivative that offers Live CD. I've been using it as a host to build LFS and it works quite well. This way one doesn't have to install the host OS only to remove it once LFS is built.

Perhaps useful for future consideration
 
Old 02-02-2016, 05:02 PM   #8
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Does the live cd work out of the box?
 
Old 02-02-2016, 06:25 PM   #9
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
SalixOS's Live Disk works, just make sure you complete Chapter 5 before you stop, or you will get permission issues.
 
Old 02-02-2016, 07:34 PM   #10
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Good to know
 
Old 02-05-2016, 04:24 AM   #11
Michael Farthing
LQ Newbie
 
Registered: Jan 2016
Location: Morecambe England
Distribution: Fedora moving to LFS
Posts: 10

Original Poster
Rep: Reputation: Disabled
Well, the good news is that my new distro is installed, grubbed up and working and has been used to repeat from scratch the toolchain.
The bad news is that exactly the same error is still appearing - so it looks as if I'm making a mistake somewhere. Back to the drawing board!

Can anyone perhaps help by making a bit clearer what the error message means? Or what the linker might be requiring that it can't find?

[In response to a comment above I did actually select the Salix live CD as suggested (having read about this in another thread - you see I do do a bit of independent work on it all). As it happened it booted up wanting me to install to hard disk, and as I had a bit of unpartitioned space (I always keep a bit for a rainy day) I let it do it - it seemed as simple. Anyway, I really like the new environment so am pleased to have that to work with - something good achieved by this thread].
 
Old 02-05-2016, 04:49 AM   #12
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
It's just another case of PEBKAC.

You can start by pasting your "env", "history" and "hostreqs.sh" output here. Use code tags.

Last edited by Krejzi; 02-05-2016 at 04:56 AM.
 
Old 02-05-2016, 06:54 AM   #13
Michael Farthing
LQ Newbie
 
Registered: Jan 2016
Location: Morecambe England
Distribution: Fedora moving to LFS
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Krejzi View Post
It's just another case of PEBKAC.

You can start by pasting your "env", "history" and "hostreqs.sh" output here. Use code tags.
PEBKAC someone?
..but I assume I don't need to know that (and perhaps would prefer not to )

Internet searches for the problem produced a variety of possible fixes not of which looked relevant to my situation. The feature in common is that they are all 64 bit builds


The following from the glibc log might be useful, suggesting to me that the binutils didn't go quite right:
Code:
configure:5878: checking for .preinit_array/.init_array/.fini_array support
configure:5894: x86_64-lfs-linux-gnu-gcc -g -O2   -o conftest
		       conftest.c -static -nostartfiles -nostdlib
		       1>&5
/mnt/lfs/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/5.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status
configure:5897: $? = 1
configure:5910: result: no
configure:5913: error: Need linker with .init_array/.fini_array support.
Host requirement output:
Code:
bash, version 4.2.45(2)-release
/bin/sh -> /bin/bash
Binutils: (Linux/GNU Binutils) 2.23.52.0.1.20130226
bison (GNU Bison) 2.7
yacc is bison (GNU Bison) 2.7
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.21
diff (GNU diffutils) 3.3
find (GNU findutils) 4.4.2
GNU Awk 4.1.0, API: 1.0 (GNU MPFR 3.1.2, GNU MP 5.1.3)
/usr/bin/awk -> /bin/gawk-4.1.0
gcc (GCC) 4.8.2
g++ (GCC) 4.8.2
(GNU libc) 2.17
grep (GNU grep) 2.14
gzip 1.6
Linux version 3.10.17 (root@hive64) (gcc version 4.8.2 (GCC) ) #2 SMP Fri Feb 14 16:45:28 CST 2014
m4 (GNU M4) 1.4.17
GNU Make 3.82
GNU patch 2.7
Perl version='5.18.1';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.26
makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.0.5
g++ compilation OK
Environment:
Code:
u:/mnt/lfs/Logs$ env
TERM=xterm
OLDPWD=/mnt/lfs
LC_ALL=POSIX
LFS=/mnt/lfs
PATH=/tools/bin:/bin:/usr/bin
PWD=/mnt/lfs/Logs
LFS_TGT=x86_64-lfs-linux-gnu
PS1=u:\w\$ 
SHLVL=1
HOME=/home/lfs
_=/bin/env
History (of shell: some actions - such as removing build directories for a retry - happened outside a shell, as also inspection of logs etc)
Note also that each package installation has been scripted: scripts follow later.
u:/mnt/lfs/Logs$ history
Code:
    1  cat > ~/.bash_profile << "EOF"
    2  exec env -i HOME=$HOME TERM=$TERM PS1='u:\w\$ ' /bin/bash
    3  EOF
    4  cat > ~/.bashrc << "EOF"
    5  set +h
    6  umask 022
    7  LFS=/mnt/lfs
    8  LC_ALL=POSIX
    9  LFS_TGT=$(uname -m)-lfs-linux-gnu
   10  PATH=/tools/bin:/bin:/usr/bin
   11  export LFS LC_ALL LFS_TGT PATH
   12  EOF
   13  source ~/.bash_profile
   14  exit
   15  dir
   16  echo $LFS
   17  echo $LFS_TGT
   18  cd $LFS
   19  cd Logs
   20  dir
   21  host-requirement_script >hostrequirements
   22  cd $LFS/tools
   23  ./binutils1 >binutils1.log
   24  dir
   25  cd ../Logs
   26  ./binutils1 >binutils1.log
   27  cd $LFS/Logs
   28  ./binutils1 >binutils1.log
   29  ../gcc1 >gcc1.log
   30  ./gcc1 >gcc1.log
   31  dir
   32  ./apihead >apihead.log
   33  ./glibc >glibc.log
   34  cd �$LFS/Logs
   35  cd $LFS
   36  dir
   37  cd Logs
   38  echo $PATH
   39  echo $LFS_TGT
   40  ./glibc >glibc.log
   41  echo $CFLAGS
   42  env
   43  history
Scripts
Scripts are called from $LFS/Logs and change directory internally
Binutils-2.25.1 (binutils1)
Code:
#!/bin/bash

export SrceDir=binutils-2.25.1
export SrceFlags=-xf
export SrceSuf=tar.bz2
export ConfigOptions="--prefix=/tools --with-sysroots=$LFS --with-lib-path=/tools/lib --target=$LFS_TGT --disable-nls --disable-werror"

times                                                          
echo '{' $0 'prepare'                                          
  cd $LFS/sources                                              
  tar $SrceFlags $SrceDir.$SrceSuf                               
  mkdir -v $0-build                                            
  cd $0-build                                                  
echo '} ' $0 'configure {'                                     
  echo ../$SrceDir/configure $ConfigOptions                    
  ../$SrceDir/configure $ConfigOptions          
echo '}' $0 'make {'                                                                          
  make                                          
echo '}' $0 'make install {'                                   
#Custom
  mkdir -v /tools/lib && ln -sv lib /tools/lib64 
#Custom ends 
 make install                                                 
echo '}'                                                       
times
gcc-5.2.0 (gcc1)
Code:
#!/bin/bash
export SrceDir=gcc-5.2.0
export SrceFlags=-jxf
export SrceSuf=tar.bz2
export ConfigOptions="--target=$LFS_TGT --prefix=/tools --with-glibc-version=2.11 --with-sysroot=$LFS --with-newlib --without-headers     \
                      --with-local-prefix=/tools  --with-native-system-header-dir=/tools/include --disable-nls  \
                      --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic \
                      --disable-libgomp --disable-libquadmath --disable-libssp \
                      --disable-libvtv  --disable-libstdcxx  --enable-languages=c,c++"
times                                                          
echo '{' $0 'prepare'                                          
  cd $LFS/sources                                              
  tar $SrceFlags $SrceDir.$SrceSuf                             
#Custom work
  cd $SrceDir
  tar -xf ../mpfr-3.1.3.tar.xz
  mv -v mpfr-3.1.3 mpfr
  tar -xf ../gmp-6.0.0a.tar.xz
  mv -v gmp-6.0.0 gmp
  tar -xf ../mpc-1.0.3.tar.gz
  mv -v mpc-1.0.3 mpc

  for file in \
    $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
  do
    cp -uv $file{,.orig}
    sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
        -e 's@/usr@/tools@g' $file.orig > $file
    echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
    touch $file.orig
  done  
  cd $LFS/sources
#Custom work ends
  mkdir -v $0-build                                            
  cd $0-build                                                  
echo '} ' $0 'configure {'                                     
  echo ../$SrceDir/configure $ConfigOptions                    
  ../$SrceDir/configure $ConfigOptions 
echo '}' $0 'make {'                                                                          
  make                                          
echo '}' $0 'make install {'                                   
  make install                                                 
echo '}'                                                       
times
Linux-4.2 API Headers (apihead)
Code:
#!/bin/bash
#This is simple and atypical but still coded in case of repetition
export SrceDir=linux-4.2
export SrceFlags=-xf
export SrceSuf=tar.xz
#export ConfigOptions="--prefix=/tools --with-sysroots=$LFS --with-lib-path=/tools/lib --target=$LFS_TGT --disable-nls --disable-werror"

times                                                          
echo '{' $0 'prepare'                                          
  cd $LFS/sources                                              
  tar $SrceFlags $SrceDir.$SrceSuf 
#Custom
  cd $SrceDir
  make mrproper
  make INSTALL_HDR_PATH=dest headers_install
  cp -rv dest/include/* /tools/include
#Custom ends  
#Rest of standard procedure unneeded
times
glibc-2.22 (glibc) I ran this first with the 386 patch and tried again without in case it had interfered in any way with a 64 build - hence the current commenting out. Obviously I deleted both the source and build directories between attempts
Code:
#!/bin/bash
export SrceDir=glibc-2.22
export SrceFlags=-xf
export SrceSuf=tar.xz
#export ConfigOptions must be done later as the setting depends on the results of tarball extraction

times
echo '{'
  echo $0 'prepare'
  cd $LFS/sources
  tar $SrceFlags $SrceDir.$SrceSuf
#Custom fix
  #cd $LFS/sources/$SrceDir
  #patch -Np1 -i ../glibc-2.22-upstream_i386_fix-1.patch
  #cd $LFS/sources
#End custom 
  mkdir $0-build
  cd    $0-build
echo '} ' $0 'configure {'
  export ConfigOptions="--prefix=/tools --host=$LFS_TGT --build=$(../glibc-2.22/scripts/config.guess) \
                        --disable-profile  --enable-kernel=2.6.32 --enable-obsolete-rpc --with-headers=/tools/include \
                        libc_cv_forced_unwind=yes libc_cv_ctors_header=yes libc_cv_c_cleanup=yes" 
  echo ../$SrceDir/configure $ConfigOptions 
  ../$SrceDir/configure $ConfigOptions 
echo '}' $0 'make' {                               
  make 
echo '} make install {'
  make install
echo '}'
times
I have the standard output saved from the scripts as well as other logs but I assume posting the lot at this stage would not be appreciated.

Hope this all helps. Thanks for all your continued patience.
 
Old 02-05-2016, 07:07 AM   #14
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
Quote:
Originally Posted by Michael Farthing View Post
PEBKAC someone?
..but I assume I don't need to know that (and perhaps would prefer not to )
Problem Exists Between Keyboard and Chair (take a guess where).

You failed to mention you were using scripts. I shouldn't be wrong to assume it's a problem in them somewhere.
Try without using them. Adding configure options in an env var produces some ... strange results.
 
Old 02-05-2016, 08:16 AM   #15
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Rep: Reputation: 55
Quote:
Originally Posted by Krejzi View Post
You failed to mention you were using scripts. I shouldn't be wrong to assume it's a problem in them somewhere.
Try without using them. Adding configure options in an env var produces some ... strange results.
I second this. Especially for the first time you're building LFS, I would not use any scripts and follow the book line by line. If you insist on using scripts, then it's useful to do a "dry-run" by echoing the commands instead of executing them.
 
  


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
[SOLVED] 6.9. Glibc-2.19 configure error on LFS 7.5 m.lorenzano Linux - Newbie 17 05-29-2014 12:52 AM
Error compiling Glibc-2.12.1 in LFS 6.7 poisoning Linux From Scratch 2 05-22-2011 12:09 AM
lfs 6.3 glibc 2.5.1 compile error umpalumpa1985 Linux From Scratch 7 02-21-2010 02:50 AM
Glibc .fini_array support error Pytus Linux From Scratch 7 11-09-2007 05:27 PM
glibc-2.3.3-lfs-5.1 error Zamochit Linux From Scratch 8 01-13-2005 06:00 AM

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

All times are GMT -5. The time now is 06:11 PM.

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