public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/56781] New: boostrap-asan failure: fixincl fails to link (missing -lasan)
@ 2013-03-29 13:33 aldot at gcc dot gnu.org
  2013-03-29 16:20 ` [Bug sanitizer/56781] " hjl.tools at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: aldot at gcc dot gnu.org @ 2013-03-29 13:33 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56781

             Bug #: 56781
           Summary: boostrap-asan failure: fixincl fails to link (missing
                    -lasan)
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: sanitizer
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: aldot@gcc.gnu.org
                CC: dodji@gcc.gnu.org, dvyukov@gcc.gnu.org,
                    jakub@gcc.gnu.org, kcc@gcc.gnu.org


bootstrap on x86_64-linux-gnu fails with:

/scratch/obj.x86_64/gcc-4.9.mine/./gcc/xgcc
-B/scratch/obj.x86_64/gcc-4.9.mine/./gcc/
-B/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/bin/
-B/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/lib/ -isystem
/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/include -isystem
/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/sys-include    -Og -g3 -ggdb3
-static-libstdc++ -static-libgcc  -o fixincl fixincl.o fixtests.o fixfixes.o
server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a 
../libiberty/libiberty.a(regex.o): In function `byte_compile_range':
/scratch/obj.x86_64/gcc-4.9.mine/libiberty/../../../src/gcc-4.9.mine/libiberty/regex.c:4499:
undefined reference to `__asan_report_store1'
/scratch/obj.x86_64/gcc-4.9.mine/libiberty/../../../src/gcc-4.9.mine/libiberty/regex.c:4499:
undefined reference to `__asan_report_load1'
[snip]

we would obviously need to link against asan but it is not immediately obvious
to me how to pass POSTSTAGE1_LDFLAGS to fixincludes/

$ /scratch/obj.x86_64/gcc-4.9.mine/./gcc/xgcc
-B/scratch/obj.x86_64/gcc-4.9.mine/./gcc/
-B/scratch/obj.x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/libsanitizer/asan
-B/scratch/obj.x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/libsanitizer/asan/.libs
-B/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/bin/
-B/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/lib/ -isystem
/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/include -isystem
/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/sys-include    -Og -g3 -ggdb3
-static-libstdc++ -static-libgcc  -o fixincl fixincl.o fixtests.o fixfixes.o
server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a
-fsanitize=address -static-libasan
produces the desired fixincl

$ /scratch/obj.x86_64/gcc-4.9.mine/./gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/scratch/obj.x86_64/gcc-4.9.mine/./gcc/xgcc
Target: x86_64-unknown-linux-gnu
Configured with: ../../src/gcc-4.9.mine/configure -v
--enable-languages=c,lto,fortran,c++,go LD=/usr/bin/ld.bfd CFLAGS='-O2 -g3
-ggdb3' CXXFLAGS='-O2 -g3 -ggdb3' 'BOOT_CFLAGS=-O2 -g3 -ggdb3'
'BOOT_CXXFLAGS=-O2 -g3 -ggdb3' 'CFLAGS_FOR_TARGET=-Og -g3 -ggdb3'
'CXXFLAGS_FOR_TARGET=-Og -g3 -ggdb3' --prefix=/opt/x86_64/gcc-4.9.mine//
--enable-shared --with-system-zlib --enable-nls --without-included-gettext
--enable-threads=posix --program-suffix=-4.9.mine-HEAD
--with-build-config=bootstrap-asan --enable-__cxa_atexit
--enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --disable-werror --enable-checking=yes --enable-debug -C
--disable-intermodule --enable-multilib --disable-libstdcxx-pch
--enable-bootstrap --enable-checking=release --with-cpu=native
--with-tune=native --enable-plugin
Thread model: posix
gcc version 4.9.0 20130327 (experimental) [vnhoist revision
32ddde1:a851c38:065ec6e627efa59b32f9fb743368a4a55c4ac310] (GCC)


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

* [Bug sanitizer/56781] boostrap-asan failure: fixincl fails to link (missing -lasan)
  2013-03-29 13:33 [Bug sanitizer/56781] New: boostrap-asan failure: fixincl fails to link (missing -lasan) aldot at gcc dot gnu.org
@ 2013-03-29 16:20 ` hjl.tools at gmail dot com
  2013-04-04 11:41 ` aldot at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hjl.tools at gmail dot com @ 2013-03-29 16:20 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56781

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-03-29
     Ever Confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2013-03-29 16:20:46 UTC ---
