LinuxQuestions.org
Help answer threads with 0 replies.
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 08-28-2023, 08:42 PM   #1
braving
LQ Newbie
 
Registered: May 2010
Posts: 15

Rep: Reputation: 0
"stack smashing detected" when make check of glibc


Hello there,
I followed instructions in LFS 11.3 and everything worked until
"stack smashing detected" reported when doing make check in 8.5.
I tried a second time after rming & restoring backup made in 7.13 and failed with the same error.
Code:
make[4]: Entering directory '/sources/glibc-2.37/string'
make[4]: Leaving directory '/sources/glibc-2.37/string'
make subdir=time -C ../time ..=../ objdir=/sources/glibc-2.37/build -f Makefile -f ../elf/rtld-Rules rtld-all rtld-modules='rtld-setitimer.os'
make[4]: Entering directory '/sources/glibc-2.37/time'
make[4]: Leaving directory '/sources/glibc-2.37/time'
make[3]: Leaving directory '/sources/glibc-2.37/elf'
make[2]: Leaving directory '/sources/glibc-2.37/elf'
/usr/bin/install -c -m 644 /sources/glibc-2.37/build/libc.a /usr/lib/libc.a
/usr/bin/install -c -m 644 /sources/glibc-2.37/build/libc_nonshared.a /usr/lib/libc_nonshared.a
/usr/bin/install -c /sources/glibc-2.37/build/libc.so /usr/lib/libc.so.6.new
mv -f /usr/lib/libc.so.6.new /usr/lib/libc.so.6
(echo '/* GNU ld script';\
 echo '   Use the shared library, but some functions are only in';\
 echo '   the static library, so try that secondarily.  */';\
 cat /sources/glibc-2.37/build/format.lds; \
 echo 'GROUP ( /usr/lib/libc.so.6' \
      '/usr/lib/libc_nonshared.a'\
      ' AS_NEEDED (' /usr/lib/ld-linux-x86-64.so.2 ') )' \
) > /usr/lib/libc.so.new
*** stack smashing detected ***: terminated
make[1]: *** [Makerules:1051: /usr/lib/libc.so] Aborted
make[1]: Leaving directory '/sources/glibc-2.37'
make: *** [Makefile:12: install] Error 2
(lfs chroot) root:/sources/glibc-2.37/build# ls  
*** stack smashing detected ***: terminated
Aborted
(lfs chroot) root:/sources/glibc-2.37/build# ldd ls
*** stack smashing detected ***: terminated
Aborted
(lfs chroot) root:/sources/glibc-2.37/build# pwd
/sources/glibc-2.37/build
(lfs chroot) root:/sources/glibc-2.37/build# which pwd
bash: which: command not found
(lfs chroot) root:/sources/glibc-2.37/build#
I can't figure out the root cause and guess it has something to do with glibc, since ls/ldd also errored( but don't know why pwd didn't).
The libc etc on partly build lfs:
Code:
root@slacktest:~# ls $LFS/usr/lib/libc* -l
-rw-r--r-- 1 root root 24545770 Aug 28 07:47 /mnt/lfs/usr/lib/libc.a
-rw-r--r-- 1 root root      255 Aug 23 10:05 /mnt/lfs/usr/lib/libc.so
-rwxr-xr-x 1 root root 12430032 Aug 28 07:47 /mnt/lfs/usr/lib/libc.so.6
lrwxrwxrwx 1 root root       22 Aug 23 10:05 /mnt/lfs/usr/lib/libc_malloc_debug.so -> libc_malloc_debug.so.0
-rwxr-xr-x 1 root root   191648 Aug 23 10:05 /mnt/lfs/usr/lib/libc_malloc_debug.so.0
-rw-r--r-- 1 root root    22242 Aug 28 07:47 /mnt/lfs/usr/lib/libc_nonshared.a
-rw-r--r-- 1 root root   159452 Aug 23 10:05 /mnt/lfs/usr/lib/libcrypt.a
lrwxrwxrwx 1 root root       13 Aug 23 10:05 /mnt/lfs/usr/lib/libcrypt.so -> libcrypt.so.1
-rwxr-xr-x 1 root root   132032 Aug 23 10:05 /mnt/lfs/usr/lib/libcrypt.so.1
lrwxrwxrwx 1 root root       21 Aug 23 15:10 /mnt/lfs/usr/lib/libctf-nobfd.so -> libctf-nobfd.so.0.0.0
lrwxrwxrwx 1 root root       21 Aug 23 15:10 /mnt/lfs/usr/lib/libctf-nobfd.so.0 -> libctf-nobfd.so.0.0.0
-rwxr-xr-x 1 root root  1514768 Aug 23 15:10 /mnt/lfs/usr/lib/libctf-nobfd.so.0.0.0
lrwxrwxrwx 1 root root       15 Aug 23 15:10 /mnt/lfs/usr/lib/libctf.so -> libctf.so.0.0.0
lrwxrwxrwx 1 root root       15 Aug 23 15:10 /mnt/lfs/usr/lib/libctf.so.0 -> libctf.so.0.0.0
-rwxr-xr-x 1 root root  1351520 Aug 23 15:10 /mnt/lfs/usr/lib/libctf.so.0.0.0
root@slacktest:~#
I searched but had no clue as to what to do with it, hope someone here could possbilily point me in the right direction.

