LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Following LFS 7.4 instruction to build gcc,encountering problem during configuration. (https://www.linuxquestions.org/questions/linux-from-scratch-13/following-lfs-7-4-instruction-to-build-gcc-encountering-problem-during-configuration-4175492400/)

AbhinavKumar 01-24-2014 06:05 AM

Following LFS 7.4 instruction to build gcc,encountering problem during configuration.
 
According to the instruction i extracted mpc,gmp and mpfr in gcc source directory and renamed them as instructed.
But i am getting following error

Code:

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 libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for gcc... x86_64-monty-linux-gnu-gcc
checking for C compiler default output file name...
configure: error: in `/mnt/monty/sources/gcc-build':
configure: error: C compiler cannot create executables
See `config.log' for more details.


and here is config.log

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

  $ ../gcc-4.8.1/configure --prefix=/tools --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --with-mpfr-include=/mnt/monty/sources/gcc-build/../gcc-4.8.1/mpfr/src --with-mpfr-lib=/mnt/monty/sources/gcc-build/mpfr/src/.libs

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

hostname = abhinav-Aspire-5745G
uname -m = x86_64
uname -r = 3.11.0-15-generic
uname -s = Linux
uname -v = #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013

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

/bin/arch              = unknown
/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:2317: checking build system type
configure:2331: result: x86_64-unknown-linux-gnu
configure:2378: checking host system type
configure:2391: result: x86_64-unknown-linux-gnu
configure:2411: checking target system type
configure:2424: result: x86_64-unknown-linux-gnu
configure:2478: checking for a BSD-compatible install
configure:2546: result: /usr/bin/install -c
configure:2557: checking whether ln works
configure:2579: result: yes
configure:2583: checking whether ln -s works
configure:2587: result: yes
configure:2594: checking for a sed that does not truncate output
configure:2658: result: /bin/sed
configure:2667: checking for gawk
configure:2683: found /usr/bin/gawk
configure:2694: result: gawk
configure:3164: checking for libatomic support
configure:3174: result: yes
configure:3183: checking for libitm support
configure:3193: result: yes
configure:3202: checking for libsanitizer support
configure:3212: result: yes
configure:3936: checking for gcc
configure:3963: result: x86_64-monty-linux-gnu-gcc
configure:4192: checking for C compiler version
configure:4201: x86_64-monty-linux-gnu-gcc --version >&5
../gcc-4.8.1/configure: line 4203: x86_64-monty-linux-gnu-gcc: command not found
configure:4212: $? = 127
configure:4201: x86_64-monty-linux-gnu-gcc -v >&5
../gcc-4.8.1/configure: line 4203: x86_64-monty-linux-gnu-gcc: command not found
configure:4212: $? = 127
configure:4201: x86_64-monty-linux-gnu-gcc -V >&5
../gcc-4.8.1/configure: line 4203: x86_64-monty-linux-gnu-gcc: command not found
configure:4212: $? = 127
configure:4201: x86_64-monty-linux-gnu-gcc -qversion >&5
../gcc-4.8.1/configure: line 4203: x86_64-monty-linux-gnu-gcc: command not found
configure:4212: $? = 127
configure:4232: checking for C compiler default output file name
configure:4254: x86_64-monty-linux-gnu-gcc    conftest.c  >&5
../gcc-4.8.1/configure: line 4256: x86_64-monty-linux-gnu-gcc: command not found
configure:4258: $? = 127
configure:4295: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|  ;
|  return 0;
| }
configure:4301: error: in `/mnt/monty/sources/gcc-build':
configure:4305: error: C compiler cannot create executables
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-monty-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-monty-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=set
ac_cv_env_CXX_value=x86_64-monty-linux-gnu-g++
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-monty-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-monty-linux-gnu-gcc
ac_cv_target=x86_64-unknown-linux-gnu
acx_cv_prog_LN=ln

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

AR='x86_64-monty-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-monty-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='x86_64-monty-linux-gnu-g++'
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-monty-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='../gcc-4.8.1/configure --prefix=/tools --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --with-mpfr-include=/mnt/monty/sources/gcc-build/../gcc-4.8.1/mpfr/src --with-mpfr-lib=/mnt/monty/sources/gcc-build/mpfr/src/.libs'
WINDMC=''
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET=''
WINDRES=''
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET=''
YACC=''
ac_ct_CC='x86_64-monty-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_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-libatomic target-libitm target-libstdc++-v3 target-libmudflap target-libsanitizer 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 77

Can anyone help?
Also do i have to configure and make gmp,mpfr and mpc?If so,in which order?

gengisdave 01-24-2014 06:09 AM

configure:4201: x86_64-monty-linux-gnu-gcc --version >&5
../gcc-4.8.1/configure: line 4203: x86_64-monty-linux-gnu-gcc: command not found

it seems he can't find where gcc is

druuna 01-24-2014 06:10 AM

Is you host made compliant?

vii. Host System Requirements : Run the version-check.sh script and post the output it produces.

AbhinavKumar 01-24-2014 08:38 AM

Version Check script result
 
root@abhinav-Aspire-5745G:/# bash version-check.sh
bash, version 4.2.45(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.23.52.20130913
bison (GNU Bison) 2.7.12-4996
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.20
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
(Ubuntu EGLIBC 2.17-93ubuntu4) 2.17
grep (GNU grep) 2.14
gzip 1.6
Linux version 3.11.0-15-generic (buildd@batsu) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) ) #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013
m4 (GNU M4) 1.4.16
GNU Make 3.81
GNU patch 2.7.1
Perl version='5.14.2';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 5.1
xz (XZ Utils) 5.1.0alpha
g++ compilation OK

druuna 01-24-2014 09:11 AM

The output shown looks OK.

I just noticed this: /mnt/monty.

Why did you change the convention that is in the book (/mnt/lfs)? And I immediately start wondering what else you might have changed....

You really need to follow the book to the letter, especially if this is your first LFS build.

Did you change the .bashrc file? (4.4. Setting Up the Environment) Especially this one: LFS_TGT=$(uname -m)-lfs-linux-gnu

If you start changing things it will be rather hard for us to help you trouble shoot possible problems you run into.

AbhinavKumar 01-24-2014 11:31 AM

Reply
 
To druuna,
Thanks for your reply and support,i really appreciate it.And yes,it is my first lfs build.

Now,regarding the topic, I did't thought that renaming would affect it, after all it was just a variable.
And i only changed the name 'lfs' up until now.I did not made any changes in configure or added any option anywhere,from what was given in the book.
But,i did change .bashrc file accordingly(where i renamed LFS_TGT to MONTY_TGT and any instances with word 'lfs' with it.)


But if it has so much adverse effect then i think, i can start again from the start.
Please also mention what you suggest i do.

Thanks

druuna 01-24-2014 11:46 AM

Quote:

Originally Posted by AbhinavKumar (Post 5104514)
Now,regarding the topic, I did't thought that renaming would affect it, after all it was just a variable.
And i only changed the name 'lfs' up until now.I did not made any changes in configure or added any option anywhere,from what was given in the book.
But,i did change .bashrc file accordingly(where i renamed LFS_TGT to MONTY_TGT and any instances with word 'lfs' with it.)

But if it has so much adverse effect then i think, i can start again from the start.
Please also mention what you suggest i do.

I would recommend starting from scratch. Don't change anything until you have a good idea what the impact might be.

Changing LFS=/mnt/lfs to LFS=/mnt/monty is probably harmless, but why do you want to do so? This directory won't even be part of the final LFS build.

Changing the variable name LFS_TGT to MONTY_TGT is not a smart move. The content of this variable is used in multiple chapters and you have to change all those chapters to accommodate the new variable name. Forget it once and you might have to start from scratch again.

Building and understanding LFS when doing this for the first time is hard enough as it is. Stick to the book.

AbhinavKumar 01-26-2014 04:43 AM

I again started started from scratch and strictly followed the book,without changing anything.
Now,i have encountered new errors in gcc.

Before configuration of GCC we run the following code which is not showing any output
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

I saw this step in a youtube LFS video and it is showing some processing and output, what is the problem here?

After this, i did the configure steps, which executed successfully without any errors.

But,when i ran make,it showed followings errors.

bgcc_s.so.1 ]; then mv -f 32/libgcc_s.so.1 32/libgcc_s.so.1.backup; else true; fi && mv 32/libgcc_s.so.1.tmp 32/libgcc_s.so.1 && ln -s libgcc_s.so.1 32/libgcc_s.so
/tools/bin/x86_64-lfs-linux-gnu-ld: cannot find crti.o: No such file or directory
/tools/bin/x86_64-lfs-linux-gnu-ld: cannot find -lc
/tools/bin/x86_64-lfs-linux-gnu-ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[4]: *** [libgcc_s.so] Error 1
make[4]: Leaving directory `/mnt/lfs/sources/gcc-build/x86_64-lfs-linux-gnu/32/libgcc'
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/x86_64-lfs-linux-gnu/libgcc'
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/x86_64-lfs-linux-gnu/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2

