Skip to contentSkip to conversation

grub: add -Wno-error=trampolines to native CFLAGS

PATCH Superseded Randle, William C 4 participants 6 messages Mar 18, 2016 – Jun 27, 2016

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 grub: add -Wno-error=trampolines to native CFLAGS

Previous patch was not against master. Updated against master branch.

Fixes YOCTO 9201
Adds -Wno-error=trampolines to native CFLAGS prevent multiple compile errors when using gcc 5.3.0 for gentoo.

---
 meta/recipes-bsp/grub/grub-efi_2.00.bb | 4 ++++

 1 file changed, 4 insertions(+)
meta/recipes-bsp/grub/grub-efi_2.00.bb +0 -0
index 4e80e18..ca73234 100644
@@ -35,6 +35,10 @@ EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \


 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile ac_cv_sizeof_off_t=8', '--disable-largefile', d)}"
+# ldm.c:114:7: error: trampoline generated for nested function 'hook' [-Werror=trampolines]
+# and many other places in the grub code when compiled with some native gcc 5.3 compilers
+CFLAGS_append_class-native = " -Wno-error=trampolines"
+
 do_install_class-native() {
    install -d ${D}${bindir}
    install -m 755 grub-mkimage ${D}${bindir}
--
2.5.0

#1 lore raw
Quoted 27 lines · William C

Previous patch was not against master. Updated against master branch.

Fixes YOCTO 9201
Adds -Wno-error=trampolines to native CFLAGS prevent multiple compile errors when using gcc 5.3.0 for gentoo.

---
  meta/recipes-bsp/grub/grub-efi_2.00.bb | 4 ++++
  1 file changed, 4 insertions(+)
meta/recipes-bsp/grub/grub-efi_2.00.bb +4 -1
index 4e80e18..ca73234 100644
@@ -35,6 +35,10 @@ EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
 
  EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile ac_cv_sizeof_off_t=8', '--disable-largefile', d)}"
 
+# ldm.c:114:7: error: trampoline generated for nested function 'hook' [-Werror=trampolines]
+# and many other places in the grub code when compiled with some native gcc 5.3 compilers
+CFLAGS_append_class-native = " -Wno-error=trampolines"
+
  do_install_class-native() {
     install -d ${D}${bindir}
     install -m 755 grub-mkimage ${D}${bindir}
--
Quoted 1 line

2.5.0

I'm a gentoo user and I have the trampoline issue with gcc 4.9.3. I just tested this patch in gentoo and it works, I can remove my bbappend file from my personal layer!

Mariano

#2 lore raw
In reply to Randle, William C

Hi,

Is the error still there for gcc6 without this option for CFLAGS? The problem is that gcc on some old hosts don't support this option.

Best Regards,
Chen Qi

Quoted 28 lines · William C

Previous patch was not against master. Updated against master branch.

Fixes YOCTO 9201
Adds -Wno-error=trampolines to native CFLAGS prevent multiple compile errors when using gcc 5.3.0 for gentoo.

---
  meta/recipes-bsp/grub/grub-efi_2.00.bb | 4 ++++
  1 file changed, 4 insertions(+)
meta/recipes-bsp/grub/grub-efi_2.00.bb +4 -1
index 4e80e18..ca73234 100644
@@ -35,6 +35,10 @@ EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
 
  EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile ac_cv_sizeof_off_t=8', '--disable-largefile', d)}"
 
+# ldm.c:114:7: error: trampoline generated for nested function 'hook' [-Werror=trampolines]
+# and many other places in the grub code when compiled with some native gcc 5.3 compilers
+CFLAGS_append_class-native = " -Wno-error=trampolines"
+
  do_install_class-native() {
     install -d ${D}${bindir}
     install -m 755 grub-mkimage ${D}${bindir}
--

2.5.0

#3 lore raw
Quoted 4 lines · ChenQi

Hi,

Is the error still there for gcc6 without this option for CFLAGS? The problem is that gcc on some old hosts don't support this option.

how old is the host. We should start recommending minimum required GCC version on build host.
Sometimes a newer gcc is available for older distros too as alternative package.

Quoted 44 lines

Best Regards,
Chen Qi

Quoted 31 lines · William C

Previous patch was not against master. Updated against master branch.

Fixes YOCTO 9201
Adds -Wno-error=trampolines to native CFLAGS prevent multiple compile errors when using gcc 5.3.0 for gentoo.

---
  meta/recipes-bsp/grub/grub-efi_2.00.bb | 4 ++++
  1 file changed, 4 insertions(+)
meta/recipes-bsp/grub/grub-efi_2.00.bb +0 -1
index 4e80e18..ca73234 100644
@@ -35,6 +35,10 @@ EXTRA_OECONF = "--with-platform=efi
--disable-grub-mkfont \
    EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile',

'--enable-largefile ac_cv_sizeof_off_t=8', '--disable-largefile', d)}"
+# ldm.c:114:7: error: trampoline generated for nested function 'hook'
[-Werror=trampolines]
+# and many other places in the grub code when compiled with some native gcc 5.3 compilers

meta/recipes-bsp/grub/grub-efi_2.00.bb +2 -1
+CFLAGS_append_class-native = " -Wno-error=trampolines"
+
  do_install_class-native() {
     install -d ${D}${bindir}
     install -m 755 grub-mkimage ${D}${bindir}
--
Quoted 1 line

2.5.0

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

#4 lore raw
Quoted 8 lines · Khem Raj
Quoted 4 lines · ChenQi

Hi,

Is the error still there for gcc6 without this option for CFLAGS? The problem is that gcc on some old hosts don't support this option.

how old is the host. We should start recommending minimum required GCC version on build host.
Sometimes a newer gcc is available for older distros too as alternative package.

That is centos6.

Best Regards,
Chen Qi

Quoted 41 lines
Quoted 41 lines

Best Regards,
Chen Qi

Quoted 30 lines · William C

Previous patch was not against master. Updated against master branch.

Fixes YOCTO 9201
Adds -Wno-error=trampolines to native CFLAGS prevent multiple compile errors when using gcc 5.3.0 for gentoo.

---
   meta/recipes-bsp/grub/grub-efi_2.00.bb | 4 ++++
   1 file changed, 4 insertions(+)
meta/recipes-bsp/grub/grub-efi_2.00.bb +0 -1
index 4e80e18..ca73234 100644
@@ -35,6 +35,10 @@ EXTRA_OECONF = "--with-platform=efi
--disable-grub-mkfont \
     EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile',

'--enable-largefile ac_cv_sizeof_off_t=8', '--disable-largefile', d)}"
+# ldm.c:114:7: error: trampoline generated for nested function 'hook'
[-Werror=trampolines]
+# and many other places in the grub code when compiled with some native gcc 5.3 compilers