**********
Correction: "make test" in both title and the post should be "make install", I just recall it a moment ago and sorry for the confusion.
**********

Last edited by braving; 08-29-2023 at 01:31 AM. Reason: make check should be make install & sorry for the confusion
 
Old 08-30-2023, 05:47 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,305

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Wow, it's been a while since I used stacks.

Stacks are ram spaces internal to the cpu. Let's stick with 1 process, 1 core, & no OS just for the purposes of explaining. There are 2 stack assembler instructions
  • push <register>
  • pop <register>
Now if your process was running and received an interrupt, it would want to deal with that, so it might need a few registers. So it could issue short 'push' instructions to registers to save their contents, handle the interrupt, and then issue pop instructions IN REVERSE ORDER to the same registers to restore their contents. The security risk is that you can put numbers on the stack, knowing that sooner or later they will be popped into a register and acted on. There's no builtin error checking.

With multicore cpus running hundreds of processes and an OS jumping in, it's vastly more complicated. Stack protection is implemented, and your own kernel probably has raised a red flag, and killed the compile. That's what it looks like.

Start over. New archive, new compile, check the checksum on the download, reapply the patches (if any) and see if it happens the second time. What's your host OS? Some are not suitable.
 
2 members found this post helpful.
Old 08-30-2023, 07:58 PM   #3
braving
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Thank you business_kid for the reply.
My host:
Code:
root@slacktest14:~# uname -a
Linux slacktest14 3.2.29 #2 SMP Mon Sep 17 14:19:22 CDT 2012 x86_64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz GenuineIntel GNU/Linux
root@slacktest14:~#
I remembered an off-track which I recalled & forgot again while reading your answer: gcc being 4.9, not 5.1 as in host requirment. I will start over again as you suggested with correct gcc and may be other libs version.
While looking for clues, I found there is livecd version of lfs and can service as a known good host to build things and therefore may act as plan B for me I think.
Anyway I will get back. Enjoy the day!
 
Old 08-31-2023, 04:41 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,305

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Gcc-5.x is seriously old. If you're building antique software, you know what you're doing. Older stuff often has exploitable holes.

My slackware64-15.0 has gcc-11.2.0, glibc-2.33 & LTS kernel 5.15.63( originally 5.15.19). I installed ~Current on my Raspberry Pi last night. That has gcc-13.2.0, glibc-2.37 & kernel-6.4.8. I'd use a modern system to install modern stuff with. You're running kernel-3.2.29, & gcc-4.9. Be serious. That's your problem!

You're also going to run into countless 'undefined reference' errors and bizarre errors from ancient headers. In short, install a much newer system before you compile anything.
 
2 members found this post helpful.
Old 08-31-2023, 08:00 PM   #5
braving
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Hi business_kid,
Thanks for the input, I'd say my system is much old and I'm considering an upgrade and in fact this building lfs is part of the effort and till now it has not been much progress.
The 5.1 gcc and 3.2 kernel is as what required in LFS book 11.3, which is the highest version I had read about, the livecd thing is much older so I'd stick with 11.3 and see where it goes.
Have a good day.

=============
There actually is LFS 12.0 with much higher os &libs, but since 11.3 is what I have system most close to and all the packages, I may just don't switch, and besides it is just one version higher.

Last edited by braving; 08-31-2023 at 08:19 PM.
 
