Bug 4506 - Compile dies with errors
Summary: Compile dies with errors
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.9
Hardware: x86 Linux
: P3 minor (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-11 18:34 UTC by Tigerwolf
Modified: 2007-04-11 21:55 UTC (History)
0 users

See Also:


Attachments
Fix NORETURN glitch (642 bytes, patch)
2007-04-11 21:55 UTC, Wayne Davison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tigerwolf 2007-04-11 18:34:32 UTC
Trying to compile for an older system:

Reading specs from /usr/lib/gcc-lib/i586-unknown-linux-gnulibc1/2.7.2.3/specs
gcc version 2.7.2.3

Configure goes well, and reports successful.

Make dies quickly:

tiger:/archive3/rsync-2.6.9# make
gcc -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt  -c rsync.c -o rsync.o
In file included from rsync.h:672,
                 from rsync.c:23:
proto.h:24: parse error before `void'
proto.h:279: parse error before `void'
proto.h:280: parse error before `void'
rsync.c: In function `sig_int':
rsync.c:244: warning: implicit declaration of function `_exit_cleanup'
make: *** [rsync.o] Error 1

Looking at the lines complained about in proto.h, they all start with NORETURN.

I've no idea what I'm doing as I don't know C at all, but I removed the NORETURN , moving the 'void' part to the start of the lines.  

Compile got a bit further, choking on another file with NORETURN.  Removing those as they were found finally resulted in a complete compile, except for occasional warnings about 'implicit declaration of function' in several files.

The resulting rsync was subjected to 'make check' and passed 29 and skipped 2 (one about a temp dir not being on a different filesystem...which was correct) and the other about ssh not done because of some argument to include that.  So it looks like it's working, but I don't know if the removed NORETURNs is leaving some problem lurking.

Hopefully the source can be configured so NORETURN isn't a problem with compilers that don't understand whatever it does.
Comment 1 Wayne Davison 2007-04-11 21:54:19 UTC
Older versions of gcc have some trouble with NORETURN, which is why the CVS version of rsync defines it to an empty string for GCC <= 2.  This eliminates its presence, which is fine as it is just there to make the compiler warnings more accurate during development.

I'll attach a patch that will enhance rsync.h in the same way that the CVS version did.
Comment 2 Wayne Davison 2007-04-11 21:55:52 UTC
Created attachment 2382 [details]
Fix NORETURN glitch

This patch defines NORETURN to an empty value for GCC <= 2.