Bug 55930 - [9 Regression] libatomic build failure if configured with --disable-dependency-tracking
Summary: [9 Regression] libatomic build failure if configured with --disable-dependenc...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.8.0
: P2 minor
Target Milestone: 10.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2013-01-10 02:01 UTC by Leo Yuriev
Modified: 2023-08-04 02:02 UTC (History)
10 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.7.4
Known to fail: 4.8.0, 7.4.0, 8.3.0, 9.5.0
Last reconfirmed: 2019-04-02 00:00:00


Attachments
patch which fixes the problem (391 bytes, patch)
2013-09-22 10:46 UTC, Richard Purdie
Details | Diff
gfortran config log (10.93 KB, text/plain)
2020-11-09 14:23 UTC, ninos
Details
gfortran.do_configure (5.39 KB, text/plain)
2020-11-09 14:25 UTC, ninos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Yuriev 2013-01-10 02:01:42 UTC
with "--disable-dependency-tracking" the .deps directory not created, but a *.Ppo files still generated.

libtool: compile:  /sandbox/stage1/gcc/./gcc/xgcc -B/sandbox/stage1/gcc/./gcc/ -B/sandbox/stage1/x86_64-linux-gnu/bin/ -B/sandbox/stage1/x86_64-linux-gnu/lib/ -isystem /sandbox/stage1/x86_64-linux-gnu/include -isystem /sandbox/stage1/x86_64-linux-gnu/sys-include -DHAVE_CONFIG_H -I/sandbox/gcc-git/libatomic/config/x86 -I/sandbox/gcc-git/libatomic/config/posix -I/sandbox/gcc-git/libatomic -I. -Wall -Werror -pthread -g -O2 -Wno-error -g0 -MT load_1_.lo -MD -MP -MF .deps/load_1_.lo.Ppo -DN=1 -c /sandbox/gcc-git/libatomic/load_n.c  -fPIC -DPIC -o load_1_.o
/sandbox/gcc-git/libatomic/load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory
 EXPORT_ALIAS (SIZE(load));
 ^
Comment 1 David Cantrell 2013-03-31 18:12:00 UTC
I am seeing the same behavior building gcc 4.8.0 locally using the following options to ./configure:

--enable-languages=c,c++ \
--enable-bootstrap \
--enable-lto \
--enable-threads=posix \
--disable-checking \
--enable-long-long \
--enable-__cxa_atexit \
--enable-clocale=generic \
--disable-multilib \
--with-system-zlib \
--prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--localstatedir=/var \
--libdir=/usr/lib \
--includedir=/usr/include \
--datadir=/usr/share \
--mandir=/usr/share/man \
--disable-nls \
--disable-silent-rules \
--disable-dependency-tracking
Comment 2 Richard Purdie 2013-09-22 10:46:57 UTC
Created attachment 30880 [details]
patch which fixes the problem

