On Wed, Dec 02, 2009 at 04:01:57PM +0100, Rainer Gerhards wrote: > Well, gcc itself should provide the helper - at least this is how I read the > doc. But, well, it looks more appropriate to change the variable definition > for 32 bit systems. I'll add a --enable-32-bit-atomics-where-possible > configure switch. If someone could contribute an automatic check for 32bit, > that would be appreciated. > > I would like to retain 64 bits on platforms that support it, because this is > the cleanest solution. > > rainer >
If you just change the type used in the current check function to "long long", it will work on 64-bit systems and fail on 32-bit systems. Then if the existing function with the "long" definition work, the system supports 32-bit atomics. Or am I missing something? Regards, Ken > ----- Urspr??ngliche Nachricht ----- > Von: "Kenneth Marshall" <[email protected]> > An: "rsyslog-users" <[email protected]> > Gesendet: 02.12.09 15:56 > Betreff: Re: [rsyslog] omfile does not compile on 32-bit platforms in 5.3.5 > > On Wed, Dec 02, 2009 at 03:45:24PM +0100, Rainer Gerhards wrote: > > Well, we could use a single 32 bit value without much problem, but the gcc > > doc claims gcc will replace the call with a helper function (Using a mutex, > > it can be implemented on any platform). > > > > rainer > > Yes, it does put a call to a function __sync_fetch_and_add_8() > stub which is why the link fails. It just seemed that it would > be easier to use the 4 byte counter and have one method that > would work across 32-bit and 64-bit systems, instead of needing > to support the missing function which could be implemented > using the same call with a 4 byte value. It would also simplify > code maintenance. > > Regards, > Ken > > > > > ----- Urspr??ngliche Nachricht ----- > > Von: "Kenneth Marshall" <[email protected]> > > An: "[email protected]" <[email protected]> > > Gesendet: 02.12.09 15:22 > > Betreff: [rsyslog] omfile does not compile on 32-bit platforms in 5.3.5 > > > > Hi Rainier, > > > > The version of omfile.c does not compile/run on 32-bit > > systems anymore. Here is the problem function: > > > > static uint64 clockFileAccess = 0; > > /* and the "tick" function */ > > static inline uint64 > > getClockFileAccess(void) > > { > > return ATOMIC_INC_AND_FETCH(clockFileAccess); > > } > > > > You cannot perform an atomic operation on an 8 byte value > > on a 32-bit system. Would it be possible to use the atomic > > operations on two 4 byte values to allow this code to work > > on 32-bit systems as well? > > > > Regards, > > Ken > > _______________________________________________ > > rsyslog mailing list > > http://lists.adiscon.net/mailman/listinfo/rsyslog > > http://www.rsyslog.com > > _______________________________________________ > > rsyslog mailing list > > http://lists.adiscon.net/mailman/listinfo/rsyslog > > http://www.rsyslog.com > _______________________________________________ > rsyslog mailing list > http://lists.adiscon.net/mailman/listinfo/rsyslog > http://www.rsyslog.com > _______________________________________________ > rsyslog mailing list > http://lists.adiscon.net/mailman/listinfo/rsyslog > http://www.rsyslog.com _______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com

