public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC generates a truncated object file (0 bytes)
@ 2009-12-17  6:39 Alwin Leerling
  0 siblings, 0 replies; only message in thread
From: Alwin Leerling @ 2009-12-17  6:39 UTC (permalink / raw)
  To: GCC Help Mailing List

Hi everyone

The following problem has me stumped:

While compiling my computer locked up. The only option I had we to hit 
the reset button. When I tried to compile my source again an object file 
was truncated to 0 bytes.

To get an idea of my file organisation:

tidalcreek
    |
    | - debug
    |     |
    |     |- gui
    |     |   |- gtkdrawwidgets
    |     | ..... other build directories
    |-gui
    |  |- gtkdrawwidgets
    | .... other source directories

The offending object file is 
tidalcreek/debug/gui/gtkdrawwidgets/gtkroad.o (build from source file 
tidalcreek/gui/gtkdrawwidgets/gtkroad.c)

Steps I took to rectify the problem

Delete the truncated object file and recompile => resulting object file 
created with 0 bytes.
Delete the object file, forced a fsck on reboot, rebooted and recompiled 
=> resulting object file created with 0 bytes.
Deleted complete build tree (I am using autotools), remade the build 
tree and recompiled => resulting object file created with 0 bytes.
Created a text file gtkroad.o and put some text in it, saved and 
reloaded in text editor => fine
Deleted text file, compiled => resulting object file created with 0 bytes.

I tried to manually compile the file 
(PWD=tidalcreek/debug/gui/gtkdrawwidgets/):

gcc -DHAVE_CONFIG_H -I. 
-I/home/alwin/transpread/trunk/tidalcreek/gui/gtkdrawwidgets -I../.. 
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 
-I/usr/include/freetype2 -I/usr/include/libpng12      -Wall -O0 -g3  -MT 
gtkroad.o -MD -MP -c -o gtkroad.o 
/home/alwin/transpread/trunk/tidalcreek/gui/gtkdrawwidgets/gtkroad.c

Now I know that there is one warning generated when this code is 
compiled. When I execute the above line, no warning is generated and a 
truncated object file is created.

I next tried to change the name of the output file:

gcc -DHAVE_CONFIG_H -I. 
-I/home/alwin/transpread/trunk/tidalcreek/gui/gtkdrawwidgets -I../.. 
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 
-I/usr/include/freetype2 -I/usr/include/libpng12      -Wall -O0 -g3  -MT 
gtkroad.o -MD -MP -c -o gtkroad2.o 
/home/alwin/transpread/trunk/tidalcreek/gui/gtkdrawwidgets/gtkroad.c

This created a truncated object file called gtkroad2.o. No warning reported.

Next I changed the preprocessor target file name:

gcc -DHAVE_CONFIG_H -I. 
-I/home/alwin/transpread/trunk/tidalcreek/gui/gtkdrawwidgets -I../.. 
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 
-I/usr/include/freetype2 -I/usr/include/libpng12      -Wall -O0 -g3  -MT 
gtkroad2.o -MD -MP -c -o gtkroad.o 
/home/alwin/transpread/trunk/tidalcreek/gui/gtkdrawwidgets/gtkroad.c

This worked! a valid gtkroad.o file was created as well as a gtkroad.d 
file with target gtkroad2.o in the first line.

Created build tree with a different build root name (debug1 instead of 
debug) and compile => works fine

I'm running Fedora 11 and gcc version 4.4

Any suggestions?

Thanks in advance

Alwin Leerling


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-17  1:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-17  6:39 GCC generates a truncated object file (0 bytes) Alwin Leerling

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