You are not logged in.

#1 2014-06-18 07:42:36

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

[Solved] [Systemd] Systemd PKGBUILD on i686 (in a VM) - Linker failure

Hi all!

I'm trying to recompile Systemd using the PKGBUILD from ABS (rsynced again today - 18-6-2014). However, I cannot get it to build.
Obviously the Arch Linux builders can compile this, so I am doing something wrong, in some way shape or form.

Why I am even trying to do this:

I want to recompile Systemd for i586 - because I would like to run Arch Linux on the 16 year old Pentium MMX laptop. I have created a build script that builds everything in base and that base depends on, and have rebuilt everything except Systemd for i586 (changed makepkg.conf as per the wiki article https://wiki.archlinux.org/index.php/Install_Arch_i586 which may/may not be accurate).
I have tried both for i686 (default) and i586, so the issue is not related to the compilation architecture.

Problem:

During the compiling process, an error comes up from the ld.gold linker:

/usr/bin/ld.gold: error: .libs/pam_systemd.ver:2:1: syntax error, unexpected LOCAL, expecting STRING or QUOTED_STRING or EXTERN
/usr/bin/ld.gold: fatal error: unable to parse the version script file .libs/pam_systemd.ver

So, the .libs/pam_systemd.ver file is invalid in some way shape or form.

What I have tried:

Originally, the problem was with gudev, which I decided was not needed (this system will be CLI only due to low RAM), so I added --disable-gudev to the configure flags in the PKGBUILD. However research suggests that I need pam_systemd for logging in - so I do have to build pam_systemd.
I am unfamiliar with ld.gold, so further research showed that it was a linker, and that version files are special files that are used to mark libraries. I have base-devel installed, so it is not a missing dependency.
Looking at the original source tarball, the .libs directory (which poking around in the makefile revealed to be the obj directory) does not exist, so pam_systemd.ver must have been put there at some point. I have looked for references to pam_systemd.ver by running cat on every file and grepping the output, but failed to find any direct references. I have also looked at the other .sym files, which also appear to be the same as version script files. However, there is not one for pam_systemd.
Peering at the makefile using grep and searching in less have shown me that references to pam_systemd are fairly normal - and do not include any --version-script arguments to ld.gold, so I think that the .ver files are not supposed to exist. But what created them? Why? And why, if they are automagically created, are they invalid?

The mystery deepens - and my google fu leaves me. Please - can anyone shed some light on this?

I can post more info if required.

Thanks,
pypi

Last edited by pypi (2014-06-21 21:12:34)

Offline

#2 2014-06-21 19:46:02

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: [Solved] [Systemd] Systemd PKGBUILD on i686 (in a VM) - Linker failure

Hi there!

I have a solution: adding CFLAGS="$CFLAGS -fno-lto" prior to the configure command fixes the build error!
This was borrowed from the development systemd Linux From Scratch 'Systemd-214' page (http://www.linuxfromscratch.org/lfs/vie … stemd.html. Any comments on what link time optimization does that might possibly create a dodgy version script would be appreciated - I'd love to know more about why this works.

Looking on the bright side, I now know what LTO is, at least vaguely. You learn new things every day, especially using Arch Linux smile

Thanks,
pypi

Offline

#3 2014-06-21 20:01:01

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] [Systemd] Systemd PKGBUILD on i686 (in a VM) - Linker failure

You don't need to disable LTO. You can alternatively:

1) Re-enable fat LTO objects (as of gcc 4.9, this is no longer the default) by adding -ffat-lto-objects to your CFLAGS
2) Use the gcc-ar and gcc-ranlib wrappers which understand the non-fat object files by passing "NM=gcc-nm" and "RANLIB=gcc-ranlib" to the ./configure invocation

Offline

#4 2014-06-21 22:08:31

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: [Solved] [Systemd] Systemd PKGBUILD on i686 (in a VM) - Linker failure

I guess that means that 'slim' lto is gcc specific?

https://gcc.gnu.org/onlinedocs/gccint/LTO.html#LTO

Thanks for the extra info!

Offline

Board footer

Powered by FluxBB