LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-30-2019, 10:36 AM   #1
lecramyajiv
Member
 
Registered: Jul 2015
Distribution: Slackware64
Posts: 30

Rep: Reputation: Disabled
LFS Glibc pass-1 cannot find -lgcc


Hi i'm trying to build LFS 8.4 on Debian 10, 64 bit host.I'm in chapter 5.7 glibc pass 1. Compilation and make install finished when i perform the sanity check it gives the following error.
Code:
lfs0@debian:~/build/glibc-2.29/build$ echo 'int main(){}' > dummy.c
lfs0@debian:~/build/glibc-2.29/build$ $LFS_TGT-gcc dummy.c
/mnt/lfs/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/8.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find crtbegin.o: No such file or directory
/mnt/lfs/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/8.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
lfs0@debian:~/build/glibc-2.29/build$ readelf -l a.out | grep ': /tools'
readelf: Error: 'a.out': No such file
make install ended at
Code:
/home/lfs0/build/glibc-2.29/build/elf/sln /home/lfs0/build/glibc-2.29/build/elf/symlink.list
rm -f /home/lfs0/build/glibc-2.29/build/elf/symlink.list
test ! -x /home/lfs0/build/glibc-2.29/build/elf/ldconfig || LC_ALL=C \
  /home/lfs0/build/glibc-2.29/build/elf/ldconfig  \
			/tools/lib /tools/lib
