Skip to contentSkip to conversation

grub-efi-native: workaround for fedora 29

PATCH Superseded [email protected] 2 participants 4 messages Dec 19, 2018 – Dec 20, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover grub-efi-native: workaround for fedora 29

From: Kai Kang <[email protected]>

Steps:
1 docker pull fedora 29 image
2 run image with mount /tmp with tmpfs

$ docker run -it --mount type=tmpfs,destination=/tmp fedora:29 /bin/bash

3 check inode of /dev/null

$ stat -c %i /dev/null
6

and then create files under /tmp and make the biggest inode of files is 5.

$ stat -c %i `ls -t /tmp/* | head -1`
5

3 prepare and run

$ bitbake grub-efi-native -c configure

The following changes since commit fef47bd915f6a3960e512b5aba8b461b77a9ea78:

linux-yocto-4.14: Drop bbappend (2018-12-18 16:20:10 +0000)

are available in the Git repository at:

git://git.pokylinux.org/poky-contrib kangkai/grub-efi-native-fedora29
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/grub-efi-native-fedora29

Kai Kang (1):
grub-efi-native: workaround for fedora 29

 ...workaround-for-as-from-binutils-2.31.patch | 37 +++++++++++++++++++
 meta/recipes-bsp/grub/grub-efi_2.02.bb        |  2 +
 2 files changed, 39 insertions(+)
 create mode 100644 meta/recipes-bsp/grub/files/workaround-for-as-from-binutils-2.31.patch

--
2.19.0.rc2

#1 lore raw

PATCH 1/1 grub-efi-native: workaround for fedora 29

From: Kai Kang <[email protected]>

grub-efi-native fails to run do_configure on Fedora 29 host:

| checking for options to compile assembly...
| Assembler messages:
| Fatal error: The input and output files must be distinct

because the host 'as' in binutils-3.31 breaks if using two filesystems. See:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=2a50366

Work-around this issue by forcing the configure time assembler check to use a temp file in the src dir.

---
 ...workaround-for-as-from-binutils-2.31.patch | 37 +++++++++++++++++++
 meta/recipes-bsp/grub/grub-efi_2.02.bb        |  2 +
 2 files changed, 39 insertions(+)
 create mode 100644 meta/recipes-bsp/grub/files/workaround-for-as-from-binutils-2.31.patch
meta/recipes-bsp/grub/files/workaround-for-as-from-binutils-2.31.patch new file +37 -0
new file mode 100644
index 0000000000..b01f17cf1a
@@ -0,0 +1,37 @@
+When /dev and $srcdir are not in a same file system, it may trigger a flaw of
+binutils 2.31 and cause grub-efi-native configure error:
+
+| checking for options to compile assembly...
+| Assembler messages:
+| Fatal error: The input and output files must be distinct
+
+Replace /dev/null with a temporary file during assemble check to avoid such
+failure.
+
+Upstream-Status: Inappropriate [native]
+
+Signed-off-by: Kai Kang <[email protected]>
+
+diff --git a/configure.ac b/configure.ac
+index 44a67a7..6eb28fe 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -696,8 +696,9 @@ if test x"$test_program" = x ; then
+   grub_cv_cc_target_asm_compile=
+ else
+   found=no
++  tmpfile="$(mktemp $srcdir/asm-tests/XXXXXX)"
+   for arg in "" "-no-integrated-as"; do
+-    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
++    cmdline="$TARGET_CC -c -o $tmpfile $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
+     echo "Running $cmdline" >&AS_MESSAGE_LOG_FD
+     if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
+       grub_cv_cc_target_asm_compile="$arg"
+@@ -705,6 +706,7 @@ else
+       break
+     fi
+   done
++  rm -f $tmpfile
+   if test x"$found" = xno ; then
+     AC_MSG_ERROR([could not compile assembly])
+   fi
meta/recipes-bsp/grub/grub-efi_2.02.bb +2 -0
index 14fce97ff0..fc91864421 100644
@@ -9,6 +9,8 @@ SRC_URI += " \
            file://cfg \
           "
 
+SRC_URI_append_class-native = " file://workaround-for-as-from-binutils-2.31.patch"
+
 S = "${WORKDIR}/grub-${PV}"
 
 # Determine the target arch for the grub modules
Signature · 1 line
2.19.0.rc2
#2 lore raw
Quoted 1 line · On Wed, 19 Dec 2018 at 07:43, <[email protected]> wrote:

+Upstream-Status: Inappropriate [native]

If we're going to mark this as inappropriate then please make it clear in the patch that its a workaround for a specific binutils and when that stops being used we can remove it. However isn't this a problem when building grub on F29, even outside of Yocto? If so then it's not inappropriate, it's an upstream bug and they should have the fix.

Ross

author
#3 lore raw
Quoted 5 lines · Ross
Quoted 1 line · On Wed, 19 Dec 2018 at 07:43, <[email protected]> wrote:

+Upstream-Status: Inappropriate [native]

If we're going to mark this as inappropriate then please make it clear in the patch that its a workaround for a specific binutils and when that stops being used we can remove it.

binutils version has been addressed in the patch. I'll update with workaround info.

Quoted 3 lines

However isn't this a problem
when building grub on F29, even outside of Yocto? If so then it's not inappropriate, it's an upstream bug and they should have the fix.

It is native build related, so grub is not affected that no grub-native is provided. I have created a defect on RedHat bugzilla:

https://bugzilla.redhat.com/show_bug.cgi?id=1660279

Regards,
Kai

Quoted 3 lines

Ross

Signature · 1 line
Kai Kang