public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: driver/9517: makefile dependencies deleted on error, option -MMD
@ 2003-04-07 14:04 bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: bangerth @ 2003-04-07 14:04 UTC (permalink / raw)
  To: Ralf.Friedl, gcc-bugs, gcc-prs, nobody

Synopsis: makefile dependencies deleted on error, option -MMD

State-Changed-From-To: feedback->closed
State-Changed-By: bangerth
State-Changed-When: Mon Apr  7 14:04:56 2003
State-Changed-Why:
    Apparently fixed

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9517


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

* Re: driver/9517: makefile dependencies deleted on error, option -MMD
@ 2003-04-07 11:56 Ralf Friedl
  0 siblings, 0 replies; 5+ messages in thread
From: Ralf Friedl @ 2003-04-07 11:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR driver/9517; it has been noted by GNATS.

From: Ralf Friedl <Ralf.Friedl@online.de>
To: bangerth@dealii.org, Ralf.Friedl@online.de, gcc-bugs@gcc.gnu.org,
   gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: driver/9517: makefile dependencies deleted on error, option -MMD
Date: Mon, 07 Apr 2003 13:34:51 +0200

 Hi
 
 I just tried gcc-3.3, this version does create the dependancy file, so this seems to work with the new version.
 My previous report was for gcc-3.2.
 
 Ralf Friedl
 
 bangerth@dealii.org schrieb:
 
 > Synopsis: makefile dependencies deleted on error, option -MMD
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: bangerth
 > State-Changed-When: Fri Mar 14 02:15:28 2003
 > State-Changed-Why:
 >     I can't reproduce this behavior: the .d file is always
 >     created for me, irrespective of errors in .h or .c files.
 >     Can you send us the transcript of a shell session that
 >     shows this behavior?
 >
 >     Thanks
 >       Wolfgang
 >
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9517
 


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

* Re: driver/9517: makefile dependencies deleted on error, option -MMD
@ 2003-03-16 16:46 Ralf Friedl
  0 siblings, 0 replies; 5+ messages in thread
From: Ralf Friedl @ 2003-03-16 16:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR driver/9517; it has been noted by GNATS.

