Zbigniew Jędrzejewski-Szmek <zbys...@in.waw.pl> wrote on 04/21/2015 01:51:29 PM: > On Tue, Apr 21, 2015 at 08:39:35AM -0700, aaron_wri...@selinc.com wrote: > > I've been getting a few problems building systemd with "--enable-resolved > > ". Any help would be very welcomed. I don't have any problems when > > compiling with "--disable-resolved". > > > > The first problem I got was this: > > > > CCLD libnss_resolve.la > > libsystemd_internal_la-bus-message.o (symbol from plugin): warning: memset > > used with constant zero length parameter; this could be due to transposed > > parameters > > /tmp/cc03x1nN.ltrans6.ltrans.o: In function `bus_error_name_to_errno.4725 > > ': > > cc03x1nN.ltrans6.o:(.text+0x12bb): undefined reference to > > `__stop_BUS_ERROR_MAP' > > cc03x1nN.ltrans6.o:(.text+0x12c2): undefined reference to > > `__start_BUS_ERROR_MAP' > > collect2: ld returned 1 exit status > > > > I got around this be removing "-flto" from "OUR_CFLAGS" in the Makefile. > > How is that change going to impact systemd? Is there a better way to work > > around this problem? > Afaik nobody has measured that. It will certainly make your compilation > times much shorter :)
So after some reading, LTO is an optimization flag; removing it would potentially slow down systemd a little bit, but it shouldn't change any behavior. I could live with that. But now I can't figure out how to get rid of "-flto" reliably. It's not mentioned in Makefile.am. It seems to be added by libtool automatically, but I can't figure out how to make it stop. I tried adding "-fno-lto" to libnss_resolve_la_LDFLAGS in Makefile.am, but libtool seems to strip that out. Presumably because it doesn't recognize it. > > > After I got pass the first error, I now get this: > > > > CC src/resolve/resolved-dns-cache.o > > src/resolve/resolved-dns-scope.c: In function ?dns_scope_tcp_socket?: > > src/resolve/resolved-dns-scope.c:260:56: error: ?IP_UNICAST_IF? undeclared > > (first use in this function) > > src/resolve/resolved-dns-scope.c:260:56: note: each undeclared identifier > > is reported only once for each function it appears in > It was in kernel 3.4. What kernel headers are you using? > > Zbyszek You're right. I'm using Kernel 3.10. I didn't have the right linux-libc-dev package installed. So now IP_UNICAST_IF is defined in /usr/include/linux/in.h, but that doesn't fix the compile errors. I can't include "linux/in.h" directly as that'll cause all sorts of redefinition errors with "netinet/in.h". I'm not sure what is supposed to include "linux/in.h" for me. Including "netinet/in.h" doesn't fix it, as it doesn't define IP_UNICAST_IF. I ended up adding "#define IP_UNICAST_IF 50" to the top of " src/resolve/resolved-dns-scope.c" and "src/resolve/resolved-dns-stream.c", which is a little hackish, but at leasts gets it to compile.
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel