Bug#995187: qtwebengine-opensource-src FTBFS on mips*: unistd_nr_{n32,n64,o32}.h no linger exported by the kernel

2021-09-29 Thread Dmitry Shachnev
On Wed, Sep 29, 2021 at 08:03:37PM +0800, YunQiang Su wrote:
> The 999u is due to that:
> #if _MIPS_SIM == _MIPS_SIM_ABI32
> #define __NR_Linux  4000
> #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
> #if _MIPS_SIM == _MIPS_SIM_ABI64
> #define __NR_Linux  5000
> #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
> #if _MIPS_SIM == _MIPS_SIM_NABI32
> #define __NR_Linux  6000
> #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
>
> The o32/n64/n32 ABI is just from 4000/5000/6000.
>
> In the previous version of Linux kernel, it expose
>  __NR_64_Linux_syscalls
>  __NR_32_Linux_syscalls
>  __NR_N32_Linux_syscalls
> for the real number of syscalls for the given Linux version.
> While now, these macro has been tread as kernel internal values,
> and cannot be get in userland.
>
> Since 4000/5000/6000, ≥ will be impossbile without huge rework for kernel.

Thanks for the explanation! I added your patch and uploaded new version,
let's see how it goes.

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#995187: qtwebengine-opensource-src FTBFS on mips*: unistd_nr_{n32,n64,o32}.h no linger exported by the kernel

2021-09-29 Thread YunQiang Su
Dmitry Shachnev  于2021年9月29日周三 下午7:47写道:
>
> Hi YunQiang!
>
> On Wed, Sep 29, 2021 at 09:09:46AM +0800, YunQiang Su wrote:
> > Ohh, the new mips linux kernel removes some macros: so now we can use
> > the same code as x86:
>
> Thank you for the patch! What I don’t like is hard-coding of 999u.
>

The 999u is due to that:
#if _MIPS_SIM == _MIPS_SIM_ABI32
#define __NR_Linux  4000
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
#if _MIPS_SIM == _MIPS_SIM_ABI64
#define __NR_Linux  5000
#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
#if _MIPS_SIM == _MIPS_SIM_NABI32
#define __NR_Linux  6000
#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */

The o32/n64/n32 ABI is just from 4000/5000/6000.

> Do you know what is the actual number of syscalls? Is there a probability
> that it will be ≥ 1000 in the future?
>

In the previous version of Linux kernel, it expose
 __NR_64_Linux_syscalls
 __NR_32_Linux_syscalls
 __NR_N32_Linux_syscalls
for the real number of syscalls for the given Linux version.
While now, these macro has been tread as kernel internal values,
and cannot be get in userland.

Since 4000/5000/6000, ≥ will be impossbile without huge rework for kernel.

> --
> Dmitry Shachnev



-- 
YunQiang Su



Bug#995187: qtwebengine-opensource-src FTBFS on mips*: unistd_nr_{n32,n64,o32}.h no linger exported by the kernel

2021-09-29 Thread Dmitry Shachnev
Hi YunQiang!

On Wed, Sep 29, 2021 at 09:09:46AM +0800, YunQiang Su wrote:
> Ohh, the new mips linux kernel removes some macros: so now we can use
> the same code as x86:

Thank you for the patch! What I don’t like is hard-coding of 999u.

Do you know what is the actual number of syscalls? Is there a probability
that it will be ≥ 1000 in the future?

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#995187: qtwebengine-opensource-src FTBFS on mips*: unistd_nr_{n32,n64,o32}.h no linger exported by the kernel