Old 08-31-2023, 10:34 PM   #6
braving
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Errors occured during make in 5.3 (GCC12.2.0 pass 1)
Code:
g++ -std=gnu++11  -fno-PIE -c   -g -O2     -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I/mnt/lfs/sources/gcc-12.2.0/build/./gmp -I/mnt/lfs/sources/gcc-12.2.0/gmp -I/mnt/lfs/sources/gcc-12.2.0/build/./mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpc/src  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   -o i386.o -MT i386.o -MMD -MP -MF ./.deps/i386.TPo ../../gcc/config/i386/i386.cc
In file included from ../../gcc/config/i386/i386.cc:95:0:
../../gcc/config/i386/i386-builtins.h:310:1: error: narrowing conversion of '9223372036854775808ul' from 'long unsigned int' to 'long int' inside { }
 };
 ^
../../gcc/config/i386/i386-builtin.def:472:1: note: in expansion of macro 'BDESC_END'
 BDESC_END (SPECIAL_ARGS, PURE_ARGS)
 ^
../../gcc/config/i386/i386-builtins.h:310:1: error: narrowing conversion of '9223372036854775808ul' from 'long unsigned int' to 'long int' inside { }
 };
 ^
../../gcc/config/i386/i386-builtin.def:472:1: note: in expansion of macro 'BDESC_END'
 BDESC_END (SPECIAL_ARGS, PURE_ARGS)
 ^
../../gcc/config/i386/i386-builtins.h:310:1: error: narrowing conversion of '9223372036854775810ul' from 'long unsigned int' to 'long int' inside { }
 };
 ^
../../gcc/config/i386/i386-builtin.def:472:1: note: in expansion of macro 'BDESC_END'
 BDESC_END (SPECIAL_ARGS, PURE_ARGS)
 ^
../../gcc/config/i386/i386-builtins.h:310:1: error: narrowing conversion of '9223372036854775810ul' from 'long unsigned int' to 'long int' inside { }
 };
 ^
../../gcc/config/i386/i386-builtin.def:472:1: note: in expansion of macro 'BDESC_END'
 BDESC_END (SPECIAL_ARGS, PURE_ARGS)
 ^
../../gcc/config/i386/i386.cc:203:1: error: narrowing conversion of '4294967294u' from 'unsigned int' to 'int' inside { }
 };
 ^
../../gcc/config/i386/i386.cc:203:1: error: narrowing conversion of '4294967294u' from 'unsigned int' to 'int' inside { }
../../gcc/config/i386/i386.cc:203:1: error: narrowing conversion of '4294967294u' from 'unsigned int' to 'int' inside { }
../../gcc/config/i386/i386.cc:203:1: error: narrowing conversion of '4294967294u' from 'unsigned int' to 'int' inside { }
../../gcc/config/i386/i386.cc:203:1: error: narrowing conversion of '4294967295u' from 'unsigned int' to 'int' inside { }
../../gcc/config/i386/i386.cc:203:1: error: narrowing conversion of '4294967295u' from 'unsigned int' to 'int' inside { }
and dozens of almost identical lines as the last follow.

Then make abort:
Code:
../../gcc/config/i386/i386.cc:313:1: error: narrowing conversion of '4294967295u' from 'unsigned int' to 'int' inside { }
../../gcc/config/i386/i386.cc:313:1: error: narrowing conversion of '4294967295u' from 'unsigned int' to 'int' inside { }
Makefile:2414: recipe for target 'i386.o' failed
make[2]: *** [i386.o] Error 1
make[2]: Leaving directory '/mnt/lfs/sources/gcc-12.2.0/build/gcc'
Makefile:4601: recipe for target 'all-gcc' failed
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory '/mnt/lfs/sources/gcc-12.2.0/build'
Makefile:1017: recipe for target 'all' failed
make: *** [all] Error 2
lfs:/mnt/lfs/sources/gcc-12.2.0/build$
Some warnings before the above errors:
Code:
g++ -std=gnu++11  -fno-PIE -c   -g -O2     -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I/mnt/lfs/sources/gcc-12.2.0/build/./gmp -I/mnt/lfs/sources/gcc-12.2.0/gmp -I/mnt/lfs/sources/gcc-12.2.0/build/./mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpc/src  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   -o tree-diagnostic-path.o -MT tree-diagnostic-path.o -MMD -MP -MF ./.deps/tree-diagnostic-path.TPo ../../gcc/tree-diagnostic-path.cc
../../gcc/tree-diagnostic-path.cc: In member function 'virtual label_text {anonymous}::path_label::get_text(unsigned int) const':
../../gcc/tree-diagnostic-path.cc:68:60: warning: unknown conversion type character '@' in format [-Wformat=]
     pp_printf (&pp, "%@ %s", &event_id, event_text.m_buffer);
                                                            ^
