Bug#909396: systemd: FTBFS on hppa and x32 - relocation can not be used when making a shared object

John David Anglin dave.anglin at bell.net
Sun Sep 23 22:00:51 BST 2018


On 2018-09-23 4:44 PM, Michael Biebl wrote:
> Am 23.09.18 um 22:27 schrieb John David Anglin:
>> Well the problem was latent in 239-7 and probably gcc changed.  The
>> thing is the error points
>> to an error in the link command.  On hppa, it is almost always necessary
>> to link shared and pie
>> objects with -fPIC or -fPIE, respectively.  There are compilations in
>> the link process and
>> the generated objects need to be position independent when doing shared
>> and pie links.
>>
>> The attached patch fixes the failing link command although I'm not sure
>> it's optimal as
>> generally -fPIE and -pie need to be specified together.  Meson appears
>> to test the options
>> separately.  Putting them together as one option doesn't work.  The
>> systemd build completes
>> with the patch.  There was one timeout in the testsuite but the system
>> was under high load.
> Looking at the "ld" man page, it doesn't say anything about -fPIE, only
> about -pie.
> Can you please provide some references why on hppa the linker needs
> -fPIE in addition to -pie
-fPIE is not a "ld" option.  It is a compiler option.  Note that the 
code uses the "cc", compiler driver,
to perform the link.   The "-flto" option also is a compiler driver 
option that enables link-time optimization.
Take a look at what happens when you do a shared or pie link with 
compiler driver.  Add "-v" to see
the intermediate steps.

   -fPIC                       Generate position-independent code if 
possible
                               (large mode).

   -fPIE                       Generate position-independent code for
                               executables if possible (large mode).

   -flto                       Enable link-time optimization.

   -pie                     Create a dynamically linked position independent
                            executable.

   -shared                  Create a shared library.

Dave

-- 
John David Anglin  dave.anglin at bell.net




More information about the Pkg-systemd-maintainers mailing list