Patchwork [2/2] systemd: fix tests when not using gold

login
register
mail settings
Submitter danismostlikely@gmail.com
Date April 23, 2014, 3:01 p.m.
Message ID <CACS+7ZR=mA9+=NzxF=XLXvxxgypsjzcftZQ0UVWG-0rBLk202A@mail.gmail.com>
Download mbox | patch
Permalink /patch/70811/
State New
Headers show

Comments

danismostlikely@gmail.com - April 23, 2014, 3:01 p.m.
From: Dan McGregor <dan.mcgregor@usask.ca>

Explicitly mark the dummy function as externally visible
so that ld can find the symbol at link time. This is needed
when the DISTRO_FEATURE ld-is-gold is not enabled; systemd
uses -flto anyway.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
---
 meta/recipes-core/systemd/systemd/systemd-lto-fix.patch | 14 ++++++++++++++
 meta/recipes-core/systemd/systemd_211.bb                |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/systemd-lto-fix.patch

            file://systemd-pam-fix-fallocate.patch \
Ross Burton - April 23, 2014, 4:17 p.m.
On 23 April 2014 16:01, Dan McGregor <danismostlikely@gmail.com> wrote:
> Explicitly mark the dummy function as externally visible
> so that ld can find the symbol at link time. This is needed
> when the DISTRO_FEATURE ld-is-gold is not enabled; systemd
> uses -flto anyway.

So how does this work for me currently (or the autobuilder), where
ld-is-gold isn't enabled?

Ross
Ross Burton - April 23, 2014, 4:24 p.m.
(re-adding the list)

On 23 April 2014 17:19, Dan McGregor <danismostlikely@gmail.com> wrote:
> Sorry, I should have been more specific. It breaks with Linaro GCC from
> meta-linaro, not the one in oe-core. It works fine with oe-core's gcc.

So arguably this should be in meta-linaro, as it's to fix a problem
with their (presumably, old) toolchain?

Ross
Saul Wold - April 23, 2014, 4:34 p.m.
On 04/23/2014 08:01 AM, Dan McGregor wrote:
> From: Dan McGregor <dan.mcgregor@usask.ca>
>
> Explicitly mark the dummy function as externally visible
> so that ld can find the symbol at link time. This is needed
> when the DISTRO_FEATURE ld-is-gold is not enabled; systemd
> uses -flto anyway.
>
> Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
> ---
>   meta/recipes-core/systemd/systemd/systemd-lto-fix.patch | 14 ++++++++++++++
>   meta/recipes-core/systemd/systemd_211.bb                |  1 +
>   2 files changed, 15 insertions(+)
>   create mode 100644 meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>
> diff --git a/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> new file mode 100644
> index 0000000..90875e4
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch

The patch also needs an appropriate Upstream-Status and Signed-off-by 
tags here.

Thanks
	Sau!