Can someone help?

druuna 01-26-2014 05:22 AM

Quote:

Originally Posted by AbhinavKumar (Post 5105422)
I again started started from scratch and strictly followed the book,without changing anything.
Now,i have encountered new errors in gcc.

Before configuration of GCC we run the following code which is not showing any output
Code:

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

I saw this step in a youtube LFS video and it is showing some processing and output, what is the problem here?

The bold part should produce output due to the -v option, the other parts don't show any output (assuming all went well).

Quote:

Originally Posted by AbhinavKumar (Post 5105422)
But,when i ran make,it showed followings errors.

bgcc_s.so.1 ]; then mv -f 32/libgcc_s.so.1 32/libgcc_s.so.1.backup; else true; fi && mv 32/libgcc_s.so.1.tmp 32/libgcc_s.so.1 && ln -s libgcc_s.so.1 32/libgcc_s.so
/tools/bin/x86_64-lfs-linux-gnu-ld: cannot find crti.o: No such file or directory
/tools/bin/x86_64-lfs-linux-gnu-ld: cannot find -lc
/tools/bin/x86_64-lfs-linux-gnu-ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

Three things come to mind:
1 - Did you clean up everything when you started again?
2 - Is the tools symlink set correctly? (ls -l /tools should output something like this: tools -> /mnt/lfs/tools/)
3 - crti.o and crtn.o are part of libc (glibc) and at this stage it must be provided by the host. You might need to install the dev version. I'm not an ubuntu user, but look for and install libc6-dev

