fedora20编译grub-0.97

时间:2021-08-08 19:28:30

gcc 版本 4.8.2 20131212

  1. error1
    configure:2424: gcc -m32 conftest.c >&5/usr/bin/ld: cannot find crt1.o: No such file or directory
    /usr/bin/ld: cannot find crti.o: No such file or directory
    /usr/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc
    /usr/bin/ld: cannot find -lc
    /usr/bin/ld: cannot find crtn.o: No such file or directory
    collect2: error: ld returned 1 exit status

    解决

    yum install glibc-devel.i686
  2. error2
    configure:2424: gcc -m32    conftest.c  >&5
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.2/libgcc_s.so when searching for -lgcc_s
    /usr/bin/ld: cannot find -lgcc_s
    collect2: error: ld returned 1 exit status

    解决

    yum install libgcc.i686
  3. error3
    configure: error: GRUB requires a working absolute objcopy; upgrade your binutils

    两种解决方案

    1、采用旧版本的gcc编译,gcc-3.4(compat-gcc-34)
    ./configure CC=gcc34
    2、修改./configure文件LINE3906,将 objcopy -O binary 修改为 objcopy -R .note.gnu.build-id -O binary(这个试了以下stage文件会有一两百MB)