Skip to contentSkip to conversation

systemd: disable problematic GCC 5.2 optimizations

PATCH Superseded Jonathan Liu 4 participants 8 messages Sep 21, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: disable problematic GCC 5.2 optimizations

This fixes systemd failing to start on Raspberry Pi 2 if it is compiled with GCC 5.2.

It would try to start "Journal Service" and "udev Kernel Device Manager" but fail repeatedly.

[YOCTO #8291]

---
 meta/recipes-core/systemd/systemd_225.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-core/systemd/systemd_225.bb +3 -0
index f7d4c7d..4a19ff4 100644
@@ -123,6 +123,9 @@ EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
 # uclibc does not have NSS
 EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
 
+# disable problematic GCC 5.2 optimizations [YOCTO #8291]
+FULL_OPTIMIZATION += "-fno-schedule-insns -fno-schedule-insns2"
+
 do_configure_prepend() {
 	export NM="${HOST_PREFIX}gcc-nm"
 	export AR="${HOST_PREFIX}gcc-ar"
Signature · 1 line
2.5.0
#1 lore raw
Quoted 2 lines · Jonathan Liu

+FULL_OPTIMIZATION += "-fno-schedule-insns -fno-schedule-insns2"

Are these bugs with the gcc optimisations or the systemd source code, and if its gcc's fault are the problematic optimisations specific to a particular architecture (such as ARM)? Just wondering if we can use overrides to only change the optimisations where they're a problem.

Ross

#2 lore raw
Quoted 9 lines · Ross

On 21 September 2015 at 12:23, Jonathan Liu <[email protected] <mailto:[email protected]>> wrote:

    +FULL_OPTIMIZATION += "-fno-schedule-insns -fno-schedule-insns2"

Are these bugs with the gcc optimisations or the systemd source code, and if its gcc's fault are the problematic optimisations specific to a particular architecture (such as ARM)? Just wondering if we can use overrides to only change the optimisations where they're a problem.

Ross

I am not sure how to isolate if it's an issue in the systemd source code but the issue is not present when using GCC 4.9. Haven't checked if this is occuring on other architectures. Any feedback whether this occurs on other platforms (Raspberry Pi 2 is ARMv7) is welcome.

Regards,
Jonathan

#3 lore raw

Hi,

On Beaglebone-black Systemd 215 does not boot if compiled with -O2. Compiling with -O1 works.

Regards,
Adrian

2015-09-21 14:31 GMT+02:00 Jonathan Liu <[email protected]>:

Quoted 30 lines · Ross
Quoted 2 lines · Jonathan Liu

+FULL_OPTIMIZATION += "-fno-schedule-insns -fno-schedule-insns2"

Are these bugs with the gcc optimisations or the systemd source code, and if its gcc's fault are the problematic optimisations specific to a particular architecture (such as ARM)? Just wondering if we can use overrides to only change the optimisations where they're a problem.

Ross

I am not sure how to isolate if it's an issue in the systemd source code but the issue is not present when using GCC 4.9.
Haven't checked if this is occuring on other architectures. Any feedback whether this occurs on other platforms (Raspberry Pi 2 is ARMv7) is welcome.

Regards,
Jonathan

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw

Hi Adrian,

Quoted 18 lines · Adrian Freihofer

On Beaglebone-black Systemd 215 does not boot if compiled with -O2. Compiling with -O1 works. 2015-09-21 14:31 GMT+02:00 Jonathan Liu <[email protected] <mailto:[email protected]>>:

    On 21/09/2015 10:23 PM, Burton, Ross wrote:
Quoted 7 lines

On 21 September 2015 at 12:23, Jonathan Liu <[email protected] <mailto:[email protected]>> wrote:

+FULL_OPTIMIZATION += "-fno-schedule-insns -fno-schedule-insns2"

Quoted 7 lines

Are these bugs with the gcc optimisations or the systemd source code, and if its gcc's fault are the problematic optimisations specific to a particular architecture (such as ARM)? Just wondering if we can use overrides to only change the optimisations where they're a problem.

Ross

Quoted 9 lines

I am not sure how to isolate if it's an issue in the systemd source code but the issue is not present when using GCC 4.9. Haven't checked if this is occuring on other architectures. Any feedback whether this occurs on other platforms (Raspberry Pi 2 is ARMv7) is welcome.

Regards,
Jonathan

Can you try the patch instead of changing -O2 to -O1 to see if it fixes booting with systemd?

Regards,
Jonathan

#5 lore raw

Hi Jonathan

Your patch is fine on beaglebone black. At least it is possible to login. Thank you.

Regards,
Adrian

Quoted 34 lines · Jonathan Liu

Hi Adrian,

Quoted 26 lines · Adrian Freihofer

On Beaglebone-black Systemd 215 does not boot if compiled with -O2. Compiling with -O1 works.
2015-09-21 14:31 GMT+02:00 Jonathan Liu <[email protected]>:

Quoted 23 lines · Ross
Quoted 12 lines

Review

Quoted 3 lines · Jonathan Liu
(quoted diff) +1 -1
+FULL_OPTIMIZATION += "-fno-schedule-insns -fno-schedule
-insns2"

Are these bugs with the gcc optimisations or the systemd source code, and if its gcc's fault are the problematic optimisations specific to a particular architecture (such as ARM)? Just wondering if we can use overrides to only change the optimisations where they're a problem.

Quoted 1 line

Ross

I am not sure how to isolate if it's an issue in the systemd source code but the issue is not present when using GCC 4.9. Haven't checked if this is occuring on other architectures. Any feedback whether this occurs on other platforms (Raspberry Pi 2 is ARMv7) is welcome.

Regards,
Jonathan

Can you try the patch instead of changing -O2 to -O1 to see if it fixes booting with systemd?

Regards,
Jonathan

#6 lore raw
In reply to Jonathan Liu

Please make it arm specific

Quoted 37 lines · Jonathan Liu

This fixes systemd failing to start on Raspberry Pi 2 if it is compiled with GCC 5.2.

It would try to start "Journal Service" and "udev Kernel Device Manager" but fail repeatedly.

[YOCTO #8291]

---
 meta/recipes-core/systemd/systemd_225.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-core/systemd/systemd_225.bb +3 -1
index f7d4c7d..4a19ff4 100644
@@ -123,6 +123,9 @@ EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
 # uclibc does not have NSS
 EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
 
+# disable problematic GCC 5.2 optimizations [YOCTO #8291]
+FULL_OPTIMIZATION += "-fno-schedule-insns -fno-schedule-insns2"
+
 do_configure_prepend() {
        export NM="${HOST_PREFIX}gcc-nm"
        export AR="${HOST_PREFIX}gcc-ar"
--

2.5.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#7 lore raw

Hi Khem,

Quoted 3 lines · Khem Raj

Please make it arm specific

I have sent V2 that only makes the change for arm.
Interestly, this issue doesn't appear for qemuarm (ARMv5) when running under qemu.

I am wondering if this issue affects platforms other than ARM on real boards depending on TUNE_FEATURES and TARGET_FPU.

Quoted 29 lines · On Sep 21, 2015 4:22 AM, "Jonathan Liu" <[email protected]…
    This fixes systemd failing to start on Raspberry Pi 2 if it is
    compiled
    with GCC 5.2.

    It would try to start "Journal Service" and "udev Kernel Device
    Manager"
    but fail repeatedly.

    [YOCTO #8291]

    Signed-off-by: Jonathan Liu <[email protected]
    <mailto:[email protected]>>
    ---
     meta/recipes-core/systemd/systemd_225.bb <http://systemd_225.bb>
    | 3 +++
     1 file changed, 3 insertions(+)

    diff --git a/meta/recipes-core/systemd/systemd_225.bb
    <http://systemd_225.bb> b/meta/recipes-core/systemd/systemd_225.bb
    <http://systemd_225.bb>
    index f7d4c7d..4a19ff4 100644
    --- a/meta/recipes-core/systemd/systemd_225.bb <http://systemd_225.bb>
    +++ b/meta/recipes-core/systemd/systemd_225.bb <http://systemd_225.bb>
    @@ -123,6 +123,9 @@ EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
     # uclibc does not have NSS
     EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
Quoted 9 lines
    +# disable problematic GCC 5.2 optimizations [YOCTO #8291]
    +FULL_OPTIMIZATION += "-fno-schedule-insns -fno-schedule-insns2"
    +
     do_configure_prepend() {
            export NM="${HOST_PREFIX}gcc-nm"
            export AR="${HOST_PREFIX}gcc-ar"
    --
    2.5.0<http://lists.openembedded.org/mailman/listinfo/openembedded-core>

Regards,
Jonathan