From: Ralf Friedl <Ralf.Friedl@online.de>
To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: driver/9517: makefile dependencies deleted on error, option -MMD
Date: Sun, 16 Mar 2003 17:41:08 +0100

 Dies ist eine mehrteilige Nachricht im MIME-Format.
 --------------C68B6DA704B2C1A83A4F238C
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 $ cat x.cpp
 #include "x.h"
 $ cat x.h
 syntax error
 $ gcc -v
 Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.2/specs
 Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux
 Thread model: posix
 gcc version 3.2
 
 $ strace g++ -MMD -c -o x.o x.cpp
 execve("/usr/bin/g++", ["g++", "-MMD", "-c", "-o", "x.o", "x.cpp"], [/* 56 vars */]) = 0
 ...
 fork()                                  = 9307
 wait4(-1, [WIFEXITED(s) && WEXITSTATUS(s) == 1], 0, NULL) = 9307
 --- SIGCHLD (Child exited) ---
 stat64("x.d", {st_mode=S_IFREG|0600, st_size=15, ...}) = 0
 unlink("x.d")                           = 0
 
 cc1plus:
 ...
 open("x.d", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
 fstat64(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x1556b000
 write(3, "x.o: x.cpp x.h\n", 15)        = 15
 close(3)                                = 0
 
 
 So cc1plus creates the file x.d, and g++ deletes it after it gets exitstaus == 1.
 I also tried gcc and cc1, the result is the same.
 
 I have included the specs file.
 
 Ralf Friedl
 
 bangerth@dealii.org schrieb:
 
 > Synopsis: makefile dependencies deleted on error, option -MMD
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: bangerth
 > State-Changed-When: Fri Mar 14 02:15:28 2003
 > State-Changed-Why:
 >     I can't reproduce this behavior: the .d file is always
 >     created for me, irrespective of errors in .h or .c files.
 >     Can you send us the transcript of a shell session that
 >     shows this behavior?
 >
 >     Thanks
 >       Wolfgang
 >
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9517
 
 --------------C68B6DA704B2C1A83A4F238C
 Content-Type: text/plain; charset=iso-8859-1;
  name="specs"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline;
  filename="specs"
 
 *asm:
 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
 
 *asm_debug:
 %{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
 
 *asm_final:
 %|
 
 *asm_options:
 %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
 
 *invoke_as:
 %{!S:-o %{|!pipe:%g.s} |
  as %(asm_options) %{!pipe:%g.s} %A }
 
 *cpp:
 %(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posi=
 x:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
 
 *cpp_options:
 %(cpp_unique_options) %{std*} %{d*} %{W*} %{w} %{pedantic*} %{fshow-colum=
 n} %{fno-show-column} %{fsigned-char&funsigned-char} %{fleading-underscor=
 e} %{fno-leading-underscore} %{fno-operator-names} %{ftabstop=3D*}
 
 *cpp_unique_options:
 %{C:%{!E:%eGNU C does not support -C without using -E}} %{nostdinc*} %{C}=
  %{v} %{I*} %{P} %{$} %I %{MD:-MD %W{!o: %b.d}%W{o*:%.d%*}} %{MMD:-MMD %W=
 {!o: %b.d}%W{o*:%.d%*}} %{M} %{MM} %W{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E=
 :%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=3D%v1 -D__GNUC=
 _MINOR__=3D%v2 -D__GNUC_PATCHLEVEL__=3D%v3 -D__GXX_ABI_VERSION=3D102} %{!=
 undef:%{!ansi:%{!std=3D*:%p}%{std=3Dgnu*:%p}} %P} %{trigraphs} %{Os:-D__O=
 PTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{fno-inline|O0|!O*:-D__NO_IN=
 LINE__} %{ffast-math:-D__FAST_MATH__} %{fshort-wchar:-U__WCHAR_TYPE__ -D_=
 _WCHAR_TYPE__=3Dshort\ unsigned\ int} %{ffreestanding:-D__STDC_HOSTED__=3D=
 0} %{fno-hosted:-D__STDC_HOSTED__=3D0} %{!ffreestanding:%{!fno-hosted:-D_=
 _STDC_HOSTED__=3D1}} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %=
 {E|M|MM:%W{o*}}
 
 *trad_capable_cpp:
 %{traditional|ftraditional|traditional-cpp:trad}cpp0
 
 *cc1:
 %(cc1_cpu) %{profile:-p}
 
 *cc1_options:
 %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatibl=
 e}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{g*} %{O*} %{W*} %{w}=
  %{pedantic*} %{std*} %{ansi} %{traditional} %{v:-version} %{pg:-p} %{p} =
 %{f*} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{=
 !fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*}=
 
 
 *cc1plus:
 -fmessage-length=3D0
 
 *link_gcc_c_sequence:
 %G %L %G
 
 *endfile:
 %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
 
 *link:
 %{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared}   %{!shared:     =
 %{!ibcs:       %{!static: 	%{rdynamic:-export-dynamic} 	%{!dynamic-linker=
 :-dynamic-linker /lib/ld-linux.so.2}} 	%{static:-static}}}
 
 *lib:
 %{shared: -lc}    %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} 	%{p=
 rofile:-lc_p} %{!profile: -lc}}
 
 *libgcc:
 %{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!share=
 d:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shar=
 ed:%{shared-libgcc:-lgcc_s%M}%{!shared-libgcc:-lgcc}}}}
 
 *startfile:
 %{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} 		       %{!p:%{prof=
 ile:gcrt1.o%s} 			 %{!profile:crt1.o%s}}}}    crti.o%s %{static:crtbeginT=
 =2Eo%s}   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}
 
 *switches_need_spaces:
 
 
 *predefines:
 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -Asystem=3Dposix
 
 *cross_compile:
 0
 
 *version:
 3.2
 
 *multilib:
 =2E ;
 
 *multilib_defaults:
 
 
 *multilib_extra:
 
 
 *multilib_matches:
 
 
 *multilib_exclusions:
 
 
 *linker:
 collect2
 
 *link_libgcc:
 %D
 
 *md_exec_prefix:
 
 
 *md_startfile_prefix:
 
 
 *md_startfile_prefix_1:
 
 
 *startfile_prefix_spec:
 
 
 *cpp_cpu_default:
 -D__tune_i486__
 
 *cpp_cpu:
 %(cpp_cpu32) %(cpp_cpucommon)
 
 *cpp_cpu32:
 -Acpu=3Di386 -Amachine=3Di386 %{!ansi:%{!std=3Dc*:%{!std=3Di*:-Di386}}} -=
 D__i386 -D__i386__ %(cpp_cpu32sizet)
 
 *cpp_cpu64:
 -Acpu=3Dx86_64 -Amachine=3Dx86_64 -D__x86_64 -D__x86_64__ %(cpp_cpu64size=
 t)
 
 *cpp_cpu32sizet:
 
 
 *cpp_cpu64sizet:
 
 
 *cpp_cpucommon:
 %{march=3Di386:%{!mcpu*:-D__tune_i386__ }}%{march=3Di486:-D__i486 -D__i48=
 6__ %{!mcpu*:-D__tune_i486__ }}%{march=3Dpentium|march=3Di586:-D__i586 -D=
 __i586__ -D__pentium -D__pentium__   %{!mcpu*:-D__tune_i586__ -D__tune_pe=
 ntium__ }}%{march=3Dpentium-mmx:-D__i586 -D__i586__ -D__pentium -D__penti=
 um__   -D__pentium__mmx__   %{!mcpu*:-D__tune_i586__ -D__tune_pentium__ -=
 D__tune_pentium_mmx__}}%{march=3Dpentiumpro|march=3Di686:-D__i686 -D__i68=
 6__   -D__pentiumpro -D__pentiumpro__   %{!mcpu*:-D__tune_i686__ -D__tune=
 _pentiumpro__ }}%{march=3Dk6:-D__k6 -D__k6__ %{!mcpu*:-D__tune_k6__ }}%{m=
 arch=3Dk6-2:-D__k6 -D__k6__ -D__k6_2__   %{!mcpu*:-D__tune_k6__ -D__tune_=
 k6_2__ }}%{march=3Dk6-3:-D__k6 -D__k6__ -D__k6_3__   %{!mcpu*:-D__tune_k6=
 __ -D__tune_k6_3__ }}%{march=3Dathlon|march=3Dathlon-tbird:-D__athlon -D_=
 _athlon__   %{!mcpu*:-D__tune_athlon__ }}%{march=3Dathlon-4|march=3Dathlo=
 n-xp|march=3Dathlon-mp:-D__athlon -D__athlon__   -D__athlon_sse__   %{!mc=
 pu*:-D__tune_athlon__ -D__tune_athlon_sse__ }}%{march=3Dpentium4:-D__pent=
 ium4 -D__pentium4__ %{!mcpu*:-D__tune_pentium4__ }}%{m386|mcpu=3Di386:-D_=
 _tune_i386__ }%{m486|mcpu=3Di486:-D__tune_i486__ }%{mpentium|mcpu=3Dpenti=
 um|mcpu=3Di586|mcpu=3Dpentium-mmx:-D__tune_i586__ -D__tune_pentium__ }%{m=
 pentiumpro|mcpu=3Dpentiumpro|mcpu=3Di686|cpu=3Dpentium2|cpu=3Dpentium3:-D=
 __tune_i686__ -D__tune_pentiumpro__ }%{mcpu=3Dk6|mcpu=3Dk6-2|mcpu=3Dk6-3:=
 -D__tune_k6__ }%{mcpu=3Dathlon|mcpu=3Dathlon-tbird|mcpu=3Dathlon-4|mcpu=3D=
 athlon-xp|mcpu=3Dathlon-mp:-D__tune_athlon__ }%{mcpu=3Dathlon-4|mcpu=3Dat=
 hlon-xp|mcpu=3Dathlon-mp:-D__tune_athlon_sse__ }%{mcpu=3Dpentium4:-D__tun=
 e_pentium4__ }%{march=3Dathlon-xp|march=3Dathlon-mp|march=3Dpentium3|marc=
 h=3Dpentium4:-D__SSE__ }%{march=3Dpentium-mmx|march=3Dk6|march=3Dk6-2|mar=
 ch=3Dk6-3|march=3Dathlon|march=3Dathlon-tbird|march=3Dathlon-4|march=3Dat=
 hlon-xp|march=3Dathlon-mp|march=3Dpentium2|march=3Dpentium3|march=3Dpenti=
 um4: -D__MMX__ }%{march=3Dk6-2|march=3Dk6-3|march=3Dathlon|march=3Dathlon=
 -tbird|march=3Dathlon-4|march=3Dathlon-xp|march=3Dathlon-mp: -D__3dNOW__ =
 }%{march=3Dathlon|march=3Dathlon-tbird|march=3Dathlon-4|march=3Dathlon-xp=
 |march=3Dathlon-mp: -D__3dNOW_A__ }%{march=3Dpentium4: -D__SSE2__ }%{!mar=
 ch*:%{!mcpu*:%{!m386:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}}}
 
 *cc1_cpu:
 %{!mcpu*: %{m386:-mcpu=3Di386 %n`-m386' is deprecated. Use `-march=3Di386=
 ' or `-mcpu=3Di386' instead.
 } %{m486:-mcpu=3Di486 %n`-m486' is deprecated. Use `-march=3Di486' or `-m=
 cpu=3Di486' instead.
 } %{mpentium:-mcpu=3Dpentium %n`-mpentium' is deprecated. Use `-march=3Dp=
 entium' or `-mcpu=3Dpentium' instead.
 } %{mpentiumpro:-mcpu=3Dpentiumpro %n`-mpentiumpro' is deprecated. Use `-=
 march=3Dpentiumpro' or `-mcpu=3Dpentiumpro' instead.
 }} %{mintel-syntax:-masm=3Dintel %n`-mintel-syntax' is deprecated. Use `-=
 masm=3Dintel' instead.
 } %{mno-intel-syntax:-masm=3Datt %n`-mno-intel-syntax' is deprecated. Use=
  `-masm=3Datt' instead.
 }
 
 *link_command:
 %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} =
 %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!=
 nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!n=
 ostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!=
 nostartfiles:%E}}} %{T*} }}}}}}
 
 
 --------------C68B6DA704B2C1A83A4F238C--
 
 


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

