Hello. I want to know how to solve a problem when install gcc without root and offline. I am installing GCC9.4.0, but there are some errors when executing make command, as follows: make[4]: Entering directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0/lto-plugin' /bin/sh ./libtool --tag=CC --tag=disable-static --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../lto-plugin -I../../ lto-plugin/../include -DHAVE_CONFIG_H -Wall -g -c -o lto-plugin.lo ../../lto-plugin/lto-plugin.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../lto-plugin -I../../lto-plugin/../include -DHAVE_CONFIG_H -Wall -g -c ../../lto-plugin/lto-plugin.c -fPIC -DPIC -o .libs/lto-plugin.o make[4]: Warning: File `../libiberty/pic/libiberty.a' has modification time 8.1 s in the future /bin/sh ./libtool --tag=CC --tag=disable-static --mode=link gcc -Wall -g -Wc,-static-libgcc -module -bindir /public /home/jltu/gcc_build/libexec/gcc/x86_64-pc-linux-gnu/9.4.0 -Xcompiler '-static-libstdc++' -Xcompiler '-static-libg cc' -o liblto_plugin.la -rpath /public/home/jltu/gcc_build/libexec/gcc/x86_64-pc-linux-gnu/9.4.0 lto-plugin.lo -Wc,. ./libiberty/pic/libiberty.a libtool: link: gcc -shared -fPIC -DPIC .libs/lto-plugin.o -static-libgcc -static-libstdc++ -static-libgcc ../lib iberty/pic/libiberty.a -Wl,-soname -Wl,liblto_plugin.so.0 -o .libs/liblto_plugin.so.0.0.0 /usr/bin/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/9.4.0/crtbeginS.o: unrecognized relocation (0x2a) in section `.te xt' /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status make[4]: *** [liblto_plugin.la] Error 1 make[4]: Leaving directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0/lto-plugin' make[3]: *** [all] Error 2 make[3]: Leaving directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0/lto-plugin' make[2]: *** [all-stage1-lto-plugin] Error 2 make[2]: Leaving directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0' make: *** [all] Error 2 Regards Jiali Tu
Thank you , the problem does!
"Xi Ruoyao" <xry111@xry111.site>写道:
> On Sun, 2022-06-05 at 15:06 +0800, 涂家礼 wrote:
>
> /* snip */
>
> > /usr/bin/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/9.4.0/crtbeginS.o: unrecognized relocation (0x2a) in section `.text'
> > /usr/bin/ld: final link failed: Bad value
> > collect2: error: ld returned 1 exit status
> > make[4]: *** [liblto_plugin.la] Error 1
> > make[4]: Leaving directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0/lto-plugin'
> > make[3]: *** [all] Error 2
> > make[3]: Leaving directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0/lto-plugin'
> > make[2]: *** [all-stage1-lto-plugin] Error 2
> > make[2]: Leaving directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0'
> > make[1]: *** [stage1-bubble] Error 2
> > make[1]: Leaving directory `/public/home/jltu/gcc-9.4.0/gcc-9.4.0'
> > make: *** [all] Error 2
>
> According to a stackoverflow.com answer [1] it seems happening because
> your binutils is too old.
>
> [1]: https://stackoverflow.com/questions/52737698
>
> --
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University
Hi! On Sun, Jun 05, 2022 at 03:06:39PM +0800, 涂家礼 wrote: > make[4]: Warning: File `../libiberty/pic/libiberty.a' has modification time 8.1 s in the future This could be a serious problem. But, it seems unrelated to your problem. OTOH, "make" very much does not like things that time travel. > /usr/bin/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/9.4.0/crtbeginS.o: unrecognized relocation (0x2a) in section `.text' Your /usr/bin/ld does not know about the relocation R_X86_64_REX_GOTPCRELX (which is numeric 42) apparently. Use a newer linker? You likely used a newer linker and assembler etc. to compile stuff, to get this far, so figure out why not now? Segher
Thank you, I don't have root access to this computer to correct the system time, and after I backed out to an older gcc and updated a bunch of dependencies, I found that gcc 9.4.0 appears to be working correctly for an offline non-root install.
"Segher Boessenkool" <segher@kernel.crashing.org>写道:
> Hi!
>
> On Sun, Jun 05, 2022 at 03:06:39PM +0800, 涂家礼 wrote:
> > make[4]: Warning: File `../libiberty/pic/libiberty.a' has modification time 8.1 s in the future
>
> This could be a serious problem. But, it seems unrelated to your
> problem. OTOH, "make" very much does not like things that time travel.
>
> > /usr/bin/ld: /usr/local/lib/gcc/x86_64-pc-linux-gnu/9.4.0/crtbeginS.o: unrecognized relocation (0x2a) in section `.text'
>
> Your /usr/bin/ld does not know about the relocation
> R_X86_64_REX_GOTPCRELX (which is numeric 42) apparently. Use a newer
> linker? You likely used a newer linker and assembler etc. to compile
> stuff, to get this far, so figure out why not now?
>
>
> Segher