public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* cannot find -l-static-libgcc when building gcc from source
@ 2020-11-02 15:32 Eric Pellegrini
  2020-11-02 17:44 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Pellegrini @ 2020-11-02 15:32 UTC (permalink / raw)
  To: gcc-help

Hi all,

I try to build gcc (9.3.0) from source on ubuntu focal using the following
configure call:

./configure --enable-shared --enable-multilib --prefix=/opt/gcc

The configure runs OK but when building/linking I get the following error:

libtool: link: gcc -shared  -fPIC -DPIC  .libs/lto-plugin.o   -l
-static-libgcc -static-libstdc++ -static-libgcc
../libiberty/pic/libiberty.a   -Wl,-soname -Wl,liblto_plugin.so.0 -o
.libs/liblto_plugin.so.0.0.0
/usr/bin/ld: cannot find -l-static-libgcc

It seems that some gcc linker options have been but in the wrong
place. I have the same mistake with another version of gcc (6.5.0) so
the
problem seems to be on my side. Would you have any idea about what is
wrong with my settings ? Am I missing a dependency ?

many thanks in advance for your help

Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cannot find -l-static-libgcc when building gcc from source
  2020-11-02 15:32 cannot find -l-static-libgcc when building gcc from source Eric Pellegrini
@ 2020-11-02 17:44 ` Jonathan Wakely
  2020-11-03  7:47   ` Eric Pellegrini
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2020-11-02 17:44 UTC (permalink / raw)
  To: Eric Pellegrini; +Cc: gcc-help

On Mon, 2 Nov 2020 at 15:34, Eric Pellegrini via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hi all,
>
> I try to build gcc (9.3.0) from source on ubuntu focal using the following
> configure call:
>
> ./configure --enable-shared --enable-multilib --prefix=/opt/gcc

Don't do that, see https://gcc.gnu.org/wiki/InstallingGCC

> The configure runs OK but when building/linking I get the following error:
>
> libtool: link: gcc -shared  -fPIC -DPIC  .libs/lto-plugin.o   -l

There's an argument missing here, it should be -l SOMETHING

> -static-libgcc -static-libstdc++ -static-libgcc

and that means the -static-libgcc gets treated as the argument to -l

My guess is you have something defined in your environment, like
LDFLAGS=-l or something like that. Check the output of 'env' and unset
anything you don't need.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cannot find -l-static-libgcc when building gcc from source
  2020-11-02 17:44 ` Jonathan Wakely
@ 2020-11-03  7:47   ` Eric Pellegrini
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Pellegrini @ 2020-11-03  7:47 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

I should have trusted the manual. The solution to my problem was just to
perform the build in a directory outside the source
directory as indicated. Sorry for the inconvenience and thx for your help.

On Mon, Nov 2, 2020 at 6:44 PM Jonathan Wakely <jwakely.gcc@gmail.com>
wrote:

> On Mon, 2 Nov 2020 at 15:34, Eric Pellegrini via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
> >
> > Hi all,
> >
> > I try to build gcc (9.3.0) from source on ubuntu focal using the
> following
> > configure call:
> >
> > ./configure --enable-shared --enable-multilib --prefix=/opt/gcc
>
> Don't do that, see https://gcc.gnu.org/wiki/InstallingGCC
>
> > The configure runs OK but when building/linking I get the following
> error:
> >
> > libtool: link: gcc -shared  -fPIC -DPIC  .libs/lto-plugin.o   -l
>
> There's an argument missing here, it should be -l SOMETHING
>
> > -static-libgcc -static-libstdc++ -static-libgcc
>
> and that means the -static-libgcc gets treated as the argument to -l
>
> My guess is you have something defined in your environment, like
> LDFLAGS=-l or something like that. Check the output of 'env' and unset
> anything you don't need.
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-03  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 15:32 cannot find -l-static-libgcc when building gcc from source Eric Pellegrini
2020-11-02 17:44 ` Jonathan Wakely
2020-11-03  7:47   ` Eric Pellegrini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).