[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#896012: Regression from gcc-7 7.3.0-16



On 19.04.2018 06:16, Mario.Limonciello@dell.com wrote:
>> -----Original Message-----
>> From: Matthias Klose [mailto:doko@debian.org]
>> Sent: Wednesday, April 18, 2018 9:29 PM
>> To: Limonciello, Mario; 896012@bugs.debian.org
>> Subject: Re: Bug#896012: Regression from gcc-7 7.3.0-16
>>
>> On 18.04.2018 19:34, Mario.Limonciello@dell.com wrote:
>>> Package: gcc-7
>>> Version: 7.3.0-16
>>>
>>> The fwupd project as one of the CI tasks runs packaged builds and lintian after the
>> build.
>>> CI recently started failing with this error:
>>>
>>> E: fwupd: library-not-linked-against-libc usr/lib/x86_64-linux-gnu/fwupd-plugins-
>> 3/libfu_plugin_upower.so
>>> E: fwupd-tests: library-not-linked-against-libc usr/lib/x86_64-linux-gnu/fwupd-
>> plugins-3/libfu_plugin_test.so
>>>
>>> We narrowed it down to be caused after upgrading to GCC 7.3.0-16 from Debian
>> testing.
>>> Builds with 7.3.0-15 and no source changes to fwupd are not affected.
>>>
>>> We also found that changing compiler optimization (-O2 to -O0) with the new GCC
>> this error
>>> goes away.
>>
>> please could you attach the linker command, run with -v, and maybe all linker
>> scripts?
> 
> Here are both compiler and linker commands when run with -v.

[...]

so yes, this is a behavior change. Up to now the link looked like

  -lgcc --as-needed -lgcc_s --no-as-needed \
  -lpthread -lc \
  -lgcc --as-needed -lgcc_s --no-as-needed

while now we are linking with

  -lgcc --push-state --as-needed -lgcc_s --pop-state \
  -lpthread -lc \
  -lgcc --push-state --as-needed -lgcc_s --pop-state

Up to -15, that resulted in libc always linked in, while starting with -16, it
is linked with the state which is enabled before the gcc link command.  If the
plugin doesn't have a reference to libc and --as-needed is specified as in your
case, then libc isn't linked in.

So probably we need an update for our QA tools to do a better detection of
dynamically linked binaries.

Matthias


Reply to: