LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   5.9. Binutils-2.25 - Pass 2 configure fails (https://www.linuxquestions.org/questions/linux-from-scratch-13/5-9-binutils-2-25-pass-2-configure-fails-4175538176/)

zeshanuk 03-29-2015 03:21 PM

5.9. Binutils-2.25 - Pass 2 configure fails
 
Dear all,

I am trying to do 5.9. Binutils-2.25 - Pass 2 but i have a configure error. I have centos6 as the host os.

Code:

lfs:/mnt/lfs/sources/binutils-2.25$ CC=$LFS_TGT-gcc                \
> AR=$LFS_TGT-ar                \
> RANLIB=$LFS_TGT-ranlib        \
> ../binutils-2.25/configure    \
>    --prefix=/tools            \
>    --disable-nls              \
>    --disable-werror          \
>    --with-lib-path=/tools/lib \
>    --with-sysroot
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... x86_64-lfs-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: in `/mnt/lfs/sources/binutils-2.25':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
lfs:/mnt/lfs/sources/binutils-2.25$

config.log is this:

Code:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  $ ../binutils-2.25/configure --prefix=/tools --disable-nls --disable-werror --with-lib-path=/tools/lib64 --with-sysroot

## --------- ##
## Platform. ##
## --------- ##

hostname = Unknown
uname -m = x86_64
uname -r = 2.6.32-504.el6.x86_64
uname -s = Linux
uname -v = #1 SMP Wed Oct 15 04:27:16 UTC 2014

/usr/bin/uname -p = unknown
/bin/uname -X    = unknown

/bin/arch              = x86_64
/usr/bin/arch -k      = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine          = unknown
/usr/bin/oslevel      = unknown
/bin/universe          = unknown

PATH: /tools/bin
PATH: /bin
PATH: /usr/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2322: checking build system type
configure:2336: result: x86_64-unknown-linux-gnu
configure:2383: checking host system type
configure:2396: result: x86_64-unknown-linux-gnu
configure:2416: checking target system type
configure:2429: result: x86_64-unknown-linux-gnu
configure:2483: checking for a BSD-compatible install
configure:2551: result: /usr/bin/install -c
configure:2562: checking whether ln works
configure:2584: result: yes
configure:2588: checking whether ln -s works
configure:2592: result: yes
configure:2599: checking for a sed that does not truncate output
configure:2663: result: /bin/sed
configure:2672: checking for gawk
configure:2688: found /bin/gawk
configure:2699: result: gawk
configure:3981: checking for gcc
configure:4008: result: x86_64-lfs-linux-gnu-gcc
configure:4237: checking for C compiler version
configure:4246: x86_64-lfs-linux-gnu-gcc --version >&5
x86_64-lfs-linux-gnu-gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4257: $? = 0
configure:4246: x86_64-lfs-linux-gnu-gcc -v >&5
Using built-in specs.
COLLECT_GCC=x86_64-lfs-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/mnt/lfs/tools/bin/../libexec/gcc/x86_64-lfs-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-lfs-linux-gnu
Configured with: ../gcc-4.9.2/configure --target=x86_64-lfs-linux-gnu --prefix=/tools --with-sysroot=/mnt/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-libitm --disable-libquadmath --disable-libsanitizer --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libstdc++-v3 --enable-languages=c,c++
Thread model: single
gcc version 4.9.2 (GCC)
configure:4257: $? = 0
configure:4246: x86_64-lfs-linux-gnu-gcc -V >&5
x86_64-lfs-linux-gnu-gcc: error: unrecognized command line option '-V'
x86_64-lfs-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:4257: $? = 1
configure:4246: x86_64-lfs-linux-gnu-gcc -qversion >&5
x86_64-lfs-linux-gnu-gcc: error: unrecognized command line option '-qversion'
x86_64-lfs-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:4257: $? = 1
configure:4277: checking for C compiler default output file name
configure:4299: x86_64-lfs-linux-gnu-gcc    conftest.c  >&5
configure:4303: $? = 0
configure:4340: result: a.out
configure:4356: checking whether the C compiler works
configure:4365: ./a.out
../binutils-2.25/configure: ./a.out: /tools/lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory
configure:4369: $? = 126
configure:4376: error: in `/mnt/lfs/sources/binutils-build':
configure:4380: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_env_AR_FOR_TARGET_set=
ac_cv_env_AR_FOR_TARGET_value=
ac_cv_env_AR_set=set
ac_cv_env_AR_value=x86_64-lfs-linux-gnu-ar
ac_cv_env_AS_FOR_TARGET_set=
ac_cv_env_AS_FOR_TARGET_value=
ac_cv_env_AS_set=
ac_cv_env_AS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_TARGET_set=
ac_cv_env_CC_FOR_TARGET_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value=x86_64-lfs-linux-gnu-gcc
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_FOR_TARGET_set=
ac_cv_env_CXX_FOR_TARGET_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DLLTOOL_FOR_TARGET_set=
ac_cv_env_DLLTOOL_FOR_TARGET_value=
ac_cv_env_DLLTOOL_set=
ac_cv_env_DLLTOOL_value=
ac_cv_env_GCC_FOR_TARGET_set=
ac_cv_env_GCC_FOR_TARGET_value=
ac_cv_env_GCJ_FOR_TARGET_set=
ac_cv_env_GCJ_FOR_TARGET_value=
ac_cv_env_GFORTRAN_FOR_TARGET_set=
ac_cv_env_GFORTRAN_FOR_TARGET_value=
ac_cv_env_GOC_FOR_TARGET_set=
ac_cv_env_GOC_FOR_TARGET_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LD_FOR_TARGET_set=
ac_cv_env_LD_FOR_TARGET_value=
ac_cv_env_LD_set=
ac_cv_env_LD_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LIPO_FOR_TARGET_set=
ac_cv_env_LIPO_FOR_TARGET_value=
ac_cv_env_LIPO_set=
ac_cv_env_LIPO_value=
ac_cv_env_NM_FOR_TARGET_set=
ac_cv_env_NM_FOR_TARGET_value=
ac_cv_env_NM_set=
ac_cv_env_NM_value=
ac_cv_env_OBJCOPY_set=
ac_cv_env_OBJCOPY_value=
ac_cv_env_OBJDUMP_FOR_TARGET_set=
ac_cv_env_OBJDUMP_FOR_TARGET_value=
ac_cv_env_OBJDUMP_set=
ac_cv_env_OBJDUMP_value=
ac_cv_env_RANLIB_FOR_TARGET_set=
ac_cv_env_RANLIB_FOR_TARGET_value=
ac_cv_env_RANLIB_set=set
ac_cv_env_RANLIB_value=x86_64-lfs-linux-gnu-ranlib
ac_cv_env_READELF_FOR_TARGET_set=
ac_cv_env_READELF_FOR_TARGET_value=
ac_cv_env_READELF_set=
ac_cv_env_READELF_value=
ac_cv_env_STRIP_FOR_TARGET_set=
ac_cv_env_STRIP_FOR_TARGET_value=
ac_cv_env_STRIP_set=
ac_cv_env_STRIP_value=
ac_cv_env_WINDMC_FOR_TARGET_set=
ac_cv_env_WINDMC_FOR_TARGET_value=
ac_cv_env_WINDMC_set=
ac_cv_env_WINDMC_value=
ac_cv_env_WINDRES_FOR_TARGET_set=
ac_cv_env_WINDRES_FOR_TARGET_value=
ac_cv_env_WINDRES_set=
ac_cv_env_WINDRES_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_build_configargs_set=
ac_cv_env_build_configargs_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_host_configargs_set=
ac_cv_env_host_configargs_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_env_target_configargs_set=
ac_cv_env_target_configargs_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_path_SED=/bin/sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=x86_64-lfs-linux-gnu-gcc
ac_cv_target=x86_64-unknown-linux-gnu
acx_cv_prog_LN=ln

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='x86_64-lfs-linux-gnu-ar'
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET=''
AS=''
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET=''
AWK='gawk'
BISON=''
BUILD_CONFIG=''
CC='x86_64-lfs-linux-gnu-gcc'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET=''
CFLAGS=''
CFLAGS_FOR_BUILD=''
CFLAGS_FOR_TARGET=''
COMPILER_AS_FOR_TARGET=''
COMPILER_LD_FOR_TARGET=''
COMPILER_NM_FOR_TARGET=''
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CXX=''
CXXFLAGS=''
CXXFLAGS_FOR_BUILD=''
CXXFLAGS_FOR_TARGET=''
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET=''
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS=''
DLLTOOL=''
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT=''
EXTRA_CONFIGARGS_LIBJAVA='--disable-static'
FLAGS_FOR_TARGET=''
FLEX=''
GCC_FOR_TARGET=''
GCC_SHLIB_SUBDIR=''
GCJ_FOR_BUILD='$(GCJ)'
GCJ_FOR_TARGET=''
GDB_TK=''
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET=''
GNATBIND=''
GNATMAKE=''
GOC_FOR_BUILD='$(GOC)'
GOC_FOR_TARGET=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD=''
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LDFLAGS_FOR_TARGET=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET=''
LEX=''
LIBOBJS=''
LIBS=''
LIPO=''
LIPO_FOR_TARGET=''
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO=''
NM=''
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET=''
OBJCOPY=''
OBJDUMP=''
OBJDUMP_FOR_TARGET=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB='x86_64-lfs-linux-gnu-ranlib'
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET=''
RAW_CXX_FOR_TARGET=''
READELF=''
READELF_FOR_TARGET=''
RPATH_ENVVAR=''
RUNTEST=''
SED='/bin/sed'
SHELL='/bin/sh'
STRIP=''
STRIP_FOR_TARGET=''
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='../binutils-2.25/configure --prefix=/tools --disable-nls --disable-werror --with-lib-path=/tools/lib64 --with-sysroot'
WINDMC=''
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET=''
WINDRES=''
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET=''
YACC=''
ac_ct_CC='x86_64-lfs-linux-gnu-gcc'
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_configargs=''
build_configdirs='build-libiberty build-texinfo build-flex build-bison build-m4 build-fixincludes'
build_cpu='x86_64'
build_libsubdir='build-x86_64-unknown-linux-gnu'
build_noncanonical='x86_64-unknown-linux-gnu'
build_os='linux-gnu'
build_subdir='build-x86_64-unknown-linux-gnu'
build_tooldir=''
build_vendor='unknown'
clooginc=''
clooglibs=''
compare_exclusions=''
configdirs='intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl cloog libelf libiconv texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare=''
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
extra_host_libiberty_configure_flags=''
extra_isl_gmp_configure_flags=''
extra_mpc_gmp_configure_flags=''
extra_mpc_mpfr_configure_flags=''
extra_mpfr_configure_flags=''
gmpinc=''
gmplibs=''
host='x86_64-unknown-linux-gnu'
host_alias=''
host_configargs=''
host_cpu='x86_64'
host_noncanonical='x86_64-unknown-linux-gnu'
host_os='linux-gnu'
host_shared=''
host_subdir='.'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
islinc=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
poststage1_ldflags=''
poststage1_libs=''
prefix='/tools'
program_transform_name='s,y,y,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags=''
stage1_checking=''
stage1_languages=''
stage1_ldflags=''
stage1_libs=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='x86_64-unknown-linux-gnu'
target_alias=''
target_configargs=''
target_configdirs='target-libgcc target-libbacktrace target-libgloss target-newlib target-libgomp target-libcilkrts target-libatomic target-libitm target-libstdc++-v3 target-libsanitizer target-libvtv target-libssp target-libquadmath target-libgfortran target-boehm-gc target-libffi target-zlib target-libjava target-libobjc target-libada target-libgo target-rda'
target_cpu='x86_64'
target_noncanonical='x86_64-unknown-linux-gnu'
target_os='linux-gnu'
target_subdir='x86_64-unknown-linux-gnu'
target_vendor='unknown'
tooldir=''

## ------------------- ##
## File substitutions. ##
## ------------------- ##

alphaieee_frag=''
host_makefile_frag='/dev/null'
ospace_frag=''
serialization_dependencies=''
target_makefile_frag=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 1

bash version-check.sh shows:
Code:

[root@Unknown Desktop]# bash version-check.sh
bash, version 4.1.2(1)-release
/bin/sh -> /bin/bash
Binutils: version 2.20.51.0.2-5.42.el6 20100205
bison (GNU Bison) 2.4.1
Usage: /usr/bin/yacc [options] filename

Options:
  -b file_prefix        set filename prefix (default "y.")
  -d                    write definitions (y.tab.h)
  -g                    write a graphical description
  -l                    suppress #line directives
  -o output_file        (default "y.tab.c")
  -p symbol_prefix      set symbol prefix (default "yy")
  -r                    produce separate code and table files (y.code.c)
  -t                    add debugging support
  -v                    write description (y.output)
  -V                    show version information and exit
yacc is
bzip2,  Version 1.0.5, 10-Dec-2007.
Coreutils:  8.4
diff (GNU diffutils) 2.8.1
find (GNU findutils) 4.4.2
GNU Awk 4.1.1, API: 1.1
/usr/bin/awk -> /bin/gawk
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
(GNU libc) 2.12
GNU grep 2.6.3
gzip 1.3.12
Linux version 2.6.32-504.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15 04:27:16 UTC 2014
m4 (GNU M4) 1.4.13
GNU Make 3.81
patch 2.6
Perl version='5.10.1';
GNU sed version 4.2.1
tar (GNU tar) 1.23
makeinfo (GNU texinfo) 5.2
xz (XZ Utils) 5.2.1
g++ compilation OK
[root@Unknown Desktop]#

Can you help me please? I am really struggling and I am sure I have not messed anything up. Thanks in advance.

zeshanuk 03-29-2015 03:23 PM

btw I using Linux From Scratch - Version 7.7 book

spiky0011 03-29-2015 03:36 PM

Hi

Did you forget
Code:

mkdir -v ../binutils-build
cd ../binutils-build

untar binutils-2.25 cd into dir follow book

zeshanuk 03-29-2015 03:44 PM

hi spikey,

I did not forget to issue the configure outside the source directory, I was in binutils-build . Also I have added the version check in the previous post.

spiky0011 03-29-2015 03:48 PM

Quote:

lfs:/mnt/lfs/sources/binutils-2.25$ CC=$LFS_TGT-gcc
looks like you are in binutils-2.25 dir not binutils-build

should be

/mnt/lfs/sources/binutils-build

zeshanuk 03-29-2015 03:51 PM

hey dont you believe me! see below:

Quote:

lfs:/mnt/lfs/sources/binutils-build$ CC=$LFS_TGT-gcc \
> AR=$LFS_TGT-ar \
> RANLIB=$LFS_TGT-ranlib \
> ../binutils-2.25/configure \
> --prefix=/tools \
> --disable-nls \
> --disable-werror \
> --with-lib-path=/tools/lib \
> --with-sysroot
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... x86_64-lfs-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: in `/mnt/lfs/sources/binutils-build':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
lfs:/mnt/lfs/sources/binutils-build$

spiky0011 03-29-2015 04:01 PM

That is not the same as the 1st post? check

what dose this ouput

echo 'main(){}' > dummy.c
$LFS_TGT-gcc dummy.c
readelf -l a.out | grep ': /tools'

zeshanuk 03-29-2015 04:07 PM

hi, sorry you was right about the posts,

the output of:

Quote:

echo 'main(){}' > dummy.c
$LFS_TGT-gcc dummy.c
readelf -l a.out | grep ': /tools'
is:
Quote:

[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]

spiky0011 03-29-2015 04:14 PM

whats the output of

Code:

env
and echo $LFS

Also did you remove binutils-2.2.5 and binutils-build dir from 1st build?

zeshanuk 03-29-2015 04:17 PM

env

Quote:

lfs:/mnt/lfs/sources/binutils-build$ env
TERM=xterm
OLDPWD=/mnt/lfs/sources/binutils-2.25
LC_ALL=POSIX
LFS=/mnt/lfs
PATH=/tools/bin:/bin:/usr/bin
PWD=/mnt/lfs/sources/binutils-build
LFS_TGT=x86_64-lfs-linux-gnu
PS1=\u:\w\$
SHLVL=1
HOME=/home/lfs
_=/bin/env
lfs:/mnt/lfs/sources/binutils-build$
also echo $LFS

Quote:

lfs:/mnt/lfs/sources/binutils-build$ echo $LFS
/mnt/lfs
lfs:/mnt/lfs/sources/binutils-build$

zeshanuk 03-29-2015 04:25 PM

regarding binutils source and build folders, 1st build i did remove them, i unpaked the tar again for 2nd pass.

spiky0011 03-29-2015 04:30 PM

something went wrong in in glib or gcc

If you removed all untarred dir & build dir when you finished building, I would start again

you have this in config log
../binutils-2.25/configure: ./a.out: /tools/lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

zeshanuk 03-29-2015 04:36 PM

hi this is the second time round im am trying this, glibc and gcc compile and install fine. - no errors. what is going to change by starting from binutils pass1? thats where i started again the second time. I have made no changes to the process! I always get stuck at binutils pass2...

zeshanuk 03-29-2015 04:41 PM

I have checked the config.log file and it points to 4246 of configure:
Quote:

configure:4246: x86_64-lfs-linux-gnu-gcc -V >&5
x86_64-lfs-linux-gnu-gcc: error: unrecognized command line option '-V'
x86_64-lfs-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:4257: $? = 1
configure:4246: x86_64-lfs-linux-gnu-gcc -qversion >&5
x86_64-lfs-linux-gnu-gcc: error: unrecognized command line option '-qversion'
x86_64-lfs-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:4257: $? = 1
configure:4277: checking for C compiler default output file name
configure:4299: x86_64-lfs-linux-gnu-gcc conftest.c >&5
configure:4303: $? = 0
configure:4340: result: a.out
configure:4356: checking whether the C compiler works
configure:4365: ./a.out
../binutils-2.25/configure: ./a.out: /tools/lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

configure:4369: $? = 126
configure:4376: error: in `/mnt/lfs/sources/binutils-build':
configure:4380: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
any ideas? I put in bold some of the errors that have popped up in config.log

spiky0011 03-29-2015 04:43 PM

Well if your copy pasting commands they should be good, the only other thing is the host
I have built 7.7 a few times now but not on centos i build from lfs. Maybe try slack or arch

you can wait see if anyone else can figure the error out.

The only only other thing you did run the
case $(uname -m) in
x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;
esac
end of binutils 1st pass

zeshanuk 03-29-2015 04:47 PM

im sure people have been able to do this (get past binutils 2nd pass) on centos somewhere and I should be ok because my host has all the prequisite software installed as version check shows....I really need help I really dont wanna move on to another distro for host.....

spiky0011 03-29-2015 04:58 PM

last idea
Code:

ls -l $LFS/tools

ReaperX7 03-29-2015 05:00 PM

Unfortunately it's the distribution. CentOS is based on Red Hat which it and Fedora are known to have problems. We aren't entirely certain, but the way they patch certain packages often affects how the system works and it ends up killing GCC.

The evidence of this can be found by running this:

Code:

cat > library-check.sh << "EOF"
#!/bin/bash
for lib in lib{gmp,mpfr,mpc}.la; do
  echo $lib: $(if find /usr/lib* -name $lib|
              grep -q $lib;then :;else echo not;fi) found
done
unset lib
EOF

bash library-check.sh

Slackware is one of a few distributions that include the static libraries ".la" of the gmp, mfpr, and mpc libraries required to rebuild GCC and binutils.

zeshanuk 03-29-2015 05:01 PM

thanks for helping...


Quote:

lfs:/mnt/lfs/sources/binutils-build$ ls -l $LFS/tools
total 40
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:24 bin
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:23 etc
drwxr-xr-x. 33 lfs lfs 4096 Mar 29 20:23 include
drwxr-xr-x. 5 lfs lfs 4096 Mar 29 20:24 lib
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:29 lib64
drwxr-xr-x. 4 lfs lfs 4096 Mar 29 17:11 libexec
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:24 sbin
drwxr-xr-x. 7 lfs lfs 4096 Mar 29 17:21 share
drwxr-xr-x. 3 lfs lfs 4096 Mar 29 17:12 var
drwxr-xr-x. 5 lfs lfs 4096 Mar 29 17:21 x86_64-lfs-linux-gnu
lfs:/mnt/lfs/sources/binutils-build$

spiky0011 03-29-2015 05:07 PM

run the script Reaper mentioned

also shouldn't lib be linked to lib64

zeshanuk 03-29-2015 05:14 PM

hi spiky, can you send me the full command to link correctly lib and lib64 and I will try issue the configure command again, thanks in advance.

spiky0011 03-29-2015 05:16 PM

At the end of binutils pass 1 Ch 5.4

zeshanuk 03-29-2015 05:24 PM

issued:
Quote:

lfs:/mnt/lfs/sources/binutils-build$ case $(uname -m) in x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;; esac
mkdir: cannot create directory `/tools/lib': File exists
lfs:/mnt/lfs/sources/binutils-build$
tried to configure again:

Quote:

lfs:/mnt/lfs/sources/binutils-build$ CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib ../binutils-2.25/configure --prefix=/tools --disable-nls --disable-werror --with-lib-path=/tools/lib --with-sysroot
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... x86_64-lfs-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: in `/mnt/lfs/sources/binutils-build':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
lfs:/mnt/lfs/sources/binutils-build$
run again ls -l $LFS/tools (shows no change):

Quote:

lfs:/mnt/lfs/sources/binutils-build$ ls -l $LFS/tools
total 40
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:24 bin
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:23 etc
drwxr-xr-x. 33 lfs lfs 4096 Mar 29 20:23 include
drwxr-xr-x. 5 lfs lfs 4096 Mar 29 20:24 lib
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:29 lib64
drwxr-xr-x. 4 lfs lfs 4096 Mar 29 17:11 libexec
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:24 sbin
drwxr-xr-x. 7 lfs lfs 4096 Mar 29 17:21 share
drwxr-xr-x. 3 lfs lfs 4096 Mar 29 17:12 var
drwxr-xr-x. 5 lfs lfs 4096 Mar 29 17:21 x86_64-lfs-linux-gnu
lfs:/mnt/lfs/sources/binutils-build$

spiky0011 03-29-2015 05:30 PM

Not got a 64bit machine about but lib64 should be linked

Reaper will know

zeshanuk 03-29-2015 05:35 PM

thanks for the time you took on this...do you think Reaper will come back then? Is there a way of notifying him I would like his input?

spiky0011 03-29-2015 05:39 PM

I really think thats the problem

whats inside tools/lib64

also the script reaper put

zeshanuk 03-29-2015 05:42 PM

hi spiky,

this is what is in tools/lib64

Quote:

lfs:/mnt/lfs/tools/lib64$ ls
libstdc++.a libstdc++.a-gdb.py libstdc++.la libsupc++.a libsupc++.la
lfs:/mnt/lfs/tools/lib64$

zeshanuk 03-29-2015 06:26 PM

output from reaper script is:
Quote:

lfs:/mnt/lfs/sources/binutils-build$ bash library-check.sh
find: `/usr/lib64/audit': Permission denied
libgmp.la: not found
find: `/usr/lib64/audit': Permission denied
libmpfr.la: not found
find: `/usr/lib64/audit': Permission denied
libmpc.la: not found
lfs:/mnt/lfs/sources/binutils-build$
sorry for the delay.....

veerain 03-30-2015 01:10 AM

Quote:

Originally Posted by zeshanuk (Post 5339563)
hi spiky,

this is what is in tools/lib64

So there is no file /tools/lib64/ld-linux-x86-64.so.2. Which is needed by any new program to run in built LFS.

Check if /tools/lib has it? Or is it present in /tools filesystem tree by using 'find' command.

zeshanuk 03-30-2015 03:33 AM

Hi veerain,

The file seems to be in /tools/lib, see below the output of the find command I issued.

Quote:

[root@Unknown tools]# find /mnt/lfs/tools -name "ld-linux-x86-64.so.2"
/mnt/lfs/tools/lib/ld-linux-x86-64.so.2
[root@Unknown tools]#
Thanks for looking at this problem too...

spiky0011 03-30-2015 03:42 AM

Try linking tools/lib to tools/lib64

this was supposed to be done in binutils 1st pass

zeshanuk 03-30-2015 03:53 AM

tried but still no luck, also i cant see a sym link created although it says file exists when i issue the command again:
Quote:

lfs:/mnt/lfs/sources/binutils-build$ ln -sv ../../tools/lib ../../tools/lib64
`../../tools/lib64/lib' -> `../../tools/lib'
lfs:/mnt/lfs/sources/binutils-build$ ls -l $LFS/tools
total 40
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:24 bin
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:23 etc
drwxr-xr-x. 33 lfs lfs 4096 Mar 29 20:23 include
drwxr-xr-x. 5 lfs lfs 4096 Mar 29 20:24 lib
drwxr-xr-x. 2 lfs lfs 4096 Mar 30 09:47 lib64
drwxr-xr-x. 4 lfs lfs 4096 Mar 29 17:11 libexec
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:24 sbin
drwxr-xr-x. 7 lfs lfs 4096 Mar 29 17:21 share
drwxr-xr-x. 3 lfs lfs 4096 Mar 29 17:12 var
drwxr-xr-x. 5 lfs lfs 4096 Mar 29 17:21 x86_64-lfs-linux-gnu
lfs:/mnt/lfs/sources/binutils-build$ ln -sv ../../tools/lib ../../tools/lib64
ln: creating symbolic link `../../tools/lib64/lib': File exists
lfs:/mnt/lfs/sources/binutils-build$ ls -l $LFS/tools
total 40
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:24 bin
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:23 etc
drwxr-xr-x. 33 lfs lfs 4096 Mar 29 20:23 include
drwxr-xr-x. 5 lfs lfs 4096 Mar 29 20:24 lib
drwxr-xr-x. 2 lfs lfs 4096 Mar 30 09:47 lib64
drwxr-xr-x. 4 lfs lfs 4096 Mar 29 17:11 libexec
drwxr-xr-x. 2 lfs lfs 4096 Mar 29 20:24 sbin
drwxr-xr-x. 7 lfs lfs 4096 Mar 29 17:21 share
drwxr-xr-x. 3 lfs lfs 4096 Mar 29 17:12 var
drwxr-xr-x. 5 lfs lfs 4096 Mar 29 17:21 x86_64-lfs-linux-gnu
lfs:/mnt/lfs/sources/binutils-build$ CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib ../binutils-2.25/configure --prefix=/tools --disable-nls --disable-werror --with-lib-path=/tools/lib --with-sysroot
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... x86_64-lfs-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: in `/mnt/lfs/sources/binutils-build':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
lfs:/mnt/lfs/sources/binutils-build$

veerain 03-30-2015 04:45 AM

Quote:

Originally Posted by zeshanuk (Post 5339717)
Hi veerain,

The file seems to be in /tools/lib, see below the output of the find command I issued.



Thanks for looking at this problem too...

The ld-linux-x86-64.so.2 file is part of glibc and installed with it. During install you should have passed --libdir=/tools/lib64 to be more specific but book doesn't says so. Instead it depends on build scripts of glibc to decide it. And in your case it gets installed to /tools/lib but the gcc pass1 has the path of dynamic linker set in /tools/lib64.

So I say before installing binutils pass1 you should go the /tools directory and run 'mkdir lib64; ln -s lib64 lib'.

Or If you want to run anyway from this point onward, then copy all the files, directories in /tools/lib to /tools/lib64. Careful to not overwrite files in /tools/lib64 especially symlinks overwriting regular files. And then delete /tools/lib and put a symlink from /tools/lib to /tools/lib64.

Code:

rm -fr /tools/lib
cd /tools
ln -s lib64 lib


zeshanuk 03-30-2015 05:11 AM

hi veerain, thats worked! I decided to continue rather than start again, thanks so much for your help on this problem.

veerain 03-30-2015 05:17 AM

You are welcome.


All times are GMT -5. The time now is 11:34 AM.