0

I am trying to install GCC 4.9.4 in a non-standard location on Red Hat Linux using the documentation provided.

https://gcc.gnu.org/install/

I do not have sudo, but I have write access to the folder /testbed so I am trying to install GCC and all its prerequisites and dependencies into that directory rather than the default /usr/local.

The prerequisites are installed in the /testbed/local directory and the objdir is /testbed/objects, then from the /testbed/objects directory I run

/testbed/packages/gcc/gcc-4.9.4/configure \
--prefix=/testbed/local \
--program-prefix=test- \
--program-suffix=-4.9.4 \
--enable-multilib \
--with-local-prefix=/testbed/local \
--with-gmp=/testbed/local \
--with-mpfr=/testbed/local \
--with-mpc=/testbed/local`

during the make I get the following error:

/usr/local/bin/ld: 
-plugin-opt=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper: 
error loading plugin: 
-plugin-opt=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper: 
cannot open shared object file: No such file or directory
collect2: error: ld returned 1 exit status

Given that the error seems to use the default path "/usr/local" I'm imagining that --prefix and --local-prefix is not all encompassing when it comes to defining the location you want to install GCC in or there is some other issue regarding the linker director or the lto-wrapper plugin. Does anyone know how I might resolve this issue given the constraints and conditions of what I am trying to accomplish?

  • Please, show gcc --version. – Yurij Goncharuk Apr 25 '18 at 20:10
  • @bad code - You are missing a configure option like --enable-languages=c,c++,fortran . I.e. you probably don't want the trouble building ada,java ! – Knud Larsen Apr 26 '18 at 10:53
  • @YurijGoncharuk gcc (GCC) 4.9.3 Copyright (C) 2015 Free Software Foundation, Inc. – bad code Apr 27 '18 at 15:48
  • @KnudLarsen actually I am specifically doing this to build ada and java! – bad code Apr 27 '18 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.