../../gcc/tree-diagnostic-path.cc:68:60: warning: format '%s' expects argument of type 'char*', but argument 3 has type 'diagnostic_event_id_t*' [-Wformat=]
../../gcc/tree-diagnostic-path.cc:68:60: warning: too many arguments for format [-Wformat-extra-args]
../../gcc/tree-diagnostic-path.cc: In member function 'void {anonymous}::event_range::print(diagnostic_context*)':
more warnings:
Code:
g++ -std=gnu++11  -fno-PIE -c   -g -O2     -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I/mnt/lfs/sources/gcc-12.2.0/build/./gmp -I/mnt/lfs/sources/gcc-12.2.0/gmp -I/mnt/lfs/sources/gcc-12.2.0/build/./mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpc/src  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   -o tree-vect-data-refs.o -MT tree-vect-data-refs.o -MMD -MP -MF ./.deps/tree-vect-data-refs.TPo ../../gcc/tree-vect-data-refs.cc
In file included from ../../gcc/hash-table.h:248:0,
                 from ../../gcc/coretypes.h:486,
                 from ../../gcc/tree-vect-data-refs.cc:24:
../../gcc/vec.h: In function 'void vect_permute_load_chain(vec_info*, vec<tree_node*>, unsigned int, stmt_vec_info, gimple_stmt_iterator*, vec<tree_node*>*)':
../../gcc/vec.h:890:19: warning: array subscript is above array bounds [-Warray-bounds]
   return m_vecdata[ix];
                   ^
../../gcc/vec.h:890:19: warning: array subscript is above array bounds [-Warray-bounds]
../../gcc/vec.h: In function 'bool vect_grouped_store_supported(tree, long unsigned int)':
../../gcc/vec.h:890:19: warning: array subscript is above array bounds [-Warray-bounds]
   return m_vecdata[ix];
The packages are md5 checked and have the correct versions:
Code:
lfs:~$ bash version-check.sh 
bash, version 4.2.37(2)-release
/bin/sh -> /bin/bash
Binutils: (Linux/GNU Binutils) 2.22.52.0.2.20120424
bison (GNU Bison) 2.7
yacc is bison (GNU Bison) 2.7
Coreutils:  8.19
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /bin/gawk-3.1.8
gcc (GCC) 5.1.0
g++ (GCC) 5.1.0
grep (GNU grep) 2.14
gzip 1.5
Linux version 3.2.29 (root@hive64) (gcc version 4.7.1 (GCC) ) #2 SMP Mon Sep 17 14:19:22 CDT 2012
m4 (GNU M4) 1.4.16
GNU Make 4.0
GNU patch 2.7
Perl version='5.16.1';
Python 3.4.0
GNU sed version 4.2.1
tar (GNU tar) 1.26
makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.0.4
g++ compilation OK
lfs:~$
So what's wrong here? How should I continue?
 
Old 09-01-2023, 12:26 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,576
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
Quote:
Originally Posted by braving View Post
The 5.1 gcc and 3.2 kernel is as what required in LFS book 11.3, which is the highest version I had read about, the livecd thing is much older so I'd stick with 11.3 and see where it goes.
Have a good day.

=============
There actually is LFS 12.0 with much higher os &libs, but since 11.3 is what I have system most close to and all the packages, I may just don't switch, and besides it is just one version higher.
I don't know where you are getting your info from. I've just called up the current stable LFS (which is indeed 11.3) and it has gcc-12.2.0 and kernel 6.1.11.
 
Old 09-01-2023, 01:06 AM   #8
braving
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by hazel View Post
I don't know where you are getting your info from. I've just called up the current stable LFS (which is indeed 11.3) and it has gcc-12.2.0 and kernel 6.1.11.
Thank you hazel for the input, u r right in the highest stable version being 11.3 with GCC12 and kernel 6 being the verions of target. I just found LFS 12 is rc version.
GCC5.1 and 3.2 kernel https://www.linuxfromscratch.org/lfs.../hostreqs.htmlis the minimum requirement of the host, and I think things should go well if that are met.
 