BTW: You need to provide specific information in order for us to be able to help you.
- The version of the book being used, (I'm assuming LFS 7.4 stable)
- The host distribution being used, (I'm assuming Ubuntu, but which version)
- The output from the Host System Requirements section, (already provided)
- The package and section the problem was encountered in, (I'm assuming 5.5. GCC-4.8.1 - Pass 1)

EDIT: I just noticed this isn't posted in the LFS sub-forum. I've ask a moderator to move it. This way you get the exposure it needs.

XavierP 01-27-2014 02:59 AM

Moved: This thread is more suitable in Linux From Scratch and has been moved accordingly to help your thread/question get the exposure it deserves.

AbhinavKumar 02-11-2014 03:11 AM

Reply
 
Sorry for the late reply, i had my exams.

Quote:

Originally Posted by druuna (Post 5105433)
The bold part should produce output due to the -v option, the other parts don't show any output (assuming all went well).

Three things come to mind:
1 - Did you clean up everything when you started again?
2 - Is the tools symlink set correctly? (ls -l /tools should output something like this: tools -> /mnt/lfs/tools/)
3 - crti.o and crtn.o are part of libc (glibc) and at this stage it must be provided by the host. You might need to install the dev version. I'm not an ubuntu user, but look for and install libc6-dev


1.I formatted the entire lfs partition before starting again.
2.The tools symlink was broken after i had formatted the partition, but i unlinked it and then made a new symlink when it was required and its working.
3.I installed libc6-dev but there are many other libc6-dev packages like libc6-dev-amd64:i386, libc6-dev-1386, libc6-dev-x32, are those also neccessary?




Quote:

Originally Posted by druuna (Post 5105433)
BTW: You need to provide specific information in order for us to be able to help you.
- The version of the book being used, (I'm assuming LFS 7.4 stable)
- The host distribution being used, (I'm assuming Ubuntu, but which version)
- The output from the Host System Requirements section, (already provided)
- The package and section the problem was encountered in, (I'm assuming 5.5. GCC-4.8.1 - Pass 1)


-Using LFS-7.4 stable
-Ubuntu 13.10
-output already provided
-5.5. GCC-4.8.1 - Pass 1, 5.5.1. Installation of Cross GCC(just after unpacking and renaming).

ReaperX7 02-12-2014 03:38 PM

Multilib packages aren't required. Just get the listed packages as directed and make sure Bash is the default shell.

r.stiltskin 02-13-2014 12:24 AM

Do you understand what that command does?

For example, this part
Code:

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' \

makes a backup copy of every file named linux64.h or linux.h or sysv4.h in the gcc-4.8.1/gcc/config directory, adding .orig to the end of the filename. Then it scans each of the original files (the ones without the .orig extension) and wherever it finds the strings "lib/ld" or "lib64/ld" or "lib32/ld" it replaces it with "tools". So it should be easy for you to look and see if this has happened.

Note that you must be in the gcc-4.8.1 directory when you run that command.

AbhinavKumar 02-15-2014 01:55 AM

Reply
 
Quote:

Originally Posted by r.stiltskin (Post 5116673)
Do you understand what that command does?

For example, this part
Code:

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' \

makes a backup copy of every file named linux64.h or linux.h or sysv4.h in the gcc-4.8.1/gcc/config directory, adding .orig to the end of the filename. Then it scans each of the original files (the ones without the .orig extension) and wherever it finds the strings "lib/ld" or "lib64/ld" or "lib32/ld" it replaces it with "tools". So it should be easy for you to look and see if this has happened.

Note that you must be in the gcc-4.8.1 directory when you run that command.


I understand the meaning of the command and i checked linx.h had orig extension but when i checked its content, "lib/ld" or or "lib64/ld" or "lib32/ld" wasn't replaced with "tools".
Also, i checked the subdirectories for files named linux.h and linux64.h, but they didn't had ".orig" extension, only the linux.h in the immediate directory i.e in gcc/config was affected, please clarify that the subdirectory in gcc/config should be affected or not?
Please suggest a solution.
Thanks in advance.

r.stiltskin 02-15-2014 12:01 PM

Actually I explained that incorrectly. It doesn't replace the path with "tools". Instead, it adds "/tools" to the beginning of each path. So for example, /lib/ld becomes /tools/lib/ld, /lib64/ld becomes /tools/lib64/ld, and so on.

Then the next line replaces "/usr" with "/tools" in a couple of these files.

This command definitely affects files in the subdirectories under gcc/config. This is the output you should get, listing all of the files that are affected:
Code:

'gcc/config/frv/linux.h' -> 'gcc/config/frv/linux.h.orig'
'gcc/config/s390/linux.h' -> 'gcc/config/s390/linux.h.orig'
'gcc/config/alpha/linux.h' -> 'gcc/config/alpha/linux.h.orig'
'gcc/config/sparc/sysv4.h' -> 'gcc/config/sparc/sysv4.h.orig'
'gcc/config/sparc/linux64.h' -> 'gcc/config/sparc/linux64.h.orig'
'gcc/config/sparc/linux.h' -> 'gcc/config/sparc/linux.h.orig'
'gcc/config/ia64/sysv4.h' -> 'gcc/config/ia64/sysv4.h.orig'
'gcc/config/ia64/linux.h' -> 'gcc/config/ia64/linux.h.orig'
'gcc/config/mn10300/linux.h' -> 'gcc/config/mn10300/linux.h.orig'
'gcc/config/m32r/linux.h' -> 'gcc/config/m32r/linux.h.orig'
'gcc/config/sh/linux.h' -> 'gcc/config/sh/linux.h.orig'
'gcc/config/tilegx/linux.h' -> 'gcc/config/tilegx/linux.h.orig'
'gcc/config/microblaze/linux.h' -> 'gcc/config/microblaze/linux.h.orig'
'gcc/config/m68k/linux.h' -> 'gcc/config/m68k/linux.h.orig'
'gcc/config/i386/sysv4.h' -> 'gcc/config/i386/sysv4.h.orig'
'gcc/config/i386/linux64.h' -> 'gcc/config/i386/linux64.h.orig'
'gcc/config/i386/linux.h' -> 'gcc/config/i386/linux.h.orig'
'gcc/config/cris/linux.h' -> 'gcc/config/cris/linux.h.orig'
'gcc/config/xtensa/linux.h' -> 'gcc/config/xtensa/linux.h.orig'
'gcc/config/rs6000/sysv4.h' -> 'gcc/config/rs6000/sysv4.h.orig'
'gcc/config/rs6000/linux64.h' -> 'gcc/config/rs6000/linux64.h.orig'
'gcc/config/rs6000/linux.h' -> 'gcc/config/rs6000/linux.h.orig'
'gcc/config/vax/linux.h' -> 'gcc/config/vax/linux.h.orig'
'gcc/config/tilepro/linux.h' -> 'gcc/config/tilepro/linux.h.orig'
'gcc/config/mips/linux64.h' -> 'gcc/config/mips/linux64.h.orig'
'gcc/config/mips/linux.h' -> 'gcc/config/mips/linux.h.orig'
'gcc/config/bfin/linux.h' -> 'gcc/config/bfin/linux.h.orig'
'gcc/config/linux.h' -> 'gcc/config/linux.h.orig'

Then you can run this command
Code:

for file in $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
echo "     
$file:
"
grep -n "/tools" $file
done

That won't change anything, but it will give you a listing of those files showing the line numbers and lines where "/tools" now appears.

If you don't get that output:
maybe you're not in the correct directory [gcc-4.8.1] when you ran the command, or
maybe your copy of gcc-4.8.1.tar.bz2 was corrupted & must be downloaded again

Are you sure that your user's shell is bash? To check that:
Code:

echo $SHELL
Are you sure that /bin/sh points to bash (and not dash)? To check that:
Code:

ls -l /bin/sh


All times are GMT -5. The time now is 05:17 PM.