This patch fixes the build failure when --disable-dependency-tracking is passed
Comment 3 Saleem Abdulrasool 2015-03-08 07:27:19 UTC
Still occurs with 4.9.2 (and the same patch still fixes it).
Comment 4 Stephen Kitt 2016-11-18 08:19:05 UTC
This is still relevant for version 6.2.0.
Comment 5 Andrew Pinski 2019-04-01 20:31:43 UTC
(In reply to Richard Purdie from comment #2)
> Created attachment 30880 [details]
> patch which fixes the problem
> 
> This patch fixes the build failure when --disable-dependency-tracking is
> passed

Patches should be posted to gcc-patches@ .

But the bigger question is why  are you passing --disable-dependency-tracking
 ?
Comment 6 Richard Purdie 2019-04-01 21:17:12 UTC
(In reply to Andrew Pinski from comment #5)
> (In reply to Richard Purdie from comment #2)
> > Created attachment 30880 [details]
> > patch which fixes the problem
> > 
> > This patch fixes the build failure when --disable-dependency-tracking is
> > passed
> 
> Patches should be posted to gcc-patches@ .
> 
> But the bigger question is why  are you passing --disable-dependency-tracking
>  ?

Its part of a Yocto Project build and we would only ever build it once so we don't need/want the overhead of the dependency tracking information.
Comment 7 Jonathan Wakely 2019-04-02 09:47:53 UTC
Did the patch ever get sent to the gcc-patches list?
Comment 8 Jonathan Wakely 2019-04-02 11:54:23 UTC
(In reply to Richard Purdie from comment #6)
> Its part of a Yocto Project build and we would only ever build it once so we
> don't need/want the overhead of the dependency tracking information.

But is there any noticeable overhead when using GCC to bootstrap?

Automake documents the option as:

  Some compilers do not offer any practical way to derive the list of
  dependencies as a side-effect of the compilation, requiring a separate
  run (maybe of another tool) to compute these dependencies. The performance
  penalty implied by these methods is important enough to disable them by
  default.

That doesn't apply here though, because GCC is generating the dependencies via -MD as a side effect of compilation. So there should be no need to use the option (other than saving a bit of disk space during the build).
Comment 9 Richard Purdie 2019-04-02 12:29:47 UTC
(In reply to Jonathan Wakely from comment #8)
> (In reply to Richard Purdie from comment #6)
> > Its part of a Yocto Project build and we would only ever build it once so we
> > don't need/want the overhead of the dependency tracking information.
> 
> But is there any noticeable overhead when using GCC to bootstrap?
> 
> Automake documents the option as:
> 
>   Some compilers do not offer any practical way to derive the list of
>   dependencies as a side-effect of the compilation, requiring a separate
>   run (maybe of another tool) to compute these dependencies. The performance
>   penalty implied by these methods is important enough to disable them by
>   default.
> 
> That doesn't apply here though, because GCC is generating the dependencies
> via -MD as a side effect of compilation. So there should be no need to use
> the option (other than saving a bit of disk space during the build).

We pass this option in globally to anything using automake so whilst for one piece of software it might not be a huge gain, over a complete Linux stack built from source the disk space (lack of IO) speed wins are useful alone.
Comment 10 Daniel Richard G. 2019-07-10 03:01:07 UTC
Confirmed that this issue persists in 9.1.0:

libtool: compile:  /tmp/gcc-9.1.0.build/./gcc/xgcc -B/tmp/gcc-9.1.0.build/./gcc/ -B/opt/gnu/x86_64-pc-linux-gnu/bin/ -B/opt/gnu/x86_64-pc-linux-gnu/lib/ -isystem /opt/gnu/x86_64-pc-linux-gnu/include -isystem /opt/gnu/x86_64-pc-linux-gnu/sys-include -fchecking=1 -DHAVE_CONFIG_H -I/home/src/gcc/gcc-9.1.0/libatomic/config/x86 -I/home/src/gcc/gcc-9.1.0/libatomic/config/posix -I/home/src/gcc/gcc-9.1.0/libatomic -I. -Wall -Werror -pthread -g -O2 -MT load_1_.lo -MD -MP -MF .deps/load_1_.lo.Ppo -DN=1 -c /home/src/gcc/gcc-9.1.0/libatomic/load_n.c  -fPIC -DPIC -o load_1_.o
/home/src/gcc/gcc-9.1.0/libatomic/load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory
  115 | EXPORT_ALIAS (SIZE(load));
      | ^~~~~~~~~~~~
compilation terminated.
gmake[4]: *** [load_1_.lo] Error 1
gmake[4]: Leaving directory `/tmp/gcc-9.1.0.build/x86_64-pc-linux-gnu/libatomic'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/tmp/gcc-9.1.0.build/x86_64-pc-linux-gnu/libatomic'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/tmp/gcc-9.1.0.build/x86_64-pc-linux-gnu/libatomic'
gmake[1]: *** [all-target-libatomic] Error 2
gmake[1]: Leaving directory `/tmp/gcc-9.1.0.build'
gmake: *** [bootstrap-lean] Error 2

I'd like to echo Mr. Purdie's "We pass this option in globally to anything using automake" as the approach my site uses as well.
Comment 11 Jonathan Wakely 2019-07-10 08:44:14 UTC
I still think the solution is "don't do that for gcc" but in any case, the patch still hasn't been sent to the mailing list so isn't going to get reviewed let alone applied.
Comment 12 Richard Purdie 2019-07-10 09:13:23 UTC
I started to look at sorting out Yocto Project/Openembedded's gcc patches in general and ran into a contribution agreement legal quagmire. I still haven't been able to resolve that.
Comment 13 Jonathan Wakely 2019-07-10 09:22:44 UTC
OK thanks for the update. I think your patch for this bug is trivial enough to not require any paperwork.
Comment 14 Stephen Kitt 2019-07-10 11:38:09 UTC
(In reply to Andrew Pinski from comment #5)
> But the bigger question is why  are you passing --disable-dependency-tracking
>  ?

I ran into this issue because Debian's debhelper's dh_auto_configure passes --disable-dependency-tracking automatically. ("Know your build tools" is the lesson here, I guess.)
Comment 15 Eric Gallager 2019-09-01 17:13:34 UTC
(In reply to Stephen Kitt from comment #14)
> (In reply to Andrew Pinski from comment #5)
> > But the bigger question is why  are you passing --disable-dependency-tracking
> >  ?
> 
> I ran into this issue because Debian's debhelper's dh_auto_configure passes
> --disable-dependency-tracking automatically. ("Know your build tools" is the
> lesson here, I guess.)

There's other projects that automatically turn on --disable-dependency-tracking, too. MacPorts automatically passes --disable-dependency-tracking for all ports using the +universal variant, for example.
Comment 16 Richard Biener 2019-11-14 07:55:20 UTC
The GCC 7 branch is being closed, re-targeting to GCC 8.4.
Comment 17 GCC Commits 2020-02-22 15:17:01 UTC
The master branch has been updated by Jeff Law <law@gcc.gnu.org>:

https://gcc.gnu.org/g:d6f420d98126ac51396b89fbe287a32287cd92ed

commit r10-6797-gd6f420d98126ac51396b89fbe287a32287cd92ed
Author: Richarde Purdie <rpurdie@rpsys.net>
Date:   Sat Feb 22 10:13:13 2020 -0500

    Honor --disable-dependency-tracking in libatomic
    
    	PR other/55930
    	* Makefile.am (M_DEPS): Honor -disable-dependency-tracking.
    	* Makefile.in: Regenerated.
Comment 18 Jeffrey A. Law 2020-02-22 15:20:46 UTC
I concur with Jon, this is trivial enough not to need any kind of paperwork.  I've committed the patch to the trunk.  I'm not planning to backport, but I wouldn't object if someone else did.

Thanks for the patch Richard.  Jon, thanks for marking the regression.  Otherwise it would have been missed for (yet another) cycle.
Comment 19 GCC Commits 2020-02-22 18:56:13 UTC
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:128ff73d7c5b70b20991b191b64a27d64145d762

commit r10-6799-g128ff73d7c5b70b20991b191b64a27d64145d762
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Feb 22 19:55:09 2020 +0100

    libatomic: Fix last change [PR55930]
    
    2020-02-22  Jakub Jelinek  <jakub@redhat.com>
    
    	PR other/55930
    	* Makefile.am (M_DEPS): Guard the empty definition with
    	@AMDEP_FALSE@ rather than @AMDEP_TRUE@.
    	* Makefile.in: Regenerated.
Comment 20 Jakub Jelinek 2020-03-04 09:49:35 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 21 ninos 2020-11-09 14:14:24 UTC
I'm compiling gfortran in yocto project, but during do_configure it throw out an error:
unrecognized options: --disable-dependency-tracking

I grep disable-dependency-tracking is yocto layer "core/meta/recipes-devtools/gcc" and find key-word "disable-dependency-tracking" in ./gcc-9.2/0020-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch and ./gcc-9.2.inc. Followings are detailed output from grep:
./gcc-9.2/0020-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch:Subject: [PATCH 20/36] gcc 4.8+ won't build with --disable-dependency-tracking
./gcc-9.2.inc:           file://0020-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \


It seems do_configure use "--disable-dependency-tracking" to compile, but this option is unrecognized. So how to apply "0020-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch" to do_configure? 

I'm new to yocto, please forgive my ignorance.
Comment 22 ninos 2020-11-09 14:23:03 UTC
Created attachment 49526 [details]
gfortran config log
Comment 23 ninos 2020-11-09 14:25:59 UTC
Created attachment 49527 [details]
gfortran.do_configure

this is the do_configure log where unrecognized disable-dependency-tracking occurs.
Comment 24 Jakub Jelinek 2021-05-14 09:46:47 UTC
GCC 8 branch is being closed.
Comment 25 Richard Biener 2021-06-01 08:05:47 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 26 Richard Biener 2022-05-27 08:02:08 UTC
Fixed in GCC 10.