2021-09-28 Thread YunQiang Su
YunQiang Su  于2021年9月28日周二 下午12:20写道:
>
> Adrian Bunk  于2021年9月28日周二 上午12:06写道:
> >
> > Source: qtwebengine-opensource-src
> > Version: 5.15.5+dfsg-2
> > Severity: serious
> > Tags: ftbfs
> >
> > https://buildd.debian.org/status/fetch.php?pkg=qtwebengine-opensource-src=mips64el=5.15.6%2Bdfsg-1=1632387575=0
> >
> > ...
> > FAILED: obj/sandbox/linux/seccomp_bpf/syscall_set.o
> > /usr/bin/g++ -MMD -MF obj/sandbox/linux/seccomp_bpf/syscall_set.o.d 
> > -DSANDBOX_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 
> > -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 
> > -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES 
> > -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND 
> > -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DOPENSSL_NO_ASM -Igen 
> > -I../../3rdparty/chromium 
> > -I../../3rdparty/chromium/third_party/perfetto/include 
> > -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen 
> > -Igen -Igen -Igen -I../../3rdparty/chromium/third_party/abseil-cpp 
> > -I../../3rdparty/chromium/third_party/boringssl/src/include 
> > -I../../3rdparty/chromium/third_party/protobuf/src -Igen/protoc_out 
> > -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector 
> > -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread 
> > -D__SANE_USERSPACE_TYPES__ -mips64r2 -Wa,-mips64r2 -Wall -U_FORTIFY_SOURCE 
> > -D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized 
> > -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments 
> > -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers 
> > -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections 
> > -fno-omit-frame-pointer -g0 -fvisibility=hidden -std=gnu++14 -Wno-narrowing 
> > -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess 
> > -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type 
> > -Wno-deprecated-copy -fno-exceptions -fno-rtti -fvisibility-inlines-hidden 
> > -c ../../3rdparty/chromium/sandbox/linux/bpf_dsl/syscall_set.cc -o 
> > obj/sandbox/linux/seccomp_bpf/syscall_set.o
> > In file included from 
> > ../../3rdparty/chromium/sandbox/linux/bpf_dsl/syscall_set.cc:12:
> > ../../3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h:47:10: 
> > fatal error: asm/unistd_nr_n64.h: No such file or directory
> >47 | #include   // for __NR_64_Linux and 
> > __NR_64_Linux_syscalls
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ccb21774863add648e709337919d2cfeefe4be49
> This commit change the struct of unistd*.h files.
> And I guess that we can just drop mipsel-linux-5.patch now.
> I am testing it.
>

Ohh, the new mips linux kernel removes some macros: so now we can use
the same code as x86:

Index: 
qtwebengine-opensource-src-5.15.6+dfsg/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
===
--- 
qtwebengine-opensource-src-5.15.6+dfsg.orig/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
+++ 
qtwebengine-opensource-src-5.15.6+dfsg/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
@@ -35,18 +35,11 @@
 #define MIN_GHOST_SYSCALL   (MIN_PRIVATE_SYSCALL + 0xfff0u)
 #define MAX_SYSCALL (MIN_GHOST_SYSCALL + 4u)

-#elif defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)
+#elif defined(ARCH_CPU_MIPS_FAMILY)

-#include   // for __NR_O32_Linux and __NR_Linux_syscalls
-#define MIN_SYSCALL __NR_O32_Linux
-#define MAX_PUBLIC_SYSCALL  (MIN_SYSCALL + __NR_Linux_syscalls)
-#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-
-#elif defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)
-
-#include   // for __NR_64_Linux and __NR_64_Linux_syscalls
-#define MIN_SYSCALL __NR_64_Linux
-#define MAX_PUBLIC_SYSCALL  (MIN_SYSCALL + __NR_64_Linux_syscalls)
+#include 
+#define MIN_SYSCALL __NR_Linux
+#define MAX_PUBLIC_SYSCALL  (MIN_SYSCALL + 999u)
 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL

 #elif defined(__aarch64__)

>
> >   |  ^
> > compilation terminated.
> > ...
> >
> >
> > Context:
> > https://sources.debian.org/src/qtwebengine-opensource-src/5.15.6+dfsg-1/debian/patches/mipsel-linux-5.patch/
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ccb21774863a
> >
>
>
> --
> YunQiang Su



-- 
YunQiang Su



Bug#995187: qtwebengine-opensource-src FTBFS on mips*: unistd_nr_{n32,n64,o32}.h no linger exported by the kernel

