Hi Lutz, interesting project :)
> -----Original Message----- > From: [email protected] [mailto:rsyslog- > [email protected]] On Behalf Of DISTEC Helwing Lutz > Sent: Wednesday, December 02, 2009 9:23 AM > To: [email protected] > Subject: [rsyslog] Cross compiling rsyslogd... > > Hi folks, > > I'm trying to cross compile rsyslog for an embedded system running with > ARM v5t processor. While doing this I ran into some troubles: > (I've considered some hints from this site: > http://cross-lfs.org/view/clfs-2.0/arm/final-system/rsyslog.html ) mhhh - the link doesn't work for me. Some typo? > 1. Configure seems to not determine correct values for the following: > - ac_cv_func_malloc_0_nonnull > - ac_cv_func_realloc_0_nonnull > After setting these to yes the list of errors shrinks dramatically but > there are still some left... I am primarily a user of autotools and I have to admit that I do not know what these settings do or cause. Can someone jump in? > 2. There seems to be a problem with atomic operations. AFAIK my > processor supports atomic operations (please correct me if I'm wrong). I have no idea if it supports them. > Configure instead determines that atomic support should not be enabled > (ap_cv_atomic_builtins=no). That sounds like a strong indication they are actually not supported. What the configure test tries is compile a program using them and that obviously fails... > When running make afterwards i get some > errors like "glbl.c:134: undefined reference to > 'ATOMIC_STORE_1_TO_INT'". When looking into atomic.h it becomes clear > what causes this error: some macros are not defined when > HAVE_ATOMIC_BUILTINS is not defined but are obviously used > nevertheless. That is because recent versions of rsyslog can simply not work without atomics. So far, it was not worth the effort implementing that. > I get rid of this problem by setting ap_cv_atomic_builtins=yes > explicitly. When combining the solutions of 1. and 2. make builds > successfully. This sounds dangerous, but when it does not result in compile errors, it may work. > 3. When starting rsyslogd an the ARM machine I get a segmentation fault > (unfortunately i have no stack trace, but i could send debug output > from > rsyslogd and rsyslog.conf if neccessary). > > > 4. When commenting out the two lines for module load i get an alignment which lines do you mean? > trap: Alignment trap: rs:main Q:Reg (12879) PC=0x0004ff8c > Instr=0xe5932014 Address=0x20766f62 FSR 0x001 Bus error > (debug output could be sent if neccessary) > > > Is it possible that issues 3. and 4. have something to do with the > atomics issue? > Maybe anyone has an idea what else could be wrong here? > Thanks a lot. To approach this problem, I think it is critical to get a clear understanding of the availability of atomic instructions on your platform. If they are not actually available but you use dummies, all kinds of strange things may happen (including #3 and #4). So the first thing to do is find a definite reference if your processor/compiler combination supports them. Depending on the outcome the next step is: If atomics are supported, find out why configure claims they are not and how to fix that (this ensures that everything actually needed is applied during the build process). If atomics are not supported, you need to replace the atomic instructions with carfully-crafted mutex calls inside the code. This is the only safe way to do it. It's quite possible, but I have not done it because I have no need for it. After these steps, we should have a platform that we know to work correctly in regard to the atomics, so then we can look at debugging any remaining issues. If you modify some code, please contribute the patches back, I will then be able to include them (and also do some checks if they fit into the overall picture etc). HTH Rainer > > Cheers, > Lutz > _______________________________________________ > 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

