[systemd-devel] systemd requires LFS?

Lennart Poettering lennart at poettering.net
Fri Apr 20 12:51:29 PDT 2012


On Fri, 20.04.12 09:09, Peter Lindgren (lindgren.peter at gmail.com) wrote:

> Hi,
> 
> when cross compiling systemd-44 for my arm target I run into compile
> problem in src/util.c
> 
> src/util.c: In function 'parse_bytes':
> src/util.c:3158:17: error: overflow in implicit constant conversion
> [-Werror=overflow]
> src/util.c:3159:17: error: overflow in implicit constant conversion
> [-Werror=overflow]
> src/util.c:3160:17: error: overflow in implicit constant conversion
> [-Werror=overflow]
> src/util.c: In function 'format_bytes':
> src/util.c:6179:17: error: overflow in implicit constant conversion
> [-Werror=overflow]
> src/util.c:6180:17: error: overflow in implicit constant conversion
> [-Werror=overflow]
> src/util.c:6181:17: error: overflow in implicit constant conversion
> [-Werror=overflow]
> 
> This code requires that off_t is defined as an 64bit off_t (off64_t) using
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64.
> 
> Just removing these lines also shows that there is code in
> src/conf-parser.c that assert sizeof(off_t) == sizeof(uint64_t).
> src/conf-parser.c: In function 'config_parse_bytes_off':
> src/conf-parser.c:508:9: error: duplicate case value
> 
> Does systemd really require LFS support => off_t to be defined as
> off64_t?

Well, yes, I guess. What is your reason for using 32bit off_t? I mean,
this is usually not something where it is worth optimizing, as it is
hardly used in inner loops.

> Or could this code just modified to remove the assert_cc and modify the
> parse_bytes function to use an uint64_t instead off off64_t?

We place the assert_cc there for a reason to catch problems like
this. We don't support 32bit off_t, as that is kinda legacy. What is
your usecase for not using 64bit off_t?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list