[Bug c++/109698] New: gcc/g++ build/link fails for libhwasan.so

2023-05-02 Thread dnewtonrichards at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109698

Bug ID: 109698
   Summary: gcc/g++ build/link fails for libhwasan.so
   Product: gcc
   Version: 13.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dnewtonrichards at gmail dot com
  Target Milestone: ---

building on 
Debian 10 (Buster)
uname -a:   Linux relativity1 4.19.0-23-amd64 #1 SMP Debian 4.19.269-1
(2022-12-20) x86_64 GNU/Linux
configure: 
--prefix=/usr/local/GCC --disable-nls --disable-multilib 
--enable-languages=c,c+

building with gcc/g++ version 12.2

stage_current: stage3

I make it as far as stage 3 and the build fails while linking
libhwasan.so.0.0.0

libtool: link:  /home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc/xgcc
-shared-libgcc -B/home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc -nostdinc++
-L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src
-L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/usr/local/GCC/x86_64-pc-linux-gnu/bin/
-B/usr/local/GCC/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/GCC/x86_64-pc-linux-gnu/include -isystem
/usr/local/GCC/x86_64-pc-linux-gnu/sys-include -fPIC -DPIC -shared
-nostdlib /lib/x86_64-linux-gnu/crti.o
/home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc/crtbeginS.o 
.libs/hwasan_allocation_functions.o .libs/hwasan_allocator.o .libs/hwasan.o
.libs/hwasan_dynamic_shadow.o .libs/hwasan_exceptions.o .libs/hwasan_fuchsia.o
.libs/hwasan_globals.o .libs/hwasan_interceptors.o
.libs/hwasan_interceptors_vfork.o .libs/hwasan_linux.o
.libs/hwasan_memintrinsics.o .libs/hwasan_new_delete.o .libs/hwasan_poisoning.o
.libs/hwasan_report.o .libs/hwasan_setjmp_aarch64.o
.libs/hwasan_setjmp_x86_64.o .libs/hwasan_tag_mismatch_aarch64.o
.libs/hwasan_thread.o .libs/hwasan_thread_list.o .libs/hwasan_type_test.o 
-Wl,--whole-archive ../sanitizer_common/.libs/libsanitizer_common.a
../interception/.libs/libinterception.a
../libbacktrace/.libs/libsanitizer_libbacktrace.a -Wl,--no-whole-archive 
-Wl,-rpath
-Wl,/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-Wl,-rpath -Wl,/usr/local/GCC/lib/../lib64
-L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src
-L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-ldl -lrt -lpthread ../../libstdc++-v3/src/.libs/libstdc++.so -lm
-L/home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc -L/lib/x86_64-linux-gnu
-L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -lc -lgcc_s
/home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc/crtendS.o
/lib/x86_64-linux-gnu/crtn.o  -mshstk   -Wl,-soname -Wl,libhwasan.so.0 -o
.libs/libhwasan.so.0.0.0
/usr/bin/ld: .libs/hwasan.o: relocation R_X86_64_PC32 against undefined symbol
`__ehdr_start' can not be used when making a shared object; recompile with
-fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:559: libhwasan.la] Error 1
make[4]: Leaving directory
'/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libsanitizer/hwasan'
make[3]: *** [Makefile:532: all-recursive] Error 1
make[3]: Leaving directory
'/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libsanitizer'
make[2]: *** [Makefile:419: all] Error 2
make[2]: Leaving directory
'/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libsanitizer'
make[1]: *** [Makefile:19101: all-target-libsanitizer] Error 2
make[1]: Leaving directory '/home/odysseus/Downloads/gcc-13.1.0/objdir'
make: *** [Makefile:1082: all] Error 2

[Bug sanitizer/109698] gcc/g++ build/link fails for libhwasan.so

2023-05-02 Thread dnewtonrichards at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109698

--- Comment #3 from David Richards  ---
(In reply to Andrew Pinski from comment #1)
> What version of ld is this?
> 
> It might be bug there: 
> https://sourceware.org/bugzilla/show_bug.cgi?id=24458

ld --version:  
GNU ld (GNU Binutils for Debian) 2.31.1
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

Note:  I have built gcc/g++ version 12.2 without issue on this system...
Thanks!
Dave

[Bug sanitizer/109698] gcc/g++ build/link fails for libhwasan.so

2023-05-02 Thread dnewtonrichards at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109698

--- Comment #4 from David Richards  ---
ld --version:
GNU ld (GNU Binutils for Debian) 2.31.1
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later
version.
This program has absolutely no warranty.
NOTE:  I have built gcc/g++ version 12.2 o0n this same system
Thanks!
Dave

On Tue, May 2, 2023 at 9:18 AM jakub at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109698
>
> --- Comment #2 from Jakub Jelinek  ---
> Seems binutils has added support for __ehdr_start only in
> https://sourceware.org/legacy-ml/binutils/2012-06/msg00171.html in 2012.
> Do
> you have binutils older than that?
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug sanitizer/109698] gcc/g++ build/link fails for libhwasan.so

2023-05-12 Thread dnewtonrichards at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109698

--- Comment #5 from David Richards  ---
To add a bit more (not much - just a tad).  I was able to build gcc/g++
version 12.3.0 just recently released without any problems.
Then I attempted to build 13.1 with 12.3 and still no luck. Same error...

On Tue, May 2, 2023 at 10:42 AM  wrote:

> Attachments with a MIME type of "text/html" are not allowed on this
> installation.
>
> David Richards wrote:
> > ld --version:
> > GNU ld (GNU Binutils for Debian) 2.31.1
> > Copyright (C) 2018 Free Software Foundation, Inc.
> > This program is free software; you may redistribute it under the terms of
> > the GNU General Public License version 3 or (at your option) a later
> > version.
> > This program has absolutely no warranty.
> > NOTE:  I have built gcc/g++ version 12.2 o0n this same system
> > Thanks!
> > Dave
> >
> > On Tue, May 2, 2023 at 9:18 AM jakub at gcc dot gnu.org <
> > gcc-bugzi...@gcc.gnu.org> wrote:
> >
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109698
> > >
> > > --- Comment #2 from Jakub Jelinek  ---
> > > Seems binutils has added support for __ehdr_start only in
> > > https://sourceware.org/legacy-ml/binutils/2012-06/msg00171.html in
> 2012.
> > > Do
> > > you have binutils older than that?
> > >
> > > --
> > > You are receiving this mail because:
> > > You reported the bug.
>