public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: niXman <i.nixman@autistici.org>
Cc: Gcc Help <gcc-help@gcc.gnu.org>
Subject: Re: Can't build gcc-trunk on Linux
Date: Sat, 11 Feb 2023 20:39:51 +0000	[thread overview]
Message-ID: <CAH6eHdSYAUrre3Zde57KjD=UKxoCMy-j+D9+7oC5zdHpOQvYsg@mail.gmail.com> (raw)
In-Reply-To: <f4faf2c9bf1abc9be0b0d796d9ff87fd@autistici.org>

[-- Attachment #1: Type: text/plain, Size: 3750 bytes --]

On Sat, 11 Feb 2023, 18:45 i.nixman--- via Gcc-help, <gcc-help@gcc.gnu.org>
wrote:

> hi,
>
> im trying to build gcc trunk branch on x86_64-linux using that cmdline:
>
> ../gcc-trunk-master/configure
> --enable-bootstrap
> --enable-languages=c,c++
> --prefix=/home/nixman/gcc-13
> --with-gcc-major-version-only
> --program-suffix=-13
> --program-prefix=x86_64-linux-gnu-
> --disable-shared
> --enable-static
> --enable-linker-build-id
> --enable-threads=posix
> --disable-nls
> --enable-libstdcxx-debug
> --enable-libstdcxx-time=yes
> --with-default-libstdcxx-abi=new
> --disable-vtable-verify
> --enable-plugin
> --disable-werror
> --disable-multilib
> --with-tune=generic
> --enable-checking=release
> --target=x86_64-linux-gnu
>
>
> but on stage 3 I got this error:
>
> /usr/bin/x86_64-linux-gnu-ld:
> /home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/src/.libs/libstdc++.a(class_type_info.o):
>
> relocation R_X86_64_32S against symbol
> `_ZTVN10__cxxabiv117__class_type_infoE' can not be used when making a
> shared object; recompile with -fPIC
> /usr/bin/x86_64-linux-gnu-ld: failed to set dynamic section sizes: bad
> value
> collect2: error: ld returned 1 exit status
>
>
>
> but the `-fPIC` option is there:
>
> libtool: link:  /home/nixman/gcc-trunk-master-build/./gcc/xg++
> -B/home/nixman/gcc-trunk-master-build/./gcc/ -nostdinc++ -nostdinc++
> -I/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/include/x86_64-linux-gnu
>
> -I/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/include
>
> -I/home/nixman/gcc-trunk-master/libstdc++-v3/libsupc++
> -I/home/nixman/gcc-trunk-master/libstdc++-v3/include/backward
> -I/home/nixman/gcc-trunk-master/libstdc++-v3/testsuite/util
> -L/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/src
> -L/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/src/.libs
>
> -L/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/libsupc++/.libs
>
> -B/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/src/.libs
>
> -B/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/libsupc++/.libs
>
> -B/home/nixman/gcc-13/x86_64-linux-gnu/bin/
> -B/home/nixman/gcc-13/x86_64-linux-gnu/lib/ -isystem
> /home/nixman/gcc-13/x86_64-linux-gnu/include -isystem
> /home/nixman/gcc-13/x86_64-linux-gnu/sys-include     -fPIC -DPIC -shared
> -nostdlib /lib/x86_64-linux-gnu/crti.o
> /home/nixman/gcc-trunk-master-build/./gcc/crtbeginS.o  .libs/findcomp.o
> .libs/libcc1.o .libs/libcp1.o .libs/compiler.o .libs/names.o
> .libs/callbacks.o .libs/connection.o .libs/marshall.o
> -L/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/src/.libs
>
> -L/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/src
> -L/home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/libsupc++/.libs
>
> -L/home/nixman/gcc-trunk-master-build/./gcc -L/lib/x86_64-linux-gnu
> -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64
> /home/nixman/gcc-trunk-master-build/x86_64-linux-gnu/libstdc++-v3/src/.libs/libstdc++.a
>
> -lm -lc -lgcc /home/nixman/gcc-trunk-master-build/./gcc/crtendS.o
> /lib/x86_64-linux-gnu/crtn.o  -static-libstdc++ -static-libgcc
> ../libiberty/pic/libiberty.a   -Wl,-soname -Wl,libcc1.so.0
> -Wl,-retain-symbols-file -Wl,../../gcc-trunk-master/libcc1/libcc1.sym -o
> .libs/libcc1.so.0.0.0
>
>
>
> any ideas?
>

The problem is that one of the objects in that linker command was not built
as PIC. I think it will work with either --with-pic or (if you don't need
libcc1) --disable-libcc1



>
> thanks!
>
>
> ps
> Google did not help me, but I found Jonathan's Wakely project
> (https://github.com/jwakely/pkg-gcc-latest) and now I will try to
> install the deb.
>

  reply	other threads:[~2023-02-11 20:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-11 18:44 i.nixman
2023-02-11 20:39 ` Jonathan Wakely [this message]
2023-02-11 22:57   ` i.nixman
2023-02-11 23:40     ` i.nixman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH6eHdSYAUrre3Zde57KjD=UKxoCMy-j+D9+7oC5zdHpOQvYsg@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=i.nixman@autistici.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).