> @@ -0,0 +1,14 @@
> +diff --git a/src/test/test-udev.c b/src/test/test-udev.c
> +index b064744..3753c87 100644
> +--- a/src/test/test-udev.c
> ++++ b/src/test/test-udev.c
> +@@ -36,7 +36,8 @@
> + #include "udev.h"
> + #include "udev-util.h"
> +
> +-void udev_main_log(struct udev *udev, int priority,
> ++void __attribute__((externally_visible))
> ++     udev_main_log(struct udev *udev, int priority,
> +                    const char *file, int line, const char *fn,
> +                    const char *format, va_list args) {}
> +
> diff --git a/meta/recipes-core/systemd/systemd_211.bb
> b/meta/recipes-core/systemd/systemd_211.bb
> index df632ab..ddf89b8 100644
> --- a/meta/recipes-core/systemd/systemd_211.bb
> +++ b/meta/recipes-core/systemd/systemd_211.bb
> @@ -23,6 +23,7 @@ PV = "211+git${SRCPV}"
>
>   SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git
> \
>              file://binfmt-install.patch \
> +           file://systemd-lto-fix.patch \
>              file://systemd-pam-configure-check-uclibc.patch \
>              file://systemd-pam-fix-execvpe.patch \
>              file://systemd-pam-fix-fallocate.patch \
>
danismostlikely@gmail.com - April 23, 2014, 4:43 p.m.
On 23 April 2014 10:34, Saul Wold <sgw@linux.intel.com> wrote:

> On 04/23/2014 08:01 AM, Dan McGregor wrote:
>
>> From: Dan McGregor <dan.mcgregor@usask.ca>
>>
>> Explicitly mark the dummy function as externally visible
>> so that ld can find the symbol at link time. This is needed
>> when the DISTRO_FEATURE ld-is-gold is not enabled; systemd
>> uses -flto anyway.
>>
>> Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
>> ---
>>   meta/recipes-core/systemd/systemd/systemd-lto-fix.patch | 14
>> ++++++++++++++
>>   meta/recipes-core/systemd/systemd_211.bb                |  1 +
>>   2 files changed, 15 insertions(+)
>>   create mode 100644 meta/recipes-core/systemd/
>> systemd/systemd-lto-fix.patch
>>
>> diff --git a/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>> b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>> new file mode 100644
>> index 0000000..90875e4
>> --- /dev/null
>> +++ b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>>
>
> The patch also needs an appropriate Upstream-Status and Signed-off-by tags
> here.
>
> Thanks
>         Sau!
>
>
As I said to Ross off-list (accidentally), this patch was for Linaro GCC as
of 2014-03-20. I'm going to check that it's still vald, and if so I'll send
it upstream too.

Thanks,
Khem Raj - April 24, 2014, 2:37 a.m.
On Wed, Apr 23, 2014 at 9:43 AM, Dan McGregor <danismostlikely@gmail.com> wrote:
> On 23 April 2014 10:34, Saul Wold <sgw@linux.intel.com> wrote:
>>
>> On 04/23/2014 08:01 AM, Dan McGregor wrote:
>>>
>>> From: Dan McGregor <dan.mcgregor@usask.ca>
>>>
>>> Explicitly mark the dummy function as externally visible
>>> so that ld can find the symbol at link time. This is needed
>>> when the DISTRO_FEATURE ld-is-gold is not enabled; systemd
>>> uses -flto anyway.
>>>
>>> Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
>>> ---
>>>   meta/recipes-core/systemd/systemd/systemd-lto-fix.patch | 14
>>> ++++++++++++++
>>>   meta/recipes-core/systemd/systemd_211.bb                |  1 +
>>>   2 files changed, 15 insertions(+)
>>>   create mode 100644
>>> meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>>>
>>> diff --git a/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>>> b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>>> new file mode 100644
>>> index 0000000..90875e4
>>> --- /dev/null
>>> +++ b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>>
>>
>> The patch also needs an appropriate Upstream-Status and Signed-off-by tags
>> here.
>>
>> Thanks
>>         Sau!
>>
>
> As I said to Ross off-list (accidentally), this patch was for Linaro GCC as
> of 2014-03-20. I'm going to check that it's still vald, and if so I'll send
> it upstream too.

FWIW, I have updated the systemd recipe to 212+ its here
http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/musl&id=f4283b924c13ea4d98b4251e11dd6a3388f195d5

can you check if this patch is still needed there ? I use gold/arm and
did not run into this issue.

>
> Thanks,
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
danismostlikely@gmail.com - April 24, 2014, 4:32 p.m.
On 23 April 2014 20:37, Khem Raj <raj.khem@gmail.com> wrote:

> On Wed, Apr 23, 2014 at 9:43 AM, Dan McGregor <danismostlikely@gmail.com>
> wrote:
> > On 23 April 2014 10:34, Saul Wold <sgw@linux.intel.com> wrote:
> >>
> >> On 04/23/2014 08:01 AM, Dan McGregor wrote:
> >>>
> >>> From: Dan McGregor <dan.mcgregor@usask.ca>
> >>>
> >>> Explicitly mark the dummy function as externally visible
> >>> so that ld can find the symbol at link time. This is needed
> >>> when the DISTRO_FEATURE ld-is-gold is not enabled; systemd
> >>> uses -flto anyway.
> >>>
> >>> Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
> >>> ---
> >>>   meta/recipes-core/systemd/systemd/systemd-lto-fix.patch | 14
> >>> ++++++++++++++
> >>>   meta/recipes-core/systemd/systemd_211.bb                |  1 +
> >>>   2 files changed, 15 insertions(+)
> >>>   create mode 100644
> >>> meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> >>>
> >>> diff --git a/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> >>> b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> >>> new file mode 100644
> >>> index 0000000..90875e4
> >>> --- /dev/null
> >>> +++ b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> >>
> >>
> >> The patch also needs an appropriate Upstream-Status and Signed-off-by
> tags
> >> here.
> >>
> >> Thanks
> >>         Sau!
> >>
> >
> > As I said to Ross off-list (accidentally), this patch was for Linaro GCC
> as
> > of 2014-03-20. I'm going to check that it's still vald, and if so I'll
> send
> > it upstream too.
>
> FWIW, I have updated the systemd recipe to 212+ its here
>
> http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/musl&id=f4283b924c13ea4d98b4251e11dd6a3388f195d5
>
> can you check if this patch is still needed there ? I use gold/arm and
> did not run into this issue.
>
>
I'll take a look at soon, I switched to gold because of this issue, so a
systemd build may take some time. I'll let you know when I'm done.


> >
> > Thanks,
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >
>
danismostlikely@gmail.com - April 28, 2014, 9:36 p.m.
On 23 April 2014 20:37, Khem Raj <raj.khem@gmail.com> wrote:

> On Wed, Apr 23, 2014 at 9:43 AM, Dan McGregor <danismostlikely@gmail.com>
> wrote:
> > On 23 April 2014 10:34, Saul Wold <sgw@linux.intel.com> wrote:
> >>
> >> On 04/23/2014 08:01 AM, Dan McGregor wrote:
> >>>
> >>> From: Dan McGregor <dan.mcgregor@usask.ca>
> >>>
> >>> Explicitly mark the dummy function as externally visible
> >>> so that ld can find the symbol at link time. This is needed
> >>> when the DISTRO_FEATURE ld-is-gold is not enabled; systemd
> >>> uses -flto anyway.
> >>>
> >>> Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
> >>> ---
> >>>   meta/recipes-core/systemd/systemd/systemd-lto-fix.patch | 14
> >>> ++++++++++++++
> >>>   meta/recipes-core/systemd/systemd_211.bb                |  1 +
> >>>   2 files changed, 15 insertions(+)
> >>>   create mode 100644
> >>> meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> >>>
> >>> diff --git a/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> >>> b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> >>> new file mode 100644
> >>> index 0000000..90875e4
> >>> --- /dev/null
> >>> +++ b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
> >>
> >>
> >> The patch also needs an appropriate Upstream-Status and Signed-off-by
> tags
> >> here.
> >>
> >> Thanks
> >>         Sau!
> >>
> >
> > As I said to Ross off-list (accidentally), this patch was for Linaro GCC
> as
> > of 2014-03-20. I'm going to check that it's still vald, and if so I'll
> send
> > it upstream too.
>
> FWIW, I have updated the systemd recipe to 212+ its here
>
> http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/musl&id=f4283b924c13ea4d98b4251e11dd6a3388f195d5
>
> can you check if this patch is still needed there ? I use gold/arm and
> did not run into this issue.
>
>
I just reran it, and it does indeed fail with meta-linaro-toolchain,
gcc_linaro-4.8, and binutils_linaro-2.24. It builds fine with my patch.

> >
> > Thanks,
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >
>
Khem Raj - May 9, 2014, 2:25 a.m.
On Mon, Apr 28, 2014 at 2:36 PM, Dan McGregor <danismostlikely@gmail.com> wrote:
> On 23 April 2014 20:37, Khem Raj <raj.khem@gmail.com> wrote:
>>
>> On Wed, Apr 23, 2014 at 9:43 AM, Dan McGregor <danismostlikely@gmail.com>
>> wrote:
>> > On 23 April 2014 10:34, Saul Wold <sgw@linux.intel.com> wrote:
>> >>
>> >> On 04/23/2014 08:01 AM, Dan McGregor wrote:
>> >>>
>> >>> From: Dan McGregor <dan.mcgregor@usask.ca>
>> >>>
>> >>> Explicitly mark the dummy function as externally visible
>> >>> so that ld can find the symbol at link time. This is needed
>> >>> when the DISTRO_FEATURE ld-is-gold is not enabled; systemd
>> >>> uses -flto anyway.
>> >>>
>> >>> Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
>> >>> ---
>> >>>   meta/recipes-core/systemd/systemd/systemd-lto-fix.patch | 14
>> >>> ++++++++++++++
>> >>>   meta/recipes-core/systemd/systemd_211.bb                |  1 +
>> >>>   2 files changed, 15 insertions(+)
>> >>>   create mode 100644
>> >>> meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>> >>>
>> >>> diff --git a/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>> >>> b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>> >>> new file mode 100644
>> >>> index 0000000..90875e4
>> >>> --- /dev/null
>> >>> +++ b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
>> >>
>> >>
>> >> The patch also needs an appropriate Upstream-Status and Signed-off-by
>> >> tags
>> >> here.
>> >>
>> >> Thanks
>> >>         Sau!
>> >>
>> >
>> > As I said to Ross off-list (accidentally), this patch was for Linaro GCC
>> > as
>> > of 2014-03-20. I'm going to check that it's still vald, and if so I'll
>> > send
>> > it upstream too.
>>
>> FWIW, I have updated the systemd recipe to 212+ its here
>>
>> http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/musl&id=f4283b924c13ea4d98b4251e11dd6a3388f195d5
>>
>> can you check if this patch is still needed there ? I use gold/arm and
>> did not run into this issue.
>>
>
> I just reran it, and it does indeed fail with meta-linaro-toolchain,
> gcc_linaro-4.8, and binutils_linaro-2.24. It builds fine with my patch.

I took another look at this patch. I think you should get feedback from systemd
community on it. It seems to me that its happening in conjunction with LTO
and there could be a back port in linaro gcc which is triggering it.
In that case sooner or later it will show up with upstream gcc as
well.

Patch

diff --git a/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
new file mode 100644
index 0000000..90875e4
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-lto-fix.patch
@@ -0,0 +1,14 @@ 
+diff --git a/src/test/test-udev.c b/src/test/test-udev.c
+index b064744..3753c87 100644
+--- a/src/test/test-udev.c
++++ b/src/test/test-udev.c
+@@ -36,7 +36,8 @@
+ #include "udev.h"
+ #include "udev-util.h"
+
+-void udev_main_log(struct udev *udev, int priority,
++void __attribute__((externally_visible))
++     udev_main_log(struct udev *udev, int priority,
+                    const char *file, int line, const char *fn,
+                    const char *format, va_list args) {}
+
diff --git a/meta/recipes-core/systemd/systemd_211.bb
b/meta/recipes-core/systemd/systemd_211.bb
index df632ab..ddf89b8 100644
--- a/meta/recipes-core/systemd/systemd_211.bb
+++ b/meta/recipes-core/systemd/systemd_211.bb
@@ -23,6 +23,7 @@  PV = "211+git${SRCPV}"

 SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git
\
            file://binfmt-install.patch \
+           file://systemd-lto-fix.patch \
            file://systemd-pam-configure-check-uclibc.patch \
            file://systemd-pam-fix-execvpe.patch \