Old 09-20-2023, 03:03 AM   #9
braving
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Unhappy

Update follow #6
After upgrade gcc from 5.1 to 5.2 on host and start all over again, it worked until errored in 8.5 make install, with seemingly the same error as #1 "stack smashing detected":
Code:
make subdir=stdio-common -C ../stdio-common ..=../ objdir=/sources/glibc-2.37/build -f Makefile -f ../elf/rtld-Rules rtld-all rtld-modules='rtld-errname.os'
make[4]: Entering directory '/sources/glibc-2.37/stdio-common'
make[4]: Leaving directory '/sources/glibc-2.37/stdio-common'
make subdir=string -C ../string ..=../ objdir=/sources/glibc-2.37/build -f Makefile -f ../elf/rtld-Rules rtld-all rtld-modules='rtld-memchr.os rtld-memcmp.os rtld-memcpy.os rtld-memmove.os rtld-mempcpy.os rtld-memset.os rtld-rawmemchr.os rtld-stpcpy.os rtld-strchr.os rtld-strcmp.os rtld-strcspn.os rtld-strdup.os rtld-strerrorname_np.os rtld-strlen.os rtld-strncmp.os rtld-strnlen.os rtld-memchr-avx2.os rtld-memchr.os rtld-memchr-avx2-rtm.os rtld-memchr.os rtld-memchr-evex.os rtld-memchr.os rtld-memchr-evex-rtm.os rtld-memchr.os rtld-memchr-sse2.os rtld-memchr.os rtld-memcmp-avx2-movbe.os rtld-memcmp.os rtld-memcmp-avx2-movbe-rtm.os rtld-memcmp.os rtld-memcmp-evex-movbe.os rtld-memcmp.os rtld-memcmp-sse2.os rtld-memcmp.os rtld-memmove-avx-unaligned-erms.os rtld-mempcpy.os rtld-memmove-avx-unaligned-erms-rtm.os rtld-mempcpy.os rtld-memmove-avx512-no-vzeroupper.os rtld-mempcpy.os rtld-memmove-avx512-unaligned-erms.os rtld-mempcpy.os rtld-memmove-erms.os rtld-mempcpy.os rtld-memmove-evex-unaligned-erms.os rtld-mempcpy.os rtld-memmove-sse2-unaligned-erms.os rtld-mempcpy.os rtld-memmove-ssse3.os rtld-mempcpy.os rtld-memset-avx2-unaligned-erms.os rtld-memset.os rtld-memset-avx2-unaligned-erms-rtm.os rtld-memset.os rtld-memset-avx512-no-vzeroupper.os rtld-memset.os rtld-memset-avx512-unaligned-erms.os rtld-memset.os rtld-memset-erms.os rtld-memset.os rtld-memset-evex-unaligned-erms.os rtld-memset.os rtld-memset-sse2-unaligned-erms.os rtld-memset.os rtld-rawmemchr-avx2.os rtld-rawmemchr.os rtld-rawmemchr-avx2-rtm.os rtld-rawmemchr.os rtld-rawmemchr-evex.os rtld-rawmemchr.os rtld-rawmemchr-evex-rtm.os rtld-rawmemchr.os rtld-rawmemchr-sse2.os rtld-rawmemchr.os rtld-stpcpy-avx2.os rtld-stpcpy.os rtld-stpcpy-avx2-rtm.os rtld-stpcpy.os rtld-stpcpy-evex.os rtld-stpcpy.os rtld-stpcpy-sse2.os rtld-stpcpy.os rtld-stpcpy-sse2-unaligned.os rtld-stpcpy.os rtld-strchr-avx2.os rtld-strchr.os rtld-strchr-avx2-rtm.os rtld-strchr.os rtld-strchr-evex.os rtld-strchr.os rtld-strchr-sse2.os rtld-strchr.os rtld-strchr-sse2-no-bsf.os rtld-strchr.os rtld-strcmp-avx2.os rtld-strcmp.os rtld-strcmp-avx2-rtm.os rtld-strcmp.os rtld-strcmp-evex.os rtld-strcmp.os rtld-strcmp-sse2.os rtld-strcmp.os rtld-strcmp-sse2-unaligned.os rtld-strcmp.os rtld-strcmp-sse4_2.os rtld-strcmp.os rtld-strcspn-sse4.os rtld-strcspn.os rtld-strlen-avx2.os rtld-strlen.os rtld-strlen-avx2-rtm.os rtld-strlen.os rtld-strlen-evex.os rtld-strlen.os rtld-strlen-sse2.os rtld-strlen.os rtld-strncmp-avx2.os rtld-strncmp.os rtld-strncmp-avx2-rtm.os rtld-strncmp.os rtld-strncmp-evex.os rtld-strncmp.os rtld-strncmp-sse2.os rtld-strncmp.os rtld-strncmp-sse4_2.os rtld-strncmp.os rtld-strnlen-avx2.os rtld-strnlen.os rtld-strnlen-avx2-rtm.os rtld-strnlen.os rtld-strnlen-evex.os rtld-strnlen.os rtld-strnlen-sse2.os rtld-strnlen.os rtld-varshift.os rtld-strcspn-sse4.os rtld-strcspn-generic.os rtld-strcspn.os rtld-cacheinfo.os rtld-memmove-avx512-no-vzeroupper.os rtld-strerrorname_np.os rtld-strchrnul.os rtld-strcspn-generic.os rtld-strchrnul-avx2.os rtld-strchrnul.os rtld-strchrnul-avx2-rtm.os rtld-strchrnul.os rtld-strchrnul-evex.os rtld-strchrnul.os rtld-strchrnul-sse2.os rtld-strchrnul.os'
make[4]: Entering directory '/sources/glibc-2.37/string'
make[4]: Leaving directory '/sources/glibc-2.37/string'
make subdir=time -C ../time ..=../ objdir=/sources/glibc-2.37/build -f Makefile -f ../elf/rtld-Rules rtld-all rtld-modules='rtld-setitimer.os'
make[4]: Entering directory '/sources/glibc-2.37/time'
make[4]: Leaving directory '/sources/glibc-2.37/time'
make[3]: Leaving directory '/sources/glibc-2.37/elf'
make[2]: Leaving directory '/sources/glibc-2.37/elf'
/usr/bin/install -c -m 644 /sources/glibc-2.37/build/libc.a /usr/lib/libc.a
/usr/bin/install -c -m 644 /sources/glibc-2.37/build/libc_nonshared.a /usr/lib/libc_nonshared.a
/usr/bin/install -c /sources/glibc-2.37/build/libc.so /usr/lib/libc.so.6.new
mv -f /usr/lib/libc.so.6.new /usr/lib/libc.so.6
(echo '/* GNU ld script';\
 echo '   Use the shared library, but some functions are only in';\
 echo '   the static library, so try that secondarily.  */';\
 cat /sources/glibc-2.37/build/format.lds; \
 echo 'GROUP ( /usr/lib/libc.so.6' \
      '/usr/lib/libc_nonshared.a'\
      ' AS_NEEDED (' /usr/lib/ld-linux-x86-64.so.2 ') )' \
) > /usr/lib/libc.so.new
*** stack smashing detected ***: terminated
make[1]: *** [Makerules:1051: /usr/lib/libc.so] Aborted
make[1]: Leaving directory '/sources/glibc-2.37'
make: *** [Makefile:12: install] Error 2
(lfs chroot) root:/sources/glibc-2.37/build#
BTW, building on lfs livecd 6.3 worked, but no reference seemed can be drawn here since the build process is quite subtle and different.
Any suggestion is greatly welcome.
 
