Hello, I'm trying to build a temporary toolchain using the LFS 8.2 book. I'm not a first time user The only deviation from the book that I'm doing is that instead of installing inside everything in /tools I'm installing it inside /mikeos.
the LFS_TGT variable is set to i686-mikeos-linux-gnu the LFS variable is set to /mnt/lfs Now I will post the configure commands: Binutils-2.30 ../configure --prefix=/mikeos --target=i686-mikeos-linux-gnu --with-lib-path=/mikeos/lib --with-sysroot=/mnt/lfs --disable-nls --disable-werror GCC 7.3.0 - Pass 1 (GCC was patched using the instructions from the book, replacing /tools with /mikeos. I'm attaching the patched files.) ../configure --target=i686-mikeos-linux-gnu --prefix=/mikeos --with-glibc-version=2.11 --with-sysroot=/mnt/lfs --with-newlib --without-headers --with-local-prefix=/mikeos --with-native-system-header-dir=/mikeos/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libmpx --disable-libquadmath --disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++ Glibc 2.27 ../configure --prefix=/mikeos --host=i686-mikeos-linux-gnu --build=i686-pc-linux-gnu --enable-kernel=2.6.32 --with-headers=/mikeos/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes i686-pc-linux-gnu is the output of $(../scripts/config.guess) everything builds smoothly but when I try to compile dummy.c using $LFS_TGT-gcc dummy.c it outputs this error and I can't continue. /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld: cannot find crti.o: No such file or directory collect2: error: ld returned 1 exit status the file that it's looking is inside /mikeos/lib Here's the verbose output: Using built-in specs. COLLECT_GCC=i686-mikeos-linux-gnu-gcc COLLECT_LTO_WRAPPER=/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/lto-wrapper Target: i686-mikeos-linux-gnu Configured with: ../configure --target=i686-mikeos-linux-gnu --prefix=/mikeos --with-glibc-version=2.11 --with-sysroot=/mnt/lfs --with-newlib --without-headers --with-local-prefix=/mikeos --with-native-system-header-dir=/mikeos/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libmpx --disable-libquadmath --disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++ Thread model: single gcc version 7.3.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro' /mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/cc1 -quiet -v -iprefix /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/ dummy.c -quiet -dumpbase dummy.c -mtune=generic -march=pentiumpro -auxbase dummy -version -o /tmp/ccLt7dlq.s GNU C11 (GCC) version 7.3.0 (i686-mikeos-linux-gnu) compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version none GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/include" ignoring duplicate directory "/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include" ignoring duplicate directory "/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include-fixed" ignoring nonexistent directory "/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/include" ignoring duplicate directory "/mnt/lfs/mikeos/include" #include "..." search starts here: #include <...> search starts herecd ..: /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include-fixed /mnt/lfs/mikeos/include End of search list. GNU C11 (GCC) version 7.3.0 (i686-mikeos-linux-gnu) compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version none GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: c1d3a69e3cae498aec5e9863f3833dd4 COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro' /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/as -v --32 -o /tmp/ccyJDQbI.o /tmp/ccLt7dlq.s GNU assembler version 2.30 (i686-mikeos-linux-gnu) using BFD version (GNU Binutils) 2.30 COMPILER_PATH=/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/:/mnt/lfs/mikeos/bin/../libexec/gcc/:/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ LIBRARY_PATH=/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/:/mnt/lfs/mikeos/bin/../lib/gcc/:/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/lib/:/mnt/lfs/mikeos/lib COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro' /mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/collect2 -plugin /mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/liblto_plugin.so -plugin-opt=/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpJK4F0.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc --sysroot=/mnt/lfs --eh-frame-hdr -m elf_i386 -dynamic-linker /mikeos/lib/ld-linux.so.2 crt1.o crti.o /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/crtbegin.o -L/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0 -L/mnt/lfs/mikeos/bin/../lib/gcc -L/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/lib -L/mnt/lfs/mikeos/lib /tmp/ccyJDQbI.o -lgcc -lc -lgcc /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/crtend.o crtn.o /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld: cannot find crti.o: No such file or directory collect2: error: ld returned 1 exit status linux.h.txt is the file gcc/config/linux.h i386_linux.h.txt is the file gcc/config/i386/linux.h i386_linux64.h.txt is the file gcc/config/i386/linux64.h
/* Definitions for Intel 386 running Linux-based GNU systems with ELF format. Copyright (C) 1994-2017 Free Software Foundation, Inc. Contributed by Eric Youngdale. Modified for stabs-in-ELF by H.J. Lu. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #define GNU_USER_LINK_EMULATION "elf_i386" #define GLIBC_DYNAMIC_LINKER "/mikeos/lib/ld-linux.so.2" #undef MUSL_DYNAMIC_LINKER #define MUSL_DYNAMIC_LINKER "/mikeos/lib/ld-musl-i386.so.1" #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/mikeos/lib" #define STANDARD_STARTFILE_PREFIX_2 ""
/* Definitions for AMD x86-64 running Linux-based GNU systems with ELF format. Copyright (C) 2001-2017 Free Software Foundation, Inc. Contributed by Jan Hubicka <j...@suse.cz>, based on linux.h. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #define GNU_USER_LINK_EMULATION32 "elf_i386" #define GNU_USER_LINK_EMULATION64 "elf_x86_64" #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64" #define GLIBC_DYNAMIC_LINKER32 "/mikeos/lib/ld-linux.so.2" #define GLIBC_DYNAMIC_LINKER64 "/mikeos/lib64/ld-linux-x86-64.so.2" #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" #undef MUSL_DYNAMIC_LINKER32 #define MUSL_DYNAMIC_LINKER32 "/mikeos/lib/ld-musl-i386.so.1" #undef MUSL_DYNAMIC_LINKER64 #define MUSL_DYNAMIC_LINKER64 "/mikeos/lib/ld-musl-x86_64.so.1" #undef MUSL_DYNAMIC_LINKERX32 #define MUSL_DYNAMIC_LINKERX32 "/mikeos/lib/ld-musl-x32.so.1" #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/mikeos/lib" #define STANDARD_STARTFILE_PREFIX_2 ""
/* Definitions for systems using the Linux kernel, with or without MMU, using ELF at the compiler level but possibly FLT for final linked executables and shared libraries in some no-MMU cases, and possibly with a choice of libc implementations. Copyright (C) 1995-2017 Free Software Foundation, Inc. Contributed by Eric Youngdale. Modified for stabs-in-ELF by H.J. Lu (h...@lucon.org). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ /* C libraries supported on Linux. */ #ifdef SINGLE_LIBC #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) #undef OPTION_MUSL #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) #undef OPTION_MUSL #define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ do { \ if (OPTION_GLIBC) \ builtin_define ("__gnu_linux__"); \ builtin_define_std ("linux"); \ builtin_define_std ("unix"); \ builtin_assert ("system=linux"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ } while (0) /* Determine which dynamic linker to use depending on whether GLIBC or uClibc or Bionic or musl is the default C library and whether -muclibc or -mglibc or -mbionic or -mmusl has been passed to change the default. */ #define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" #if DEFAULT_LIBC == LIBC_GLIBC #define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) #elif DEFAULT_LIBC == LIBC_UCLIBC #define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) #elif DEFAULT_LIBC == LIBC_BIONIC #define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) #elif DEFAULT_LIBC == LIBC_MUSL #define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) #else #error "Unsupported DEFAULT_LIBC" #endif /* DEFAULT_LIBC */ /* For most targets the following definitions suffice; GLIBC_DYNAMIC_LINKER must be defined for each target using them, or GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets supporting both 32-bit and 64-bit compilation. */ #define UCLIBC_DYNAMIC_LINKER "/mikeos/lib/ld-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKER32 "/mikeos/lib/ld-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKER64 "/mikeos/lib/ld64-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKERX32 "/mikeos/lib/ldx32-uClibc.so.0" #define BIONIC_DYNAMIC_LINKER "/system/bin/linker" #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" /* Should be redefined for each target that supports musl. */ #define MUSL_DYNAMIC_LINKER "/dev/null" #define MUSL_DYNAMIC_LINKER32 "/dev/null" #define MUSL_DYNAMIC_LINKER64 "/dev/null" #define MUSL_DYNAMIC_LINKERX32 "/dev/null" #define GNU_USER_DYNAMIC_LINKER \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) #define GNU_USER_DYNAMIC_LINKER32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) #define GNU_USER_DYNAMIC_LINKER64 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) #define GNU_USER_DYNAMIC_LINKERX32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) /* Whether we have Bionic libc runtime */ #undef TARGET_HAS_BIONIC #define TARGET_HAS_BIONIC (OPTION_BIONIC) /* musl avoids problematic includes by rearranging the include directories. * Unfortunately, this is mostly duplicated from cppdefault.c */ #if DEFAULT_LIBC == LIBC_MUSL #define INCLUDE_DEFAULTS_MUSL_GPP \ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, #ifdef LOCAL_INCLUDE_DIR #define INCLUDE_DEFAULTS_MUSL_LOCAL \ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, #else #define INCLUDE_DEFAULTS_MUSL_LOCAL #endif #ifdef PREFIX_INCLUDE_DIR #define INCLUDE_DEFAULTS_MUSL_PREFIX \ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, #else #define INCLUDE_DEFAULTS_MUSL_PREFIX #endif #ifdef CROSS_INCLUDE_DIR #define INCLUDE_DEFAULTS_MUSL_CROSS \ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, #else #define INCLUDE_DEFAULTS_MUSL_CROSS #endif #ifdef TOOL_INCLUDE_DIR #define INCLUDE_DEFAULTS_MUSL_TOOL \ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, #else #define INCLUDE_DEFAULTS_MUSL_TOOL #endif #ifdef NATIVE_SYSTEM_HEADER_DIR #define INCLUDE_DEFAULTS_MUSL_NATIVE \ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, #else #define INCLUDE_DEFAULTS_MUSL_NATIVE #endif #if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) # undef INCLUDE_DEFAULTS_MUSL_LOCAL # define INCLUDE_DEFAULTS_MUSL_LOCAL # undef INCLUDE_DEFAULTS_MUSL_NATIVE # define INCLUDE_DEFAULTS_MUSL_NATIVE #else # undef INCLUDE_DEFAULTS_MUSL_CROSS # define INCLUDE_DEFAULTS_MUSL_CROSS #endif #undef INCLUDE_DEFAULTS #define INCLUDE_DEFAULTS \ { \ INCLUDE_DEFAULTS_MUSL_GPP \ INCLUDE_DEFAULTS_MUSL_LOCAL \ INCLUDE_DEFAULTS_MUSL_PREFIX \ INCLUDE_DEFAULTS_MUSL_CROSS \ INCLUDE_DEFAULTS_MUSL_TOOL \ INCLUDE_DEFAULTS_MUSL_NATIVE \ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ { 0, 0, 0, 0, 0, 0 } \ } #endif #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ /* This is a *uclinux* target. We don't define below macros to normal linux versions, because doing so would require *uclinux* targets to include linux.c, linux-protos.h, linux.opt, etc. We could, alternatively, add these files to *uclinux* targets, but that would only pollute option list (add -mglibc, etc.) without adding any useful support. */ /* Define TARGET_LIBC_HAS_FUNCTION for *uclinux* targets to no_c99_libc_has_function, because uclibc does not, normally, have c99 runtime. If, in special cases, uclibc does have c99 runtime, this should be defined to a new hook. Also please note that for targets like *-linux-uclibc that similar check will also need to be added to linux_libc_has_function. */ # undef TARGET_LIBC_HAS_FUNCTION # define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function #else /* !uClinux, i.e., normal Linux */ /* Determine what functions are present at the runtime; this includes full c99 runtime and sincos. */ # undef TARGET_LIBC_HAS_FUNCTION # define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function #endif #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/mikeos/lib" #define STANDARD_STARTFILE_PREFIX_2 ""
-- http://lists.linuxfromscratch.org/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page Do not top post on this list. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://en.wikipedia.org/wiki/Posting_style