為什麼我的 Makefile 無法編譯,我該如何解決?
我在為 QEMU 編譯路由器核心時遇到問題。我的路由器使用 OpenWRT 核心在 QEMU 中工作,但網路不起作用。這就是我要編譯原始核心的原因。
以下命令是(主)Makefile 間接執行的有問題的命令。我說間接是因為它甚至沒有明確選擇執行配置腳本,它只是選擇這樣做,因為它位於編譯核心所需的下載包的目錄中。
PATH=/home/debian/build-new/host/bin:/home/debian/build-new/host/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/遊戲:/usr/games AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/ home/debian/build-new/host/usr/bin/ccache /usr/bin/gcc" GCC="/home/debian/build-new/host/usr/bin/ccache /usr/bin/gcc" CXX= “/home/debian/build-new/host/usr/bin/ccache /usr/bin/g++” CPP="/usr/bin/cpp" CPPFLAGS="-I/home/debian/build-new/host/ usr/include" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS= “-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr/庫"PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG="/home/debian/build-new/host/usr/bin/pkg-config” PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_LIBDIR="/home/debian/build-new/host/usr/lib /pkgconfig:/home/debian/build-new/host/usr/share/pkgconfig" PERLLIB="/home/debian/build-new/host/usr/lib/perl" LD_LIBRARY_PATH="/home/debian/build-新/主機/usr/lib:" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/lib -L /home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr/lib" CC="/usr/bin/gcc" ./configure – prefix="/home/debian/build-new/host/usr" –sysconfdir="/home/debian/build-new/host/etc"–enable-shared –disable-static –disable-gtk-doc –disable-doc –disable-docs –disable-documentation –with-xmlto=no –with-fop=no ccache_cv_zlib_1_2_3=no
中斷命令的標誌是 LDFLAGS。
LD="/usr/bin/ld" LDFLAGS="-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl,-rpath,/ home/debian/build-new/host/usr/lib" LDFLAGS="-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl, -rpath,/home/debian/build-new/host/usr/lib"
執行命令的輸出是:
debian@debian-i686:~/build-new/build/host-ccache-3.1.8$ PATH=/home/debian/build-new/host/bin:/home/debian/build-new/host/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/home/debian/build-new/host/usr/bin/ccache /usr/bin/gcc" GCC="/home/debian/build-new/host/usr/bin/ccache /usr/bin/gcc" CXX="/home/debian/build-new/host/usr/bin/ccache /usr/bin/g++" CPP="/usr/bin/cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr/lib" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG="/home/debian/build-new/host/usr/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_LIBDIR="/home/debian/build-new/host/usr/lib/pkgconfig:/home/debian/build-new/host/usr/share/pkgconfig" PERLLIB="/home/debian/build-new/host/usr/lib/perl" LD_LIBRARY_PATH="/home/debian/build-new/host/usr/lib:" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr/lib" CC="/usr/bin/gcc" ./configure --prefix="/home/debian/build-new/host/usr" --sysconfdir="/home/debian/build-new/host/etc" --enable-shared --disable-static --disable-gtk-doc --disable-doc --disable-docs --disable-documentation --with-xmlto=no --with-fop=no ccache_cv_zlib_1_2_3=no configure: WARNING: unrecognized options: --enable-shared, --disable-static, --disable-gtk-doc, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop configure: Configuring ccache checking for gcc... /usr/bin/gcc checking whether the C compiler works... no configure: error: in `/home/debian/build-new/build/host-ccache-3.1.8': configure: error: C compiler cannot create executables See `config.log' for more details
僅刪除 LDFLAGS 可修復特定錯誤,但稍後我會遇到另一個錯誤。
debian@debian-i686:~/build-new/build/host-ccache-3.1.8$ PATH=/home/debian/build-new/host/bin:/home/debian/build-new/host/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/home/debian/build-new/host/usr/bin/ccache /usr/bin/gcc" GCC="/home/debian/build-new/host/usr/bin/ccache /usr/bin/gcc" CXX="/home/debian/build-new/host/usr/bin/ccache /usr/bin/g++" CPP="/usr/bin/cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG="/home/debian/build-new/host/usr/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_LIBDIR="/home/debian/build-new/host/usr/lib/pkgconfig:/home/debian/build-new/host/usr/share/pkgconfig" PERLLIB="/home/debian/build-new/host/usr/lib/perl" LD_LIBRARY_PATH="/home/debian/build-new/host/usr/lib:" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CC="/usr/bin/gcc" ./configure --prefix="/home/debian/build-new/host/usr" --sysconfdir="/home/debian/build-new/host/etc" --enable-shared --disable-static --disable-gtk-doc --disable-doc --disable-docs --disable-documentation --with-xmlto=no --with-fop=no ccache_cv_zlib_1_2_3=no configure: WARNING: unrecognized options: --enable-shared, --disable-static, --disable-gtk-doc, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop configure: Configuring ccache checking for gcc... /usr/bin/gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `/home/debian/build-new/build/host-ccache-3.1.8': configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details
刪除所有標誌(以獲取下面的命令)允許配置腳本完美執行。
./configure –prefix="/home/debian/build-new/host/usr" –sysconfdir="/home/debian/build-new/host/etc" –enable-shared –disable-static - -disable-gtk-doc –disable-doc –disable-docs –disable-documentation –with-xmlto=no –with-fop=no ccache_cv_zlib_1_2_3=no
配置腳本崩潰的原因是它試圖找到文件 path/to/lib/libc.so.0 和 path/to/usr/lib/uclibc_nonshared.a。問題是,腳本試圖在 /lib/ 和 /usr/lib/ 中找到這些庫,即使 Makefile 明確設置了應該從哪裡獲取庫。手動符號連結 LDFLAGS 指向的庫以使其連結到 /lib/ 和 /usr/lib/ 只會導致以下消息:
/usr/bin/ld: skipping incompatible /lib/libc.so.0 when searching for /lib/libc.so.0 /usr/bin/ld: cannot find /lib/libc.so.0 /usr/bin/ld: skipping incompatible /usr/lib/uclibc_nonshared.a when searching for /usr/lib/uclibc_nonshared.a /usr/bin/ld: cannot find /usr/lib/uclibc_nonshared.a
此外,將 LD 標誌設置為
LD="/home/debian/build-new/host/usr/bin/mips-linux-ld"
並不能解決問題。如何讓 Makefile 正確編譯?我在Github 的 gist service上留下了一些日誌和配置。
編輯:
使用@filbranden 的提示,我現在已經達到了獲得結果的程度,例如以下輸出:
/home/debian/build-new/toolchain/gcc-4.7.3-intermediate/./gcc/xgcc -B/home/debian/build-new/toolchain/gcc-4.7.3-intermediate/./gcc/ - B/home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/bin/ -B/home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/lib/ - isystem /home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/include -isystem /home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/sys-include - g -Os -O2 -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -I。-一世。-I../.././gcc -I/home/debian/build-new/toolchain/gcc-4.7.3/libgcc -I/home/debian/build-new/toolchain/gcc-4.7.3/ libgcc/.
/home/debian/build-new/toolchain/gcc-4.7.3-intermediate/./gcc/xgcc -B/home/debian/build-new/toolchain/gcc-4.7.3-intermediate/./gcc/ - B/home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/bin/ -B/home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/lib/ - isystem /home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/include -isystem /home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/sys-include - g -Os -O2 -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -I。-一世。-I../.././gcc -I/home/debian/build-new/toolchain/gcc-4.7.3/libgcc -I/home/debian/build-new/toolchain/gcc-4.7.3/ libgcc/.
/home/debian/build-new/toolchain/gcc-4.7.3-intermediate/./gcc/xgcc -B/home/debian/build-new/toolchain/gcc-4.7.3-intermediate/./gcc/ - B/home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/bin/ -B/home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/lib/ - isystem /home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/include -isystem /home/debian/build-new/host/usr/mips-buildroot-linux-uclibc/sys-include - g -Os -O2 -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -I。-一世。-I../.././gcc -I/home/debian/build-new/toolchain/gcc-4.7.3/libgcc -I/home/debian/build-new/toolchain/gcc-4.7.3/ libgcc/.
這個編譯現在已經執行了 17-18 個小時(並且沒有崩潰或做任何其他事情來表明可能發生了錯誤)。它仍然在fixed-bit.c上工作似乎有點奇怪,但也許這很正常?
使用@filbranden 的評論,我能夠為我的路由器編譯核心(還有更多錯誤需要解決,但這不是這個問題的範圍)。
我在Github gist (new logs and config)上留下了我為編譯核心所做的日誌和配置。配置已損壞,直到實際編譯 linux 階段才會顯現出來,但這些解決方案很簡單。
我執行以下命令來編譯核心:
使 menuconfig O=~/build-new/
RANLIB="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-ranlib" READELF="/home/debian/new-kernel/ sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-readelf" OBJDUMP="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3- 3/usr/bin/mips-linux-uclibc-objdump" AR="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc- ar" AS="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-as" LD="/home/debian/new-核心/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-gcc" NM="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2. 3-3/usr/bin/mips-linux-uclibc-nm" CC="/home/debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-gcc" GCC="/home/debian/bin-new/ ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/gcc" CXX="/home/debian/bin-new/ccache- 3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/g++" CPP="/home/debian/new-kernel/sagem/uclibc- crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/ home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/主機/lib -L/home/debian/build-new/host/usr/lib" 使 autoconf O=~/build-new//home/debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/gcc" CXX="/home /debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/g++" CPP="/home/debian /new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include " CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L /home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib" make autoconf O=~/build-new//home/debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/gcc" CXX="/home /debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/g++" CPP="/home/debian /new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include " CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L /home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib" make autoconf O=~/build-new/8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/g++" CPP="/home/debian/new-kernel/sagem/uclibc-crosstools- gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/home/ debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/ lib -L/home/debian/build-new/host/usr/lib" make autoconf O=~/build-new/8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/g++" CPP="/home/debian/new-kernel/sagem/uclibc-crosstools- gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/home/ debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/ lib -L/home/debian/build-new/host/usr/lib" make autoconf O=~/build-new/-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib" make autoconf O=~/build-new/-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib" make autoconf O=~/build-new/
RANLIB="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-ranlib" READELF="/home/debian/new-kernel/ sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-readelf" OBJDUMP="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3- 3/usr/bin/mips-linux-uclibc-objdump" AR="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc- ar" AS="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-as" LD="/home/debian/new-核心/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-gcc" NM="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2. 3-3/usr/bin/mips-linux-uclibc-nm" CC="/home/debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-gcc" GCC="/home/debian/bin-new/ ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/gcc" CXX="/home/debian/bin-new/ccache- 3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/g++" CPP="/home/debian/new-kernel/sagem/uclibc- crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/ home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/主機/lib -L/home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr/lib" make O=~/build-new/3-3/usr/bin/mips-linux-uclibc-gcc" GCC="/home/debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools- gcc-4.2.3-3/usr/bin/gcc" CXX="/home/debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc- 4.2.3-3/usr/bin/g++" CPP="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/ home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl, -rpath,/home/debian/build-new/host/usr/lib" 使 O=~/build-new/3-3/usr/bin/mips-linux-uclibc-gcc" GCC="/home/debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools- gcc-4.2.3-3/usr/bin/gcc" CXX="/home/debian/bin-new/ccache-3.1.8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc- 4.2.3-3/usr/bin/g++" CPP="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/ home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl, -rpath,/home/debian/build-new/host/usr/lib" 使 O=~/build-new/8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/gcc" CXX="/home/debian/bin-new/ccache-3.1.8/ ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/g++" CPP="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc- 4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/home/debian/ build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/lib - l/home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr/lib" make O=~/build-new/8/ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/gcc" CXX="/home/debian/bin-new/ccache-3.1.8/ ccache /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/g++" CPP="/home/debian/new-kernel/sagem/uclibc-crosstools-gcc- 4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host/usr/include" CFLAGS="-O2 -I/home/debian/ build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS="-L/home/debian/build-new/host/lib - l/home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr/lib" make O=~/build-new//home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host /usr/include" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS ="-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr /lib" 使 O=~/build-new//home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-cpp" CPPFLAGS="-I/home/debian/build-new/host /usr/include" CFLAGS="-O2 -I/home/debian/build-new/host/usr/include" CXXFLAGS="-O2 -I/home/debian/build-new/host/usr/include" LDFLAGS ="-L/home/debian/build-new/host/lib -L/home/debian/build-new/host/usr/lib -Wl,-rpath,/home/debian/build-new/host/usr /lib" 使 O=~/build-new//home/debian/build-new/host/usr/lib" 使 O=~/build-new//home/debian/build-new/host/usr/lib" 使 O=~/build-new/
鑑於以下錯誤,我仍然必須在執行 make 命令之前對一些二進製文件進行符號連結:
Checking for C compiler ... none found ERROR: no C compiler found Checking for linker ... '/home/debian/build-new/host/usr/bin/mips-buildroot-linux-uclibc-gcc' not found (user) ERROR: no linker found Checking for ar ... /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-ar () Checking for ranlib ... /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-ranlib () Checking for readelf ... none found ERROR: no readelf found Checking for objdump ... /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-objdump ()
我符號連結的二進製文件如下。我在我認為符號連結無關緊要的那些前面放了一個井號(因為永遠無法將路徑從前綴設置為 make 命令)。
mkdir -p /home/debian/build-new/host/usr/bin/ cp -r /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/* /home/debian/build-new/host/usr/bin/ cd /home/debian/build-new/host/usr/bin/ ln -s mips-linux-uclibc-gcc mips-buildroot-linux-uclibc-gcc #ln -s /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-ranlib mips-buildroot-linux-uclibc-ranlib #ln -s /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-readelf mips-buildroot-linux-uclibc-readelf #ln -s /home/debian/new-kernel/sagem/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-objdump mips-buildroot-linux-uclibc-objdump
在建構核心本身時,此處的配置和命令仍然存在問題,但它們的功能足以克服此錯誤。今天早上我成功編譯了核心(純編譯時間超過 24 小時),但是在 QEMU 中啟動它並掛載我從路由器複製的文件系統後,我意識到我選擇了錯誤的字節順序(我選擇了LSB 而不是 MSB,選擇大端而不是小端)。
否則,我已經使用@filbranden 的幫助成功編譯了核心。