Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libxshmfence can not be built on rv32 #201

Closed
geonheec opened this issue Jan 25, 2020 · 4 comments · Fixed by #205
Closed

libxshmfence can not be built on rv32 #201

geonheec opened this issue Jan 25, 2020 · 4 comments · Fixed by #205
Assignees
Labels
bug Something isn't working

Comments

@geonheec
Copy link

geonheec commented Jan 25, 2020

Hi, I want to install vim in my qemuriscv32 machine.
I already asked about it and got the answer.
I added IMAGE_INSTALL_append = " vim" in local.conf, but the following error is appeared.

ERROR: libxshmfence-1.3-r0 do_compile: oe_runmake failed
ERROR: libxshmfence-1.3-r0 do_compile: Execution of '/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/temp/run.do_compile.1897' failed with exit code 1:
make  all-recursive
make[1]: Entering directory '/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/build'
Making all in src
make[2]: Entering directory '/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/build/src'
../riscv32-oe-linux-libtool  --tag=CC   --mode=compile riscv32-oe-linux-gcc    -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../libxshmfence-1.3/src -I..    -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0=/usr/src/debug/libxshmfence/1.3-r0                      -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0=/usr/src/debug/libxshmfence/1.3-r0                      -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot-native=   -fvisibility=hidden -c -o xshmfence_alloc.lo ../../libxshmfence-1.3/src/xshmfence_alloc.c
../riscv32-oe-linux-libtool  --tag=CC   --mode=compile riscv32-oe-linux-gcc    -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../libxshmfence-1.3/src -I..    -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0=/usr/src/debug/libxshmfence/1.3-r0                      -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0=/usr/src/debug/libxshmfence/1.3-r0                      -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot-native=   -fvisibility=hidden -c -o xshmfence_futex.lo ../../libxshmfence-1.3/src/xshmfence_futex.c
riscv32-oe-linux-libtool: compile:  riscv32-oe-linux-gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../libxshmfence-1.3/src -I.. -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0=/usr/src/debug/libxshmfence/1.3-r0 -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0=/usr/src/debug/libxshmfence/1.3-r0 -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot= -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot-native= -fvisibility=hidden -c ../../libxshmfence-1.3/src/xshmfence_alloc.c  -fPIC -DPIC -o .libs/xshmfence_alloc.o
riscv32-oe-linux-libtool: compile:  riscv32-oe-linux-gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../libxshmfence-1.3/src -I.. -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0=/usr/src/debug/libxshmfence/1.3-r0 -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0=/usr/src/debug/libxshmfence/1.3-r0 -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot= -fdebug-prefix-map=/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot-native= -fvisibility=hidden -c ../../libxshmfence-1.3/src/xshmfence_futex.c  -fPIC -DPIC -o .libs/xshmfence_futex.o
In file included from ../../libxshmfence-1.3/src/xshmfenceint.h:32,
                 from ../../libxshmfence-1.3/src/xshmfence_alloc.c:27:
../../libxshmfence-1.3/src/xshmfence_futex.h: In function 'sys_futex':
../../libxshmfence-1.3/src/xshmfence_futex.h:58:17: error: 'SYS_futex' undeclared (first use in this function); did you mean 'sys_futex'?
   58 |  return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
      |                 ^~~~~~~~~
      |                 sys_futex
../../libxshmfence-1.3/src/xshmfence_futex.h:58:17: note: each undeclared identifier is reported only once for each function it appears in
../../libxshmfence-1.3/src/xshmfence_alloc.c: At top level:
../../libxshmfence-1.3/src/xshmfence_alloc.c:51: warning: "MFD_CLOEXEC" redefined
   51 | #define MFD_CLOEXEC  0x0001U
      |
In file included from /home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot/usr/include/bits/mman-linux.h:113,
                 from /home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot/usr/include/bits/mman.h:32,
                 from /home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot/usr/include/sys/mman.h:41,
                 from ../../libxshmfence-1.3/src/xshmfenceint.h:28,
                 from ../../libxshmfence-1.3/src/xshmfence_alloc.c:27:
