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 01-24-2014, 06:05 AM   #1
AbhinavKumar
LQ Newbie
 
Registered: Jan 2014
Posts: 12

Rep: Reputation: Disabled
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?

Last edited by XavierP; 01-27-2014 at 02:58 AM. Reason: Added code tags
 
Old 01-24-2014, 06:09 AM   #2
gengisdave
Member
 
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328

Rep: Reputation: 74
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
 
Old 01-24-2014, 06:10 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Is you host made compliant?

vii. Host System Requirements : Run the version-check.sh script and post the output it produces.
 
Old 01-24-2014, 08:38 AM   #4
AbhinavKumar
LQ Newbie
 
Registered: Jan 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
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
 
Old 01-24-2014, 09:11 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
Old 01-24-2014, 11:31 AM   #6
AbhinavKumar
LQ Newbie
 
Registered: Jan 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
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
 
Old 01-24-2014, 11:46 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by AbhinavKumar View Post
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.
 
1 members found this post helpful.
Old 01-26-2014, 04:43 AM   #8
AbhinavKumar
LQ Newbie
 
Registered: Jan 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
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?
 
Old 01-26-2014, 05:22 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by AbhinavKumar View Post
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 View Post
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.

Last edited by druuna; 01-26-2014 at 05:25 AM.
 
Old 01-27-2014, 02:59 AM   #10
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
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.
 
Old 02-11-2014, 03:11 AM   #11
AbhinavKumar
LQ Newbie
 
Registered: Jan 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
Reply

Sorry for the late reply, i had my exams.

Quote:
Originally Posted by druuna View Post
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 View Post
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).
 
Old 02-12-2014, 03:38 PM   #12
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
Multilib packages aren't required. Just get the listed packages as directed and make sure Bash is the default shell.
 
Old 02-13-2014, 12:24 AM   #13
r.stiltskin
Member
 
Registered: Oct 2003
Location: USA
Distribution: Xubuntu, Arch
Posts: 231

Rep: Reputation: 31
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.
 
Old 02-15-2014, 01:55 AM   #14
AbhinavKumar
LQ Newbie
 
Registered: Jan 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
Reply

Quote:
Originally Posted by r.stiltskin View Post
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.
 
Old 02-15-2014, 12:01 PM   #15
r.stiltskin
Member
 
Registered: Oct 2003
Location: USA
Distribution: Xubuntu, Arch
Posts: 231

Rep: Reputation: 31
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
 
1 members found this post helpful.
  


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] LFS Version SVN-20120623 gcc build 2 esornep Linux From Scratch 17 07-05-2012 08:34 AM
[SOLVED] gcc build under lfs livecd grumpy.biatch Linux From Scratch 3 12-25-2010 10:37 PM
LFS 6.5 - Chap 5 - Why build GCC before Glibc kamleshk1 Linux From Scratch 2 06-01-2010 10:07 AM
LFS 6.4 build gcc error Ron_Beltran Linux From Scratch 4 09-22-2009 11:18 PM
GCC first build for LFS, bootstrap error Blibblob Linux From Scratch 8 01-07-2004 05:50 PM

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

All times are GMT -5. The time now is 07:51 AM.

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