* Re: driver/9517: makefile dependencies deleted on error, option -MMD
@ 2003-03-14  2:15 bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: bangerth @ 2003-03-14  2:15 UTC (permalink / raw)
  To: Ralf.Friedl, gcc-bugs, gcc-prs, nobody

Synopsis: makefile dependencies deleted on error, option -MMD

State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Fri Mar 14 02:15:28 2003
State-Changed-Why:
    I can't reproduce this behavior: the .d file is always
    created for me, irrespective of errors in .h or .c files.
    Can you send us the transcript of a shell session that
    shows this behavior?
    
    Thanks
      Wolfgang

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9517


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

* driver/9517: makefile dependencies deleted on error, option -MMD
@ 2003-01-30 21:46 Ralf.Friedl
  0 siblings, 0 replies; 5+ messages in thread
From: Ralf.Friedl @ 2003-01-30 21:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9517
>Category:       driver
>Synopsis:       makefile dependencies deleted on error, option -MMD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 30 21:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Ralf.Friedl@online.de
>Release:        gcc-3.2
>Organization:
>Environment:

>Description:
The Option -MMD can be used to create dependency files for inclusion in 'make'.
If 'make' is used with these files, the following problem occurs:

If compilation fails, the dependency file is removed, but the object file is not removed. 
If the compilation fails because of errors in included files, the demendancy information is lost.
When in the included file is changed (to fix the error), 'make' will no longer know about the dependancies and not recompile the object file.
As the object files are still present, it is possible that an executable is created from the old objects without indication to the user.


>How-To-Repeat:
Create foo.c, foo.h
Makefile:
 CPPFLAGS = -MMD
 foo: foo.o
 include $(wildcard *.d)
Run 'make', this create foo.o and foo.d.
Change foo.h to contain an error.
Run make, this deletes foo.d but keeps foo.o.
Change foo.h again (fix error)
Run 'make', it does nothing because foo.o exists and is newer than foo.c,
and foo.d does not exists, so the dependency on foo.h is unknown.
>Fix:
delete object file, where compilation fails
or
keep dependancy file

As the dependancy file is created by the preprocessor, it should not be affected by compiler errors.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-04-07 14:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07 14:04 driver/9517: makefile dependencies deleted on error, option -MMD bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07 11:56 Ralf Friedl
2003-03-16 16:46 Ralf Friedl
2003-03-14  2:15 bangerth
2003-01-30 21:46 Ralf.Friedl

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