2021-09-28 Thread YunQiang Su
Adrian Bunk  于2021年9月28日周二 上午12:06写道:
>
> Source: qtwebengine-opensource-src
> Version: 5.15.5+dfsg-2
> Severity: serious
> Tags: ftbfs
>
> https://buildd.debian.org/status/fetch.php?pkg=qtwebengine-opensource-src=mips64el=5.15.6%2Bdfsg-1=1632387575=0
>
> ...
> FAILED: obj/sandbox/linux/seccomp_bpf/syscall_set.o
> /usr/bin/g++ -MMD -MF obj/sandbox/linux/seccomp_bpf/syscall_set.o.d 
> -DSANDBOX_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 
> -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 
> -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES 
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND 
> -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DOPENSSL_NO_ASM -Igen 
> -I../../3rdparty/chromium 
> -I../../3rdparty/chromium/third_party/perfetto/include 
> -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen 
> -Igen -Igen -Igen -I../../3rdparty/chromium/third_party/abseil-cpp 
> -I../../3rdparty/chromium/third_party/boringssl/src/include 
> -I../../3rdparty/chromium/third_party/protobuf/src -Igen/protoc_out 
> -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector 
> -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread 
> -D__SANE_USERSPACE_TYPES__ -mips64r2 -Wa,-mips64r2 -Wall -U_FORTIFY_SOURCE 
> -D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized 
> -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments 
> -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers 
> -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections 
> -fno-omit-frame-pointer -g0 -fvisibility=hidden -std=gnu++14 -Wno-narrowing 
> -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess 
> -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type 
> -Wno-deprecated-copy -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c 
> ../../3rdparty/chromium/sandbox/linux/bpf_dsl/syscall_set.cc -o 
> obj/sandbox/linux/seccomp_bpf/syscall_set.o
> In file included from 
> ../../3rdparty/chromium/sandbox/linux/bpf_dsl/syscall_set.cc:12:
> ../../3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h:47:10: 
> fatal error: asm/unistd_nr_n64.h: No such file or directory
>47 | #include   // for __NR_64_Linux and 
> __NR_64_Linux_syscalls

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ccb21774863add648e709337919d2cfeefe4be49
This commit change the struct of unistd*.h files.
And I guess that we can just drop mipsel-linux-5.patch now.
I am testing it.


>   |  ^
> compilation terminated.
> ...
>
>
> Context:
> https://sources.debian.org/src/qtwebengine-opensource-src/5.15.6+dfsg-1/debian/patches/mipsel-linux-5.patch/
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ccb21774863a
>


-- 
YunQiang Su



Bug#995187: qtwebengine-opensource-src FTBFS on mips*: unistd_nr_{n32,n64,o32}.h no linger exported by the kernel

2021-09-27 Thread Adrian Bunk
Source: qtwebengine-opensource-src
Version: 5.15.5+dfsg-2
Severity: serious
Tags: ftbfs

https://buildd.debian.org/status/fetch.php?pkg=qtwebengine-opensource-src=mips64el=5.15.6%2Bdfsg-1=1632387575=0

...
FAILED: obj/sandbox/linux/seccomp_bpf/syscall_set.o
/usr/bin/g++ -MMD -MF obj/sandbox/linux/seccomp_bpf/syscall_set.o.d 
-DSANDBOX_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 
-DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND 
-DDYNAMIC_ANNOTATIONS_ENABLED=0 -DOPENSSL_NO_ASM -Igen 
-I../../3rdparty/chromium 
-I../../3rdparty/chromium/third_party/perfetto/include 
-Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen -Igen 
-Igen -Igen -I../../3rdparty/chromium/third_party/abseil-cpp 
-I../../3rdparty/chromium/third_party/boringssl/src/include 
-I../../3rdparty/chromium/third_party/protobuf/src -Igen/protoc_out 
-fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector 
-fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread 
-D__SANE_USERSPACE_TYPES__ -mips64r2 -Wa,-mips64r2 -Wall -U_FORTIFY_SOURCE 
-D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized 
-Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments 
-Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers 
-Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections 
-fno-omit-frame-pointer -g0 -fvisibility=hidden -std=gnu++14 -Wno-narrowing 
-Wno-class-memaccess -Wno-attributes -Wno-class-memaccess 
-Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type 
-Wno-deprecated-copy -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c 
../../3rdparty/chromium/sandbox/linux/bpf_dsl/syscall_set.cc -o 
obj/sandbox/linux/seccomp_bpf/syscall_set.o
In file included from 
../../3rdparty/chromium/sandbox/linux/bpf_dsl/syscall_set.cc:12:
../../3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h:47:10: 
fatal error: asm/unistd_nr_n64.h: No such file or directory
   47 | #include   // for __NR_64_Linux and 
__NR_64_Linux_syscalls
  |  ^
compilation terminated.
...


Context:
https://sources.debian.org/src/qtwebengine-opensource-src/5.15.6+dfsg-1/debian/patches/mipsel-linux-5.patch/
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ccb21774863a