meta/recipes-bsp/grub/grub-efi_2.00.bb +2 -1
+CFLAGS_append_class-native = " -Wno-error=trampolines"
+
   do_install_class-native() {
      install -d ${D}${bindir}
      install -m 755 grub-mkimage ${D}${bindir}
--
Quoted 1 line

2.5.0

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

#5 lore raw
Quoted 7 lines · ChenQi
Quoted 3 lines · Khem Raj
Quoted 2 lines · ChenQi

Hi,

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Is the error still there for gcc6 without this option for CFLAGS? The problem is that gcc on some old hosts don't support this option.

how old is the host. We should start recommending minimum required GCC version on build host.
Sometimes a newer gcc is available for older distros too as alternative package.

That is centos6.

we can recommend additional feeds for centos6 then ? something like

http://people.centos.org/tru/devtools-2

Which will make gcc 4.8 available for centos6 along with 4.4 which is the default

If one wants to use devtools-3 then they can get gcc-4.9 as well, however its only available for x86_64

Quoted 46 lines

Best Regards,
Chen Qi

Quoted 41 lines
Quoted 41 lines

Best Regards,
Chen Qi

Quoted 30 lines · William C

Previous patch was not against master. Updated against master branch.

Fixes YOCTO 9201
Adds -Wno-error=trampolines to native CFLAGS prevent multiple compile errors when using gcc 5.3.0 for gentoo.

---
  meta/recipes-bsp/grub/grub-efi_2.00.bb | 4 ++++
  1 file changed, 4 insertions(+)
meta/recipes-bsp/grub/grub-efi_2.00.bb +0 -1
index 4e80e18..ca73234 100644
@@ -35,6 +35,10 @@ EXTRA_OECONF = "--with-platform=efi
--disable-grub-mkfont \
    EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile',

'--enable-largefile ac_cv_sizeof_off_t=8', '--disable-largefile', d)}"
+# ldm.c:114:7: error: trampoline generated for nested function 'hook'
[-Werror=trampolines]
+# and many other places in the grub code when compiled with some native gcc 5.3 compilers

meta/recipes-bsp/grub/grub-efi_2.00.bb +2 -1
+CFLAGS_append_class-native = " -Wno-error=trampolines"
+
  do_install_class-native() {
     install -d ${D}${bindir}
     install -m 755 grub-mkimage ${D}${bindir}
--
Quoted 1 line

2.5.0

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