Please try

http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=61be6ebfe22f9ce5799dac2679541911eb744a86
http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6b526a34a0bc852461cb50636c6e757bf8e27faf


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

* [Bug sanitizer/56781] boostrap-asan failure: fixincl fails to link (missing -lasan)
  2013-03-29 13:33 [Bug sanitizer/56781] New: boostrap-asan failure: fixincl fails to link (missing -lasan) aldot at gcc dot gnu.org
  2013-03-29 16:20 ` [Bug sanitizer/56781] " hjl.tools at gmail dot com
@ 2013-04-04 11:41 ` aldot at gcc dot gnu.org
  2014-03-26  9:20 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: aldot at gcc dot gnu.org @ 2013-04-04 11:41 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56781

--- Comment #2 from Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> 2013-04-04 11:41:08 UTC ---
(In reply to comment #1)
> Please try
> 
> http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=61be6ebfe22f9ce5799dac2679541911eb744a86
> http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6b526a34a0bc852461cb50636c6e757bf8e27faf

I don't think that the above is the correct thing to do;
Shouldn't the post-stage1 libs be built with and linked against asan?
Like (i know that this is a generated file) below which reinstates bootstrap:

diff --git a/Makefile.in b/Makefile.in
index 08049de..52249a0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -7786,7 +7786,7 @@ configure-fixincludes:
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        test ! -f $(HOST_SUBDIR)/fixincludes/Makefile || exit 0; \
        $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fixincludes ; \
-       $(HOST_EXPORTS)  \
+       $(POSTSTAGE1_HOST_EXPORTS)  \
        echo Configuring in $(HOST_SUBDIR)/fixincludes; \
        cd "$(HOST_SUBDIR)/fixincludes" || exit 1; \
        case $(srcdir) in \
@@ -7818,7 +7818,7 @@ all-fixincludes: configure-fixincludes
        @: $(MAKE); $(unstage)
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       $(HOST_EXPORTS)  \
+       $(POSTSTAGE1_HOST_EXPORTS)  \
        (cd $(HOST_SUBDIR)/fixincludes && \
          $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
$(STAGE1_FLAGS_TO_PASS)  \
                $(TARGET-fixincludes))
@@ -7836,7 +7836,7 @@ check-fixincludes:
        @: $(MAKE); $(unstage)
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       $(HOST_EXPORTS) \
+       $(POSTSTAGE1_HOST_EXPORTS) \
        (cd $(HOST_SUBDIR)/fixincludes && \
          $(MAKE) $(FLAGS_TO_PASS)  check)

@@ -7851,7 +7851,7 @@ install-fixincludes: installdirs
        @: $(MAKE); $(unstage)
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       $(HOST_EXPORTS) \
+       $(POSTSTAGE1_HOST_EXPORTS) \
        (cd $(HOST_SUBDIR)/fixincludes && \
          $(MAKE) $(FLAGS_TO_PASS)  install)

@@ -7866,7 +7866,7 @@ install-strip-fixincludes: installdirs
        @: $(MAKE); $(unstage)
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       $(HOST_EXPORTS) \
+       $(POSTSTAGE1_HOST_EXPORTS) \
        (cd $(HOST_SUBDIR)/fixincludes && \
          $(MAKE) $(FLAGS_TO_PASS)  install-strip)


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

* [Bug sanitizer/56781] boostrap-asan failure: fixincl fails to link (missing -lasan)
  2013-03-29 13:33 [Bug sanitizer/56781] New: boostrap-asan failure: fixincl fails to link (missing -lasan) aldot at gcc dot gnu.org
  2013-03-29 16:20 ` [Bug sanitizer/56781] " hjl.tools at gmail dot com
  2013-04-04 11:41 ` aldot at gcc dot gnu.org
@ 2014-03-26  9:20 ` jakub at gcc dot gnu.org
  2014-04-17 12:24 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-26  9:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56781

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Mar 26 09:19:44 2014
New Revision: 208842

URL: http://gcc.gnu.org/viewcvs?rev=208842&root=gcc&view=rev
Log:
    PR sanitizer/56781
    * Makefile.def: Set bootstrap=true; for host fixincludes.
    * configure.ac: Don't bootstrap host fixincludes unless
    --with-build-config=bootstrap-{a,ub}san.
    * Makefile.in: Regenerated.
    * configure: Regenerated.

Modified:
    trunk/ChangeLog
    trunk/Makefile.def
    trunk/Makefile.in
    trunk/configure
    trunk/configure.ac


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

* [Bug sanitizer/56781] boostrap-asan failure: fixincl fails to link (missing -lasan)
  2013-03-29 13:33 [Bug sanitizer/56781] New: boostrap-asan failure: fixincl fails to link (missing -lasan) aldot at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-03-26  9:20 ` jakub at gcc dot gnu.org
@ 2014-04-17 12:24 ` jakub at gcc dot gnu.org
  2014-04-17 12:26 ` jakub at gcc dot gnu.org
  2023-04-02 15:30 ` aldot at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-04-17 12:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56781

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Thu Apr 17 12:23:28 2014
New Revision: 209475

URL: http://gcc.gnu.org/viewcvs?rev=209475&root=gcc&view=rev
Log:
    PR sanitizer/56781
    * libtool-ldflags: Also prefix -static-lib*, -shared-lib*
    and -B* options with -Xcompiler.
lto-plugin/
    * Makefile.am (LTLDFLAGS, liblto_plugin_la_LINK): New variables.
    * Makefile.in: Regenerated.

Modified:
    trunk/ChangeLog
    trunk/libtool-ldflags
    trunk/lto-plugin/ChangeLog
    trunk/lto-plugin/Makefile.am
    trunk/lto-plugin/Makefile.in


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

* [Bug sanitizer/56781] boostrap-asan failure: fixincl fails to link (missing -lasan)
  2013-03-29 13:33 [Bug sanitizer/56781] New: boostrap-asan failure: fixincl fails to link (missing -lasan) aldot at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-04-17 12:24 ` jakub at gcc dot gnu.org
@ 2014-04-17 12:26 ` jakub at gcc dot gnu.org
  2023-04-02 15:30 ` aldot at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-04-17 12:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56781

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Thu Apr 17 12:25:25 2014
New Revision: 209476

URL: http://gcc.gnu.org/viewcvs?rev=209476&root=gcc&view=rev
Log:
    PR sanitizer/56781
lto-plugin/
    * Makefile.am (CFLAGS, LDFLAGS): Filter out -fsanitize=address.
    (liblto_plugin_la_LIBADD, liblto_plugin_la_LDFLAGS,
    liblto_plugin_la_DEPENDENCIES): Prefer ../libiberty/noasan/libiberty.a
    over ../libiberty/pic/libiberty.a if the former exists.
    * Makefile.in: Regenerated.
libiberty/
    * maint-tool: Also emit rule for noasan/ subdirectory.
    * configure.ac (NOASANFLAG): Set and substitute.
    * Makefile.in: Regenerated.
    (NOASANFLAG): Set.
    (all, $(TARGETLIB), mostlyclean): Handle noasan subdir like pic
    subdir.
    (stamp-noasandir): New goal.
    * configure: Regenerated.

Modified:
    trunk/libiberty/ChangeLog
    trunk/libiberty/Makefile.in
    trunk/libiberty/configure
    trunk/libiberty/configure.ac
    trunk/libiberty/maint-tool
    trunk/lto-plugin/ChangeLog
    trunk/lto-plugin/Makefile.am
    trunk/lto-plugin/Makefile.in


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

* [Bug sanitizer/56781] boostrap-asan failure: fixincl fails to link (missing -lasan)
  2013-03-29 13:33 [Bug sanitizer/56781] New: boostrap-asan failure: fixincl fails to link (missing -lasan) aldot at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-04-17 12:26 ` jakub at gcc dot gnu.org
@ 2023-04-02 15:30 ` aldot at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aldot at gcc dot gnu.org @ 2023-04-02 15:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56781

Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-04-02 15:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-29 13:33 [Bug sanitizer/56781] New: boostrap-asan failure: fixincl fails to link (missing -lasan) aldot at gcc dot gnu.org
2013-03-29 16:20 ` [Bug sanitizer/56781] " hjl.tools at gmail dot com
2013-04-04 11:41 ` aldot at gcc dot gnu.org
2014-03-26  9:20 ` jakub at gcc dot gnu.org
2014-04-17 12:24 ` jakub at gcc dot gnu.org
2014-04-17 12:26 ` jakub at gcc dot gnu.org
2023-04-02 15:30 ` aldot at gcc dot gnu.org

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).