Old 09-20-2023, 05:09 AM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,305

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Just a note in passing. Gcc-5.1.x and kernel-3.x are very old by modern standards. Glibc-2.37 and gcc-12.2.x are quite new. It's best for LFS to have programs of the same vintage compiling together. You apparently have a fairly old system doing the work. Is that a Red Hat system? RH, Centos, Fedora, Scientific Linux, etc.

None of those make good bases for LFS. I tried. The second pass of gcc in chapter 6 has tests that fairly well have to pass. They didn't, and I went down in flames. I had to throw that work away. It's better to save you pain now if you're on that road.
 
1 members found this post helpful.
Old 09-20-2023, 05:14 AM   #11
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,576
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
By the time you get to chapter 8, you should be using your own tools exclusively. That includes the final version of gcc-13.2.0 built in chapter 6.18. So now I'm as puzzled as you are.

LFS doesn't support the live cd any more and no later versions have been produced. I'm surprised that an old one still worked for you. But you need to understand that the build process of the latest versions is completely different logically from the older method in which all the tools were built in the tools directory. Nowadays most of the toolchain is installed directly onto the new partition and then overwritten by the final versions.
 
1 members found this post helpful.
Old 09-20-2023, 01:18 PM   #12
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,305

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Quote:
Originally Posted by hazel View Post
By the time you get to chapter 8, you should be using your own tools exclusively. That includes the final version of gcc-13.2.0 built in chapter 6.18. So now I'm as puzzled as you are.