/home/lfs0/build/glibc-2.29/build/elf/ldconfig: Warning: ignoring configuration file that cannot be opened: /tools/etc/ld.so.conf: No such file or directory
make[1]: Leaving directory '/home/lfs0/build/glibc-2.29'
Code:
lfs0@debian:~/build/glibc-2.29/build$ strings libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
GLIBC_2.22
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_2.28
GLIBC_2.29
GLIBC_PRIVATE
___sys_errlist_GLIBC_2_3
___sys_errlist_GLIBC_2_4
___sys_errlist_GLIBC_2_1
___sys_nerr_GLIBC_2_1
___sys_nerr_GLIBC_2_3
___sys_nerr_GLIBC_2_4
___sys_nerr_GLIBC_2_3
___sys_nerr_GLIBC_2_4
___sys_nerr_GLIBC_2_1
__bdflush_GLIBC_2_0
_IO_vfwscanf@GLIBC_2.2.5
___sys_errlist_GLIBC_2_1
___sys_errlist_GLIBC_2_4
___sys_errlist_GLIBC_2_3
xdrmem_create@GLIBC_2.2.5
_IO_file_seekoff@@GLIBC_2.2.5
xdr_uint64_t@GLIBC_2.2.5
getservent_r@@GLIBC_2.2.5
xdr_char@GLIBC_2.2.5
clnt_sperror@GLIBC_2.2.5
__strcpy_small@GLIBC_2.2.5
malloc_get_state@GLIBC_2.2.5
xdrrec_create@GLIBC_2.2.5
__strtok_r_1c@GLIBC_2.2.5
semctl@@GLIBC_2.2.5
__libc_clntudp_bufcreate@GLIBC_PRIVATE
xdr_double@GLIBC_2.2.5
_sys_siglist@@GLIBC_2.3.3
tmpfile@@GLIBC_2.2.5
pmap_getport@GLIBC_2.2.5
clnttcp_create@GLIBC_2.2.5
xprt_register@GLIBC_2.2.5
sched_getaffinity@GLIBC_2.3.3
xdr_unixcred@GLIBC_2.2.5
svc_getreq@GLIBC_2.2.5
pthread_cond_wait@GLIBC_2.2.5
getnetname@GLIBC_2.2.5
regexec@GLIBC_2.2.5
key_encryptsession@GLIBC_2.2.5
quick_exit@GLIBC_2.10
xdr_free@GLIBC_2.2.5
memcpy@@GLIBC_2.14
_IO_file_init@@GLIBC_2.2.5
realpath@GLIBC_2.2.5
key_encryptsession_pk@GLIBC_2.2.5
GLIBC_2.29
xdr_quad_t@GLIBC_2.3.4
GLIBC_2.26
GLIBC_2.25
xdr_uint16_t@GLIBC_2.2.5
xdr_replymsg@GLIBC_2.2.5
realpath@@GLIBC_2.3
svc_getreq_common@GLIBC_2.2.5
GLIBC_2.28
__ctype32_tolower@GLIBC_2.2.5
quick_exit@@GLIBC_2.24
gethostbyname2_r@@GLIBC_2.2.5
clntraw_create@GLIBC_2.2.5
svc_getreq_poll@GLIBC_2.2.5
getaliasbyname_r@@GLIBC_2.2.5
GLIBC_2.23
_IO_file_overflow@@GLIBC_2.2.5
cbc_crypt@GLIBC_2.2.5
pthread_cond_wait@@GLIBC_2.3.2
xdr_cryptkeyres@GLIBC_2.2.5
xdr_int8_t@GLIBC_2.2.5
xdr_accepted_reply@GLIBC_2.2.5
getprotoent_r@@GLIBC_2.2.5
xdr_int64_t@GLIBC_2.2.5
xdr_int@GLIBC_2.2.5
_null_auth@GLIBC_2.2.5
xdrrec_skiprecord@GLIBC_2.2.5
regexec@@GLIBC_2.3.4
_rtld_global@@GLIBC_PRIVATE
getgrgid_r@@GLIBC_2.2.5
xdr_rejected_reply@GLIBC_2.2.5
xdr_reference@GLIBC_2.2.5
__strcspn_c3@GLIBC_2.2.5
pthread_cond_init@GLIBC_2.2.5
xdr_rmtcall_args@GLIBC_2.2.5
_IO_fsetpos@@GLIBC_2.2.5
GLIBC_2.8
_IO_proc_close@@GLIBC_2.2.5
_sys_nerr@@GLIBC_2.12
xdrstdio_create@GLIBC_2.2.5
pthread_cond_timedwait@@GLIBC_2.3.2
__libc_enable_secure@@GLIBC_PRIVATE
pclose@@GLIBC_2.2.5
xdr_u_quad_t@GLIBC_2.3.4
svcunixfd_create@GLIBC_2.2.5
getaliasent_r@@GLIBC_2.2.5
__tls_get_addr@@GLIBC_2.3
xdr_callmsg@GLIBC_2.2.5
authunix_create@GLIBC_2.2.5
malloc_set_state@GLIBC_2.2.5
svcauthdes_stats@GLIBC_2.2.5
__rpc_thread_createerr@GLIBC_2.2.5
_sys_nerr@GLIBC_2.4
xdr_union@GLIBC_2.2.5
sys_sigabbrev@GLIBC_2.2.5
pthread_cond_broadcast@GLIBC_2.2.5
xdr_sizeof@GLIBC_2.2.5
authunix_create_default@GLIBC_2.2.5
glob@@GLIBC_2.27
_IO_proc_open@@GLIBC_2.2.5
registerrpc@GLIBC_2.2.5
pmap_rmtcall@GLIBC_2.2.5
xdr_pmap@GLIBC_2.2.5
posix_spawn@@GLIBC_2.15
_dl_exception_create@@GLIBC_PRIVATE
getpwnam_r@@GLIBC_2.2.5
xdr_int16_t@GLIBC_2.2.5
svcerr_noprog@GLIBC_2.2.5
rpc_createerr@GLIBC_2.2.5
_rtld_global_ro@@GLIBC_PRIVATE
getrpcbyname_r@@GLIBC_2.2.5
pthread_cond_broadcast@@GLIBC_2.3.2
_authenticate@GLIBC_2.2.5
xprt_unregister@GLIBC_2.2.5
get_myaddress@GLIBC_2.2.5
__strcspn_c1@GLIBC_2.2.5
clnt_broadcast@GLIBC_2.2.5
__nss_group_lookup@GLIBC_2.2.5
__malloc_initialize_hook@GLIBC_2.2.5
nftw64@GLIBC_2.2.5
_sys_siglist@GLIBC_2.2.5
svc_sendreply@GLIBC_2.2.5
__strspn_c1@GLIBC_2.2.5
xdr_authunix_parms@GLIBC_2.2.5
_sys_nerr@GLIBC_2.3
xdr_int32_t@GLIBC_2.2.5
__strpbrk_c3@GLIBC_2.2.5
getsecretkey@GLIBC_2.2.5
clntudp_create@GLIBC_2.2.5
_IO_fsetpos64@@GLIBC_2.2.5
xdr_key_netstarg@GLIBC_2.2.5
svctcp_create@GLIBC_2.2.5
get_kernel_syms@GLIBC_2.2.5
msgctl@@GLIBC_2.2.5
__ctype_tolower@GLIBC_2.2.5
__ctype_toupper@GLIBC_2.2.5
_IO_file_underflow@@GLIBC_2.2.5
__rpc_thread_svc_pollfd@GLIBC_2.2.5
localeconv@@GLIBC_2.2.5
pthread_cond_timedwait@GLIBC_2.2.5
bdflush@GLIBC_2.2.5
__mempcpy_small@GLIBC_2.2.5
clntudp_bufcreate@GLIBC_2.2.5
llseek@GLIBC_2.2.5
__sigaddset@GLIBC_2.2.5
glob@GLIBC_2.2.5
__tunable_get_val@@GLIBC_PRIVATE
svc_unregister@GLIBC_2.2.5
_IO_file_fopen@@GLIBC_2.2.5
clnt_perrno@GLIBC_2.2.5
pmap_set@GLIBC_2.2.5
glob64@@GLIBC_2.27
__ctype_b@GLIBC_2.2.5
shmctl@@GLIBC_2.2.5
xdr_enum@GLIBC_2.2.5
xdr_netobj@GLIBC_2.2.5
key_gendes@GLIBC_2.2.5
GLIBC_2.5
_IO_file_finish@@GLIBC_2.2.5
xdr_hyper@GLIBC_2.2.5
GLIBC_2.9
xdr_cryptkeyarg2@GLIBC_2.2.5
getgrnam_r@@GLIBC_2.2.5
GLIBC_2.7
svcraw_create@GLIBC_2.2.5
ecb_crypt@GLIBC_2.2.5
clnt_create@GLIBC_2.2.5
key_get_conv@GLIBC_2.2.5
GLIBC_2.6
svcfd_create@GLIBC_2.2.5
getservbyname_r@@GLIBC_2.2.5
locs@GLIBC_2.2.5
nfsservctl@GLIBC_2.2.5
__ctype32_b@GLIBC_2.2.5
xdr_authdes_verf@GLIBC_2.2.5
_res@GLIBC_2.2.5
__secure_getenv@GLIBC_2.2.5
_seterr_reply@GLIBC_2.2.5
getnetent_r@@GLIBC_2.2.5
nftw@GLIBC_2.2.5
xdr_bool@GLIBC_2.2.5
xdr_longlong_t@GLIBC_2.2.5
netname2host@GLIBC_2.2.5
getpwuid_r@@GLIBC_2.2.5
_IO_fdopen@@GLIBC_2.2.5
posix_spawn@GLIBC_2.2.5
gethostbyaddr_r@@GLIBC_2.2.5
svcunix_create@GLIBC_2.2.5
authdes_getucred@GLIBC_2.2.5
_IO_file_xsputn@@GLIBC_2.2.5
xdr_float@GLIBC_2.2.5
pthread_attr_init@@GLIBC_2.2.5
__strpbrk_c2@GLIBC_2.2.5
xencrypt@GLIBC_2.2.5
getrpcbynumber_r@@GLIBC_2.2.5
__strsep_3c@GLIBC_2.2.5
xdr_callhdr@GLIBC_2.2.5
xdr_short@GLIBC_2.2.5
_IO_fopen@@GLIBC_2.2.5
getnetbyname_r@@GLIBC_2.2.5
memcpy@GLIBC_2.2.5
svcudp_bufcreate@GLIBC_2.2.5
sigvec@GLIBC_2.2.5
authdes_create@GLIBC_2.2.5
getpublickey@GLIBC_2.2.5
pthread_cond_signal@@GLIBC_2.3.2
svcudp_enablecache@GLIBC_2.2.5
__libc_rpc_getport@GLIBC_PRIVATE
pthread_cond_signal@GLIBC_2.2.5
advance@GLIBC_2.2.5
sys_sigabbrev@@GLIBC_2.3.3
_dl_find_dso_for_object@@GLIBC_PRIVATE
svcerr_progvers@GLIBC_2.2.5
_IO_fgetpos@@GLIBC_2.2.5
xdr_cryptkeyarg@GLIBC_2.2.5
xdr_long@GLIBC_2.2.5
_IO_vfscanf@GLIBC_2.2.5
posix_spawnp@@GLIBC_2.15
svc_register@GLIBC_2.2.5
xdr_des_block@GLIBC_2.2.5
_IO_file_setbuf@@GLIBC_2.2.5
__stpcpy_small@GLIBC_2.2.5
key_setnet@GLIBC_2.2.5
xdr_u_hyper@GLIBC_2.2.5
xdr_uint8_t@GLIBC_2.2.5
getservbyport_r@@GLIBC_2.2.5
_sys_errlist@GLIBC_2.3
xdrrec_eof@GLIBC_2.2.5
_IO_file_attach@@GLIBC_2.2.5
clnt_spcreateerror@GLIBC_2.2.5
xdr_keystatus@GLIBC_2.2.5
gethostent_r@@GLIBC_2.2.5
key_setsecret@GLIBC_2.2.5
xdr_array@GLIBC_2.2.5
_sys_errlist@GLIBC_2.4
clnt_pcreateerror@GLIBC_2.2.5
_sys_nerr@GLIBC_2.2.5
svc_exit@GLIBC_2.2.5
__strsep_2c@GLIBC_2.2.5
xdr_getcredres@GLIBC_2.2.5
svc_run@GLIBC_2.2.5
nftw64@@GLIBC_2.3.3
xdr_pointer@GLIBC_2.2.5
__nss_hosts_lookup@GLIBC_2.2.5
_IO_fgetpos64@@GLIBC_2.2.5
__strspn_c2@GLIBC_2.2.5
fnmatch@@GLIBC_2.2.5
svcerr_weakauth@GLIBC_2.2.5
__sigdelset@GLIBC_2.2.5
xdrrec_endofrecord@GLIBC_2.2.5
svcerr_auth@GLIBC_2.2.5
glob64@GLIBC_2.2.5
xdr_key_netstres@GLIBC_2.2.5
xdr_u_short@GLIBC_2.2.5
svcudp_create@GLIBC_2.2.5
svcerr_systemerr@GLIBC_2.2.5
_sys_errlist@@GLIBC_2.12
_IO_fclose@@GLIBC_2.2.5
_rpc_dtablesize@GLIBC_2.2.5
loc1@GLIBC_2.2.5
gethostbyname_r@@GLIBC_2.2.5
rtime@GLIBC_2.2.5
_IO_do_write@@GLIBC_2.2.5
getspent_r@@GLIBC_2.2.5
uselib@GLIBC_2.2.5
xdr_u_char@GLIBC_2.2.5
xdr_rmtcallres@GLIBC_2.2.5
xdr_vector@GLIBC_2.2.5
xdr_authdes_cred@GLIBC_2.2.5
key_decryptsession@GLIBC_2.2.5
getpwent_r@@GLIBC_2.2.5
xdr_u_longlong_t@GLIBC_2.2.5
des_setparity@GLIBC_2.2.5
__strcspn_c2@GLIBC_2.2.5
xdr_u_long@GLIBC_2.2.5
key_decryptsession_pk@GLIBC_2.2.5
pmap_getmaps@GLIBC_2.2.5
clnt_perror@GLIBC_2.2.5
pthread_cond_destroy@GLIBC_2.2.5
loc2@GLIBC_2.2.5
sched_setaffinity@GLIBC_2.3.3
getspnam_r@@GLIBC_2.2.5
sched_setaffinity@@GLIBC_2.3.4
_IO_popen@@GLIBC_2.2.5
clntunix_create@GLIBC_2.2.5
xdr_keybuf@GLIBC_2.2.5
query_module@GLIBC_2.2.5
svcerr_decode@GLIBC_2.2.5
xdr_netnamestr@GLIBC_2.2.5
svcerr_noproc@GLIBC_2.2.5
netname2user@GLIBC_2.2.5
getgrent_r@@GLIBC_2.2.5
callrpc@GLIBC_2.2.5
passwd2des@GLIBC_2.2.5
xdr_wrapstring@GLIBC_2.2.5
_IO_file_sync@@GLIBC_2.2.5
GLIBC_2.18
xdr_uint32_t@GLIBC_2.2.5
step@GLIBC_2.2.5
GLIBC_2.11
xdr_opaque@GLIBC_2.2.5
authnone_create@GLIBC_2.2.5
GLIBC_2.16
pthread_cond_init@@GLIBC_2.3.2
GLIBC_2.17
xdr_void@GLIBC_2.2.5
xdecrypt@GLIBC_2.2.5
getprotobyname_r@@GLIBC_2.2.5
GLIBC_2.13
__rpc_thread_svc_fdset@GLIBC_2.2.5
getnetbyaddr_r@@GLIBC_2.2.5
authdes_pk_create@GLIBC_2.2.5
_sys_errlist@GLIBC_2.2.5
user2netname@GLIBC_2.2.5
_IO_file_write@@GLIBC_2.2.5
__rpc_thread_svc_max_pollfd@GLIBC_2.2.5
__strspn_c3@GLIBC_2.2.5
pthread_cond_destroy@@GLIBC_2.3.2
ustat@GLIBC_2.2.5
pmap_unset@GLIBC_2.2.5
xdr_u_int@GLIBC_2.2.5
nftw@@GLIBC_2.3.3
__sigismember@GLIBC_2.2.5
GLIBC_2.2.6
cfree@GLIBC_2.2.5
xdr_opaque_auth@GLIBC_2.2.5
fopencookie@@GLIBC_2.2.5
fmemopen@GLIBC_2.2.5
__strsep_1c@GLIBC_2.2.5
svc_getreqset@GLIBC_2.2.5
create_module@GLIBC_2.2.5
xdr_string@GLIBC_2.2.5
xdr_bytes@GLIBC_2.2.5
__ctype32_toupper@GLIBC_2.2.5
xdr_pmaplist@GLIBC_2.2.5
__nss_passwd_lookup@GLIBC_2.2.5
sched_getaffinity@@GLIBC_2.3.4
_dl_argv@@GLIBC_PRIVATE
fmemopen@@GLIBC_2.22
posix_spawnp@GLIBC_2.2.5
getrpcent_r@@GLIBC_2.2.5
key_secretkey_is_set@GLIBC_2.2.5
getprotobynumber_r@@GLIBC_2.2.5
host2netname@GLIBC_2.2.5
_IO_file_close_it@@GLIBC_2.2.5
_obstack@GLIBC_2.2.5
my host version-check.sh
Code:
bash, version 5.0.3(1)-release
/bin/sh -> /usr/bin/bash
Binutils: (GNU Binutils for Debian) 2.31.1
bison (GNU Bison) 3.3.2
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.30
diff (GNU diffutils) 3.7
find (GNU findutils) 4.6.0.225-235f
GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.1.2)
/usr/bin/awk -> /usr/bin/gawk
gcc (Debian 8.3.0-6) 8.3.0
g++ (Debian 8.3.0-6) 8.3.0
(Debian GLIBC 2.28-10) 2.28
grep (GNU grep) 3.3
gzip 1.9
Linux version 4.19.0-5-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.37-5+deb10u1 (2019-07-19)
m4 (GNU M4) 1.4.18
GNU Make 4.2.1
GNU patch 2.7.6
Perl version='5.28.1';
Python 3.7.3
sed (GNU sed) 4.7
tar (GNU tar) 1.30
texi2any (GNU texinfo) 6.5
xz (XZ Utils) 5.2.4
g++ compilation OK
 
Old 08-16-2019, 10:55 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,650
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
The problem doesn't lie with glibc but with gcc. The first error message that you get is
Code:
/mnt/lfs/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/8.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find crtbegin.o: No such file or directory
That missing file is part of gcc, so something must have gone wrong with your gcc part 1 installation. You'd at least have to go back and do that section again. If it still comes out wrong, then there is something wrong with the environment you set in Chapter 4. Which means scrapping everything in $LFS/tools and carefully repeating the Chapter 4 stuff before starting the build again with binutils.

btw, it was a total waste of time to do the readelf thing. If you are doing a sanity check and the compile part doesn't work, then there won't be any output file for readelf to check.
 
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
How to solve the eror cannot find -lgcc raviteja1992 Linux - General 4 02-20-2016 04:26 PM
U-boot build fails - cannot find lgcc / gcclib.a lachlanp Linux - Newbie 0 10-15-2014 10:44 PM
Glibc 2.7 Build Error "ld: cannot find -lgcc" binzyw Linux From Scratch 8 06-25-2012 02:51 AM
-lgcc not found. manoj7410 Linux - Embedded & Single-board computer 1 06-12-2012 08:54 AM

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

All times are GMT -5. The time now is 04:08 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