Skip to contentSkip to conversation

glibc: Fix x32 make race

PATCH In review Richard Purdie 1 participant 2 messages May 13, 2015 – May 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 glibc: Fix x32 make race

On x32 builds, sysd-syscalls appears malformed since the make-target-directory appears on the wrong line. This causes races during the build process where you can see failures like:

Assembler messages:
Fatal error: can't create [...]glibc/2.21-r0/build-x86_64-poky-linux-gnux32/time/gettimeofday.os: No such file or directory Assembler messages:
Fatal error: can't create [...]glibc/2.21-r0/build-x86_64-poky-linux-gnux32/time/time.os: No such file or directory

The issue is that the carriage return is being escaped when it should not be. The change to sysd-syscalls with this change:

before:

"""

$(foreach p,$(sysd-rules-targets),$(objpfx)$(patsubst %,$p,time).os): \
                $(..)sysdeps/unix/make-syscalls.sh      $(make-target-directory)
        (echo '#include <dl-vdso.h>';

"""

after:

"""

$(foreach p,$(sysd-rules-targets),$(objpfx)$(patsubst %,$p,time).os): \
                $(..)sysdeps/unix/make-syscalls.sh
        $(make-target-directory)
        (echo '#include <dl-vdso.h>';

"""

which ensures the target directory is correctly created. Only x32 uses the vdso code which contains the bug which is why the error only really appears on x32.

meta/recipes-core/glibc/glibc/makesyscall.patch new file +48 -0
new file mode 100644
index 0000000..9afb75e
@@ -0,0 +1,48 @@
+On x32 builds, sysd-syscalls appears malformed since the make-target-directory
+appears on the wrong line. This causes races during the build process where you can
+see failures like:
+
+Assembler messages:
+Fatal error: can't create [...]glibc/2.21-r0/build-x86_64-poky-linux-gnux32/time/gettimeofday.os: No such file or directory
+Assembler messages:
+Fatal error: can't create [...]glibc/2.21-r0/build-x86_64-poky-linux-gnux32/time/time.os: No such file or directory
+
+The isue is that the carridge return is being escaped when it should 
+not be. The change to sysd-syscalls with this change:
+
+before:
+
+"""
+$(foreach p,$(sysd-rules-targets),$(objpfx)$(patsubst %,$p,time).os): \
+                $(..)sysdeps/unix/make-syscalls.sh      $(make-target-directory)
+        (echo '#include <dl-vdso.h>'; 
+"""
+
+after:
+
+"""
+$(foreach p,$(sysd-rules-targets),$(objpfx)$(patsubst %,$p,time).os): \
+                $(..)sysdeps/unix/make-syscalls.sh
+        $(make-target-directory)
+        (echo '#include <dl-vdso.h>'; 
+"""
+
+which ensures the target directory is correctly created. Only x32 uses the vdso 
+code which contains the bug which is why the error only really appears on x32.
+
+Upstream-Status: Pending
+RP 2015/5/13
+
+Index: git/sysdeps/unix/make-syscalls.sh
+===================================================================
+--- git.orig/sysdeps/unix/make-syscalls.sh
++++ git/sysdeps/unix/make-syscalls.sh
+@@ -278,7 +278,7 @@ while read file srcfile caller syscall a
+     vdso_symver=`echo "$vdso_symver" | sed 's/\./_/g'`
+     echo "\
+ \$(foreach p,\$(sysd-rules-targets),\$(objpfx)\$(patsubst %,\$p,$file).os): \\
+-		\$(..)sysdeps/unix/make-syscalls.sh\
++		\$(..)sysdeps/unix/make-syscalls.sh
+ 	\$(make-target-directory)
+ 	(echo '#include <dl-vdso.h>'; \\
+ 	 echo 'extern void *${strong}_ifunc (void) __asm (\"${strong}\");'; \\
meta/recipes-core/glibc/glibc_2.21.bb +1 -0
index 58a9601..ac8e8f8 100644
@@ -26,6 +26,7 @@ SRC_URI = "git://sourceware.org/git/glibc.git;branch=${BRANCH} \
            file://0001-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch \
            file://0001-yes-within-the-path-sets-wrong-config-variables.patch \
            file://elf-Makefile-fix-a-typo.patch \
+           file://makesyscall.patch \
            ${EGLIBCPATCHES} \
           "
 EGLIBCPATCHES = "\
#1 lore raw
Quoted 2 lines · Richard Purdie

On x32 builds, sysd-syscalls appears malformed since the make-target-directory appears on the wrong line.

This patch merged into glibc upstream so I updated the patch to mark as a backport with links to the commit and bug ID.

Cheers,

Richard