LFS doesn't support the live cd any more and no later versions have been produced. I'm surprised that an old one still worked for you. But you need to understand that the build process of the latest versions is completely different logically from the older method in which all the tools were built in the tools directory. Nowadays most of the toolchain is installed directly onto the new partition and then overwritten by the final versions.
He could build LFS from one of Alien Bob's LiveSlak usb keys, couldn't he? That would look after the versions problem. I imagine some have done it already. Any linux that will runs a bash script and has Squashfs tools should build the Liveslak usb.
 
Old 09-20-2023, 09:46 PM   #13
braving
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by business_kid View Post
Just a note in passing. Gcc-5.1.x and kernel-3.x are very old by modern standards. Glibc-2.37 and gcc-12.2.x are quite new. It's best for LFS to have programs of the same vintage compiling together. You apparently have a fairly old system doing the work. Is that a Red Hat system? RH, Centos, Fedora, Scientific Linux, etc.

None of those make good bases for LFS. I tried. The second pass of gcc in chapter 6 has tests that fairly well have to pass. They didn't, and I went down in flames. I had to throw that work away. It's better to save you pain now if you're on that road.
Hi Business_kid,
Yes, Gcc 5.1 and kernel 3.2 are fairly old but they are on the sw/os version list supported by lfs 11.3 so I take that it should work with these versions though the progress so far didn't.
I have projects at workplace that use gcc 4.9, glibc 2.17(19?), Qt5.x etc , so I need to upgrade to a system with these old versions of apps that is why I can't just go straight to "modern" systems.
 
Old 09-20-2023, 10:22 PM   #14
braving
LQ Newbie
 
Registered: May 2010
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by hazel View Post
By the time you get to chapter 8, you should be using your own tools exclusively. That includes the final version of gcc-13.2.0 built in chapter 6.18. So now I'm as puzzled as you are.

LFS doesn't support the live cd any more and no later versions have been produced. I'm surprised that an old one still worked for you. But you need to understand that the build process of the latest versions is completely different logically from the older method in which all the tools were built in the tools directory. Nowadays most of the toolchain is installed directly onto the new partition and then overwritten by the final versions.
Hi hazel,
Yes, I followed the build process as the book said but since there are many steps I'm not sure if there isn't any mistake made, or if its just version vintage problem as Business_kid said.
I just recalled that right before 8.5 make install, make test finished with errors plus dozons of fail, xfail and xpass(no idea what the later two are for). Don't know if that matters.
 
Old 09-21-2023, 05:48 AM   #15
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,576
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
Quote:
Originally Posted by braving View Post
I just recalled that right before 8.5 make install, make test finished with errors plus dozons of fail, xfail and xpass(no idea what the later two are for). Don't know if that matters.
Yes, it does. The XFAIL and XPASS (expected failure and unexpected success) are not significant. Expected failures are due to your system, not the software under test, and unexpected passes are just freaks. But if you get a lot of real failures on something as vital as glibc, that indicates a serious problem. The first thing to do is to go to the test website (link given in the gcc build chapter) and see if the official build gave those failures too.
 
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
1. stack smashing detected, aborting falkon; 2. browser thinks camera is in use shachter SUSE / openSUSE 7 08-14-2019 11:11 AM
LXer: Firefox 65 Enhances Security on Linux via Stronger "Stack Smashing" Protection LXer Syndicated Linux News 0 01-30-2019 02:21 AM
*** stack smashing detected *** in tcl script ines8989 Linux - Networking 24 05-06-2013 07:09 AM
SARG: *** stack smashing detected ***: sarg terminated Aborted btaylor1988 Linux - Server 0 06-10-2008 03:28 AM
strcat giving a stack smashing detected error ashlesha Programming 2 03-11-2007 11:15 AM

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

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