chiark / gitweb /
journal: systemd v38 fails to build on big-endians
authorDan Horák <dan@danny.cz>
Thu, 19 Jan 2012 11:42:53 +0000 (12:42 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 21 Jan 2012 02:48:26 +0000 (03:48 +0100)
Hi,

during the builds for Fedora/s390x I've found that systemd v38 fails to
build on big-endian platforms.

...
make[2]: Entering directory `/root/systemd'
  CC     src/journal/libsystemd_journal_la-sd-journal.lo
src/journal/sd-journal.c: In function 'init_location':
src/journal/sd-journal.c:69:22: error: incompatible types when
initializing type 'long unsigned int' using type 'sd_id128_t'
src/journal/sd-journal.c:69:20: error: incompatible types when assigning
to type 'sd_id128_t' from type 'long unsigned int'
make[2]: *** [src/journal/libsystemd_journal_la-sd-journal.lo] Error 1

I see the problem in using le64toh() on the 16 bytes boot_id structure
in init_location()

Please see
http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=544375 for a
full build log and attachment for a proposed fix.

With regards

Dan

src/journal/sd-journal.c

index 5e1fd4773e835d1534e54765bbeedab06df41940..baf51db1a89ede6bed135e3957fb134778557a62 100644 (file)
@@ -66,7 +66,7 @@ static void init_location(Location *l, JournalFile *f, Object *o) {
         l->seqnum_id = f->header->seqnum_id;
         l->realtime = le64toh(o->entry.realtime);
         l->monotonic = le64toh(o->entry.monotonic);
-        l->boot_id = le64toh(o->entry.boot_id);
+        l->boot_id = o->entry.boot_id;
         l->xor_hash = le64toh(o->entry.xor_hash);
 
         l->seqnum_set = l->realtime_set = l->monotonic_set = l->xor_hash_set = true;