/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot/usr/include/bits/mman-shared.h:30: note: this is the location of the previous definition
   30 | #  define MFD_CLOEXEC 1U
      |
../../libxshmfence-1.3/src/xshmfence_alloc.c:52: warning: "MFD_ALLOW_SEALING" redefined
   52 | #define MFD_ALLOW_SEALING 0x0002U
      |
In file included from /home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot/usr/include/bits/mman-linux.h:113,
                 from /home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot/usr/include/bits/mman.h:32,
                 from /home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot/usr/include/sys/mman.h:41,
                 from ../../libxshmfence-1.3/src/xshmfenceint.h:28,
                 from ../../libxshmfence-1.3/src/xshmfence_alloc.c:27:
/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/recipe-sysroot/usr/include/bits/mman-shared.h:31: note: this is the location of the previous definition
   31 | #  define MFD_ALLOW_SEALING 2U
      |
Makefile:482: recipe for target 'xshmfence_alloc.lo' failed
make[2]: *** [xshmfence_alloc.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../libxshmfence-1.3/src/xshmfenceint.h:32,
                 from ../../libxshmfence-1.3/src/xshmfence_futex.c:27:
../../libxshmfence-1.3/src/xshmfence_futex.h: In function 'sys_futex':
../../libxshmfence-1.3/src/xshmfence_futex.h:58:17: error: 'SYS_futex' undeclared (first use in this function); did you mean 'sys_futex'?
   58 |  return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
      |                 ^~~~~~~~~
      |                 sys_futex
../../libxshmfence-1.3/src/xshmfence_futex.h:58:17: note: each undeclared identifier is reported only once for each function it appears in
../../libxshmfence-1.3/src/xshmfence_futex.h:59:1: error: control reaches end of non-void function [-Werror=return-type]
   59 | }
      | ^
cc1: some warnings being treated as errors
Makefile:482: recipe for target 'xshmfence_futex.lo' failed
make[2]: *** [xshmfence_futex.lo] Error 1
make[2]: Leaving directory '/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/build/src'
Makefile:496: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/build'
Makefile:405: recipe for target 'all' failed
make: *** [all] Error 2
WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in: /home/ca2020/riscv-yocto/build/tmp-glibc/work/riscv32-oe-linux/libxshmfence/1.3-r0/temp/log.do_compile.1897

ERROR: Task (/home/ca2020/riscv-yocto/openembedded-core/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb:do_compile) failed with exit code '1'

How can I solve this problem?

@kraj
Copy link
Collaborator

kraj commented Jan 25, 2020

I think this is due to discrepency between glibc and kernel syscall understanding. @alistair23 I have replied to relevant patch that is on glibc mailing list to pin this issue.

@kraj kraj changed the title vim cannot be installed libxshmfence can not be built on rv32 Jan 25, 2020
@kraj kraj added the bug Something isn't working label Jan 26, 2020
@geonheec
Copy link
Author

May I ask when the bug will be fixed?

@kraj
Copy link
Collaborator

kraj commented Jan 30, 2020

May I ask when the bug will be fixed?

I think a workaround might be to define SYS_futex locally in term of 64bit futex call in libxshmfence package, but there might be more packages in same boat.

@alistair23
Copy link
Collaborator

I have fixed up the "core" packages, so I can build a full RV32 rootfs and upstreamed the changes. Any program that is doing it's own syscalls might need to be updated (based on the syscalls it's doing). I haven't looked into packages that I don't directly need yet. This could be a fairly complex change depending on the syscalls.

You can see the discussion here for more information about handling the syscall safely: https://patchwork.sourceware.org/patch/37316/

In this case you could probably get away with just adding a simple:

# ifndef __NR_futex
#  define __NR_futex __NR_futex_time64
# endif

for RISC-V

kraj added a commit to YoeDistro/meta-riscv that referenced this issue Jan 31, 2020
Helps these nosy apps build
Fixes riscv#201

Signed-off-by: Khem Raj <raj.khem@gmail.com>
@kraj kraj closed this as completed in #205 Feb 1, 2020
kraj added a commit that referenced this issue Feb 1, 2020
Helps these nosy apps build
Fixes #201

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants