gcc 4.5.0 read call hangs program
Ian Lance Taylor
iant@google.com
Thu May 27 00:24:00 GMT 2010
Todd Rinaldo <toddr@cpanel.net> writes:
> This makes the program hang on the read call:
> /usr/local/toddr/bin/x86_64-redhat-linux-gnu-gcc-4.5.0 -o conftest -O2 -Wp,-D_FORTIFY_SOURCE=2 -std=c99 conftest.c -g;./conftest
>
> Removing any of the options other than -g makes the program run normally.
If removing the -D_FORTIFY_SOURCE makes the program work, then I
recommend that you compile with --save-temps with and without that
option and compare the .i files. Perhaps that will show where the
problem lies.
Or, the fact that you are using -std=c99 with a glibc compiled with
gcc 4.1.2 raises the possibility that you are running into the
difference in the semantics of "extern inline". That was cleaned up
around the gcc 4.3 time frame. Older versions of glibc assume the
gnu89 meaning for "extern inline". That was cleaned up in glibc at
some point but I don't know when. See the -fgnu89-inline option.
Ian
More information about the Gcc-help
mailing list