Re: [PATCH] config: Activate SECCOMP also on MIPS 64

2021-11-01 Thread Daniel Golle
On Mon, Nov 01, 2021 at 12:11:18PM -0700, Rosen Penev wrote:
> On Mon, Nov 1, 2021 at 10:05 AM Hauke Mehrtens  wrote:
> >
> > This activates SECCOMP also on mips64 and mips64el.
> >
> > This was working fine in a basic test in qemu.
> >
> > Signed-off-by: Hauke Mehrtens 
> > ---
> >
> > I only did very basic testing, why was this not activated in the beginning?
> >
> >
> >  config/Config-build.in | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/config/Config-build.in b/config/Config-build.in
> > index a028ebfbc37a..9bef36e53ea1 100644
> > --- a/config/Config-build.in
> > +++ b/config/Config-build.in
> > @@ -376,7 +376,7 @@ menu "Global build settings"
> > bool "Enable SECCOMP"
> > select KERNEL_SECCOMP
> > select PACKAGE_procd-seccomp
> > -   depends on (aarch64 || arm || armeb || mips || mipsel || 
> > i386 || powerpc || x86_64)
> > +   depends on (aarch64 || arm || armeb || mips || mipsel || 
> > mips64 || mips64el || i386 || powerpc || x86_64)
> this should be changed to !arc. It's the only platform with no support.

procd also still lacks support for seccomp on ppc64 (kernel support for
seccomp is present also for ppc64 though afaik).

Even though we don't have any PPC64 targets atm I believe it would be
better to explicitely list the supported architectures to avoid
misunderstandings in future.

RISC-V may also hit us in the near future which would then again need
editing there (as procd seccomp also lacks support for RISC-V).

Just my 2 cents...

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] config: Activate SECCOMP also on MIPS 64

2021-11-01 Thread Rosen Penev
On Mon, Nov 1, 2021 at 10:05 AM Hauke Mehrtens  wrote:
>
> This activates SECCOMP also on mips64 and mips64el.
>
> This was working fine in a basic test in qemu.
>
> Signed-off-by: Hauke Mehrtens 
> ---
>
> I only did very basic testing, why was this not activated in the beginning?
>
>
>  config/Config-build.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/config/Config-build.in b/config/Config-build.in
> index a028ebfbc37a..9bef36e53ea1 100644
> --- a/config/Config-build.in
> +++ b/config/Config-build.in
> @@ -376,7 +376,7 @@ menu "Global build settings"
> bool "Enable SECCOMP"
> select KERNEL_SECCOMP
> select PACKAGE_procd-seccomp
> -   depends on (aarch64 || arm || armeb || mips || mipsel || i386 
> || powerpc || x86_64)
> +   depends on (aarch64 || arm || armeb || mips || mipsel || 
> mips64 || mips64el || i386 || powerpc || x86_64)
this should be changed to !arc. It's the only platform with no support.
> depends on !TARGET_uml
> default y
> help
> --
> 2.30.2
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] config: Activate SECCOMP also on MIPS 64

2021-11-01 Thread Hauke Mehrtens
This activates SECCOMP also on mips64 and mips64el.

This was working fine in a basic test in qemu.

Signed-off-by: Hauke Mehrtens 
---

I only did very basic testing, why was this not activated in the beginning?


 config/Config-build.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index a028ebfbc37a..9bef36e53ea1 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -376,7 +376,7 @@ menu "Global build settings"
bool "Enable SECCOMP"
select KERNEL_SECCOMP
select PACKAGE_procd-seccomp
-   depends on (aarch64 || arm || armeb || mips || mipsel || i386 
|| powerpc || x86_64)
+   depends on (aarch64 || arm || armeb || mips || mipsel || mips64 
|| mips64el || i386 || powerpc || x86_64)
depends on !TARGET_uml
default y
help
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] toolchain: Allow sanitizer on mips and mipsel

2021-11-01 Thread Hauke Mehrtens
Support for libsanitizer on MIPS 32 and MIPSEL 32 was added with GCC 9.
MIPS 64 and ARC are still not supported.

Signed-off-by: Hauke Mehrtens 
---
 package/libs/toolchain/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile
index 52a4cda19f6a..dea99060f954 100644
--- a/package/libs/toolchain/Makefile
+++ b/package/libs/toolchain/Makefile
@@ -115,7 +115,7 @@ define Package/libasan
 $(call Package/gcc/Default)
   NAME:=libasan
   TITLE:=Runtime library for AddressSanitizer in GCC
-  DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips @!mipsel @!mips64 @!mips64el 
@!arc
+  DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc
   ABI_VERSION:=5
 endef
 
@@ -202,7 +202,7 @@ define Package/libubsan
 $(call Package/gcc/Default)
   NAME:=libubsan
   TITLE:=Runtime library for UndefinedBehaviorSanitizer in GCC
-  DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips @!mipsel @!mips64 @!mips64el 
@!arc
+  DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc
   ABI_VERSION:=1
 endef
 
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/6] gdb: Update to version 11.1

2021-11-01 Thread Hauke Mehrtens
GDB 11.1 now depends on gmp.

Signed-off-by: Hauke Mehrtens 
---
 package/devel/gdb/Makefile|  6 +++---
 package/devel/gdb/patches/110-shared_libgcc.patch | 12 ++--
 package/devel/gdb/patches/130-gdb-ctrl-c.patch|  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile
index a3579969917e..9e20644b04fb 100644
--- a/package/devel/gdb/Makefile
+++ b/package/devel/gdb/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gdb
-PKG_VERSION:=10.2
+PKG_VERSION:=11.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/gdb
-PKG_HASH:=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+PKG_HASH:=cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/nls.mk
 define Package/gdb/Default
   SECTION:=devel
   CATEGORY:=Development
-  DEPENDS:=+!USE_MUSL:libthread-db $(ICONV_DEPENDS) $(INTL_DEPENDS)
+  DEPENDS:=+!USE_MUSL:libthread-db $(ICONV_DEPENDS) $(INTL_DEPENDS) +libgmp
   URL:=https://www.gnu.org/software/gdb/
 endef
 
diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch 
b/package/devel/gdb/patches/110-shared_libgcc.patch
index de92a1f945cb..3979ccd26ba7 100644
--- a/package/devel/gdb/patches/110-shared_libgcc.patch
+++ b/package/devel/gdb/patches/110-shared_libgcc.patch
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1302,13 +1302,13 @@ if test -z "$LD"; then
+@@ -1300,13 +1300,13 @@ if test -z "$LD"; then
fi
  fi
  
@@ -17,7 +17,7 @@
AC_LANG_PUSH(C++)
AC_LINK_IFELSE([AC_LANG_SOURCE([
  #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
-@@ -1648,7 +1648,7 @@ AC_ARG_WITH(stage1-ldflags,
+@@ -1705,7 +1705,7 @@ AC_ARG_WITH(stage1-ldflags,
   # trust that they are doing what they want.
   if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
   -a "$have_static_libs" = yes; then
@@ -26,7 +26,7 @@
   fi])
  AC_SUBST(stage1_ldflags)
  
-@@ -1677,7 +1677,7 @@ AC_ARG_WITH(boot-ldflags,
+@@ -1734,7 +1734,7 @@ AC_ARG_WITH(boot-ldflags,
   # statically.  But if the user explicitly specified the libraries to
   # use, trust that they are doing what they want.
   if test "$poststage1_libs" = ""; then
@@ -37,7 +37,7 @@
  
 --- a/configure
 +++ b/configure
-@@ -5075,14 +5075,14 @@ if test -z "$LD"; then
+@@ -5257,14 +5257,14 @@ if test -z "$LD"; then
fi
  fi
  
@@ -56,7 +56,7 @@
ac_ext=cpp
  ac_cpp='$CXXCPP $CPPFLAGS'
  ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-@@ -5883,7 +5883,7 @@ else
+@@ -6149,7 +6149,7 @@ else
   # trust that they are doing what they want.
   if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
   -a "$have_static_libs" = yes; then
@@ -65,7 +65,7 @@
   fi
  fi
  
-@@ -5919,7 +5919,7 @@ else
+@@ -6185,7 +6185,7 @@ else
   # statically.  But if the user explicitly specified the libraries to
   # use, trust that they are doing what they want.
   if test "$poststage1_libs" = ""; then
diff --git a/package/devel/gdb/patches/130-gdb-ctrl-c.patch 
b/package/devel/gdb/patches/130-gdb-ctrl-c.patch
index 88b5de9d8c4b..72b7273434d2 100644
--- a/package/devel/gdb/patches/130-gdb-ctrl-c.patch
+++ b/package/devel/gdb/patches/130-gdb-ctrl-c.patch
@@ -24,7 +24,7 @@ Signed-off-by: Khem Raj 
 
 --- a/gdbserver/linux-low.cc
 +++ b/gdbserver/linux-low.cc
-@@ -5714,7 +5714,7 @@ linux_process_target::request_interrupt
+@@ -5733,7 +5733,7 @@ linux_process_target::request_interrupt
  {
/* Send a SIGINT to the process group.  This acts just like the user
   typed a ^C on the controlling terminal.  */
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/6] toolchain: gdb: Update to version 11.1

2021-11-01 Thread Hauke Mehrtens
The removed patch was already applied upstream.

gdb now mandatory depends on gmp, tell configure where to find it
explicitly. We already build gmp in the tools directory for gcc. Also
make it use mpfr and mpc as we also build both of them.

Signed-off-by: Hauke Mehrtens 
---

Debian ships a gdb multi arch, we can probably also move gdb to the 
tools directory and build it only once for all targets. This should be 
done in a separate patch.


 toolchain/gdb/Makefile|  7 +--
 .../patches/100-fix-elf-support-check.patch   | 20 ---
 2 files changed, 5 insertions(+), 22 deletions(-)
 delete mode 100644 toolchain/gdb/patches/100-fix-elf-support-check.patch

diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index e769a3be3ece..2adb7d165aed 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -7,12 +7,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gdb
-PKG_VERSION:=10.1
+PKG_VERSION:=11.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/gdb
-PKG_HASH:=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+PKG_HASH:=cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94
 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
 
 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
@@ -30,6 +30,9 @@ HOST_CONFIGURE_ARGS = \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
+   --with-gmp=$(TOPDIR)/staging_dir/host \
+   --with-mpfr=$(TOPDIR)/staging_dir/host \
+   --with-mpc=$(TOPDIR)/staging_dir/host \
--disable-werror \
--without-uiout \
--enable-tui --disable-gdbtk --without-x \
diff --git a/toolchain/gdb/patches/100-fix-elf-support-check.patch 
b/toolchain/gdb/patches/100-fix-elf-support-check.patch
deleted file mode 100644
index fe612c38db38..
--- a/toolchain/gdb/patches/100-fix-elf-support-check.patch
+++ /dev/null
@@ -1,20 +0,0 @@
 a/gdb/configure
-+++ b/gdb/configure
-@@ -16818,6 +16818,7 @@ else
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- #include 
-+#include 
-   #include "bfd.h"
-   #include "elf-bfd.h"
- 
 a/gdb/acinclude.m4
-+++ b/gdb/acinclude.m4
-@@ -362,6 +362,7 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [
-   AC_CACHE_CHECK([$1], [$2],
-   [AC_TRY_LINK(
-   [#include 
-+  #include 
-   #include "bfd.h"
-   #include "$4"
-   ],
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 3/6] valgrind: Update to version 3.18.1

2021-11-01 Thread Hauke Mehrtens
This version has some improvements for musl.
This version works fine for me on MIPS 32 BE without MIPS16 even on musl.

The additional patch is needed to make valgrind use the correct syscall
numbers for new syscalls like clock_gettime64. The MIPS architecture
uses special syscall ranges which are different from most other systems.
The patch is pending upstream: https://bugs.kde.org/show_bug.cgi?id=444781

Signed-off-by: Hauke Mehrtens 
---

On MIPS BE 32 bit with glibc valgrind does not work for me any more.
I am getting this:

root@OpenWrt:/# valgrind uname -a
==1371== Memcheck, a memory error detector
==1371== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1371== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==1371== Command: uname -a
==1371== 

valgrind:  Fatal error at startup: a function redirection
valgrind:  which is mandatory for this platform-tool combination
valgrind:  cannot be set up.  Details of the redirection are:
valgrind:  
valgrind:  A must-be-redirected function
valgrind:  whose name matches the pattern:  index
valgrind:  in an object with soname matching:   ld.so.1
valgrind:  was not found whilst processing
valgrind:  symbols from the object with soname: ld.so.1
valgrind:  
valgrind:  Possible fixes: (1, short term): install glibc's debuginfo
valgrind:  package on this machine.  (2, longer term): ask the packagers
valgrind:  for your Linux distribution to please in future ship a non-
valgrind:  stripped ld.so (or whatever the dynamic linker .so is called)
valgrind:  that exports the above-named function using the standard
valgrind:  calling conventions for this platform.  The package you need
valgrind:  to install for fix (1) is called
valgrind:  
valgrind:On Debian, Ubuntu: libc6-dbg
valgrind:On SuSE, openSuSE, Fedora, RHEL:   glibc-debuginfo
valgrind:  
valgrind:  Note that if you are debugging a 32 bit process on a
valgrind:  64 bit system, you will need a corresponding 32 bit debuginfo
valgrind:  package (e.g. libc6-dbg:i386).
valgrind:  
valgrind:  Cannot continue -- exiting now.  Sorry.

root@OpenWrt:/# 



 package/devel/valgrind/Makefile   |   4 +-
 .../010-mips-Fix-new-syscall-numbers.patch| 131 ++
 .../patches/130-mips_fix_soft_float.patch |  12 +-
 3 files changed, 139 insertions(+), 8 deletions(-)
 create mode 100644 
package/devel/valgrind/patches/010-mips-Fix-new-syscall-numbers.patch

diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile
index 829f37569e9b..4f0e0fd49351 100644
--- a/package/devel/valgrind/Makefile
+++ b/package/devel/valgrind/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=valgrind
-PKG_VERSION:=3.16.1
+PKG_VERSION:=3.18.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://sourceware.org/pub/valgrind/
-PKG_HASH:=c91f3a2f7b02db0f3bc99479861656154d241d2fdb265614ba918cc6720a33ca
+PKG_HASH:=00859aa13a772eddf785f4b46ee0d39afbe071d32778da4d99984081f7f5
 
 PKG_MAINTAINER:=Felix Fietkau 
 PKG_LICENSE:=GPL-2.0+
diff --git 
a/package/devel/valgrind/patches/010-mips-Fix-new-syscall-numbers.patch 
b/package/devel/valgrind/patches/010-mips-Fix-new-syscall-numbers.patch
new file mode 100644
index ..e84273c97322
--- /dev/null
+++ b/package/devel/valgrind/patches/010-mips-Fix-new-syscall-numbers.patch
@@ -0,0 +1,131 @@
+From 86ab9452bd10f08dbfa22d94e1155838f6f9f2e0 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens 
+Date: Sun, 31 Oct 2021 23:11:11 +0100
+Subject: [PATCH] mips: Fix new syscall numbers
+
+The MIPS32 and MIPS64 O32 ABI are adding 4000 to all syscall numbers.
+The MIPS64 N64 ABI adds 5000 to each syscall and the MIPS64 N32 ABI adds
+6000 to each syscall number. We can not sue the shared file for MIPS and
+have to define this for each sycall separately.
+
+Without this change valgrind is not able to detect new syscalls like
+clock_gettime64 correctly.
+
+Signed-off-by: Hauke Mehrtens 
+---
+ include/pub_tool_vkiscnums_asm.h  |  3 ---
+ include/vki/vki-scnums-mips32-linux.h | 36 +++
+ include/vki/vki-scnums-mips64-linux.h | 32 
+ 3 files changed, 68 insertions(+), 3 deletions(-)
+
+--- a/include/pub_tool_vkiscnums_asm.h
 b/include/pub_tool_vkiscnums_asm.h
+@@ -63,15 +63,12 @@
+ #  include "vki/vki-scnums-arm64-linux.h"
+ 
+ #elif defined(VGP_mips32_linux)
+-#  include "vki/vki-scnums-shared-linux.h"
+-#  include "vki/vki-scnums-32bit-linux.h"
+ #  include "vki/vki-scnums-mips32-linux.h"
+ 
+ #elif defined(VGP_nanomips_linux)
+ #  include "vki/vki-scnums-nanomips-linux.h"
+ 
+ #elif defined(VGP_mips64_linux)
+-#  include "vki/vki-scnums-shared-linux.h"
+ #  include "vki/vki-scnums-mips64-linux.h"
+ 
+ #elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd)
+--- a/include/vki/vki-scnums-mips32-linux.h

[PATCH 5/6] strace: Update to version 5.14

2021-11-01 Thread Hauke Mehrtens
Explicitly deactivate libselinux, otherwise we get a hard dependency to
libselinux.

Signed-off-by: Hauke Mehrtens 
---
 package/devel/strace/Makefile | 9 +
 package/devel/strace/patches/010-m4.patch | 8 
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile
index 8c4a26b63b25..527b3e01d83e 100644
--- a/package/devel/strace/Makefile
+++ b/package/devel/strace/Makefile
@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=strace
-PKG_VERSION:=5.10
-PKG_RELEASE:=2
+PKG_VERSION:=5.14
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
-PKG_HASH:=fe3982ea4cd9aeb3b4ba35f6279f0b577a37175d3282be24b9a5537b56b8f01c
+PKG_HASH:=901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73
 
 PKG_MAINTAINER:=Felix Fietkau 
 PKG_LICENSE:=LGPL-2.1-or-later
@@ -70,7 +70,8 @@ endef
 CONFIGURE_ARGS += \
--with-libdw=$(if $(CONFIG_STRACE_LIBDW),yes,no) \
--with-libunwind=$(if $(CONFIG_STRACE_LIBUNWIND),yes,no) \
-   --enable-mpers=no
+   --enable-mpers=no \
+   --without-libselinux
 
 MAKE_FLAGS := \
CCOPT="$(TARGET_CFLAGS)"
diff --git a/package/devel/strace/patches/010-m4.patch 
b/package/devel/strace/patches/010-m4.patch
index 478961ce26e4..32584e11806f 100644
--- a/package/devel/strace/patches/010-m4.patch
+++ b/package/devel/strace/patches/010-m4.patch
@@ -1,10 +1,10 @@
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -408,7 +408,6 @@ strace_LDADD += $(libiberty_LIBS)
- endif
- endif
+@@ -21,7 +21,6 @@ man_MANS = doc/strace.1 doc/strace-log-m
+ 
+ ACLOCAL_AMFLAGS = -I m4 -I src/xlat
  
 -@CODE_COVERAGE_RULES@
  CODE_COVERAGE_BRANCH_COVERAGE = 1
  CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
-   --prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .)
+   --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 0/6] Update some development tools

2021-11-01 Thread Hauke Mehrtens
This updates some of the development tools to their recent versions.

Hauke Mehrtens (6):
  toolchain: gdb: Update to version 11.1
  gdb: Update to version 11.1
  valgrind: Update to version 3.18.1
  valgrind: Activate also on MIPS 64
  strace: Update to version 5.14
  binutils: Update to version 2.37

 package/devel/binutils/Makefile   |   4 +-
 package/devel/gdb/Makefile|   6 +-
 .../devel/gdb/patches/110-shared_libgcc.patch |  12 +-
 .../devel/gdb/patches/130-gdb-ctrl-c.patch|   2 +-
 package/devel/strace/Makefile |   9 +-
 package/devel/strace/patches/010-m4.patch |   8 +-
 package/devel/valgrind/Makefile   |   6 +-
 .../010-mips-Fix-new-syscall-numbers.patch| 131 ++
 .../patches/130-mips_fix_soft_float.patch |  12 +-
 toolchain/gdb/Makefile|   7 +-
 .../patches/100-fix-elf-support-check.patch   |  20 ---
 11 files changed, 166 insertions(+), 51 deletions(-)
 create mode 100644 
package/devel/valgrind/patches/010-mips-Fix-new-syscall-numbers.patch
 delete mode 100644 toolchain/gdb/patches/100-fix-elf-support-check.patch

-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 6/6] binutils: Update to version 2.37

2021-11-01 Thread Hauke Mehrtens
This matches the version used in the toolchain.

Signed-off-by: Hauke Mehrtens 
---
 package/devel/binutils/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile
index ca1099349c12..5fdb83036ea3 100644
--- a/package/devel/binutils/Makefile
+++ b/package/devel/binutils/Makefile
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=binutils
-PKG_VERSION:=2.35.2
+PKG_VERSION:=2.37
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=@GNU/binutils
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_VERSION:=$(PKG_VERSION)
-PKG_HASH:=dcd5b0416e7b0a9b24bed76cd8c6c132526805761863150a26d016415b8bdc7b
+PKG_HASH:=820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c
 
 PKG_FIXUP:=autoreconf
 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 4/6] valgrind: Activate also on MIPS 64

2021-11-01 Thread Hauke Mehrtens
This activates valgrind also on mips64 and mips64el.

This was working fine in a basic test in qemu.

Signed-off-by: Hauke Mehrtens 
---
 package/devel/valgrind/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile
index 4f0e0fd49351..e6ebff4b3003 100644
--- a/package/devel/valgrind/Makefile
+++ b/package/devel/valgrind/Makefile
@@ -33,7 +33,7 @@ include $(INCLUDE_DIR)/kernel.mk
 define Package/valgrind
   SECTION:=devel
   CATEGORY:=Development
-  DEPENDS:=@mips||mipsel||i386||x86_64||powerpc||arm_v7||aarch64 +libpthread 
+librt
+  
DEPENDS:=@mips||mipsel||mips64||mips64el||i386||x86_64||powerpc||arm_v7||aarch64
 +libpthread +librt
   TITLE:=debugging and profiling tools for Linux
   URL:=http://www.valgrind.org
 endef
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/2] jail: elf: Remove MIPS 64 warning

2021-11-01 Thread Hauke Mehrtens
The procd jails are working fine on MIPS64 too now.

I saw this error message when add_path_and_deps() was called which calls
elf_load_deps() again under some conditions. This is happening because
gcc_mips64_bug_work_around is stored in the data segment.

We have a call trace like this:
elf_load_deps()
  gcc_mips64_bug_work_around = 1;
  call add_path_and_deps()
call elf_load_deps()
  gcc_mips64_bug_work_around = 1;
  error if gcc_mips64_bug_work_around =! 1
  gcc_mips64_bug_work_around = 0;
  return;
return;
  error if gcc_mips64_bug_work_around =! 1
  return;

I got the same error messages on MIPS 32 BE, when I removed the compile
check.

This was tested in qemu on MIPS 64 BE and MIPS64 LE.

Signed-off-by: Hauke Mehrtens 
---
 jail/elf.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/jail/elf.c b/jail/elf.c
index 18a7b7c..176d046 100644
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -235,11 +235,7 @@ int elf_load_deps(const char *path, const char *map)
unsigned long dyn_offset, dyn_size;
unsigned long load_offset, load_vaddr;
unsigned long interp_offset;
-#if defined(__mips__) && (__mips == 64)
-   static int gcc_mips64_bug_work_around;
 
-   gcc_mips64_bug_work_around = 1;
-#endif
if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) {
ERROR("failed to load the .load section from %s\n", path);
return -1;
@@ -256,14 +252,6 @@ int elf_load_deps(const char *path, const char *map)
 
int clazz = map[EI_CLASS];
 
-#if defined(__mips__) && (__mips == 64)
-   if (gcc_mips64_bug_work_around != 1) {
-   ERROR("compiler bug: GCC for MIPS64 should be fixed!\n");
-   return -1;
-   }
-   gcc_mips64_bug_work_around = 0;
-#endif
-
if (clazz == ELFCLASS32)
return elf32_scan_dynamic(map, dyn_offset, dyn_size, load_vaddr 
- load_offset);
else if (clazz == ELFCLASS64)
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/2] jail: elf: Use 64 bit variables for elf offsets

2021-11-01 Thread Hauke Mehrtens
The members p_offset, p_filesz and p_vaddr of the structure Elf64_Phdr
are all uint64_t. This structure is used for 64 bit applications.

Without this change we would convert the 64 bit values into 32 bit
values and an overflow could happen in this conversion.

On MIPS 64 BE the variable load_vaddr has the value 0x12000 which
sets the 32th bit which will overflow when converted to a 32 bit value.

On 32 bit systems Elf32_Phdr is used with uint32_t, converting this to
64 bit values too should not cause problems as this is not in the hot
path.

Without this fix I am getting error messages like this at bootup on MIPS 64 BE:
[   16.622602] do_page_fault(): sending SIGSEGV to ujail for invalid read 
access from 0100f37251e3
[   16.622907] epc = 00aaab4ed0e0 in ujail[aaab4e+18000]
[   16.623237] ra  = 00aaab4ed694 in ujail[aaab4e+18000]

Signed-off-by: Hauke Mehrtens 
---
 jail/elf.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/jail/elf.c b/jail/elf.c
index f67515b..18a7b7c 100644
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -102,7 +102,7 @@ const char* find_lib(const char *file)
return l->path;
 }
 
-static int elf64_find_section(const char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
+static int elf64_find_section(const char *map, unsigned int type, unsigned 
long *offset, unsigned long *size, unsigned long *vaddr)
 {
Elf64_Ehdr *e;
Elf64_Phdr *ph;
@@ -125,7 +125,7 @@ static int elf64_find_section(const char *map, unsigned int 
type, unsigned int *
return -1;
 }
 
-static int elf32_find_section(const char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
+static int elf32_find_section(const char *map, unsigned int type, unsigned 
long *offset, unsigned long *size, unsigned long *vaddr)
 {
Elf32_Ehdr *e;
Elf32_Phdr *ph;
@@ -148,7 +148,7 @@ static int elf32_find_section(const char *map, unsigned int 
type, unsigned int *
return -1;
 }
 
-static int elf_find_section(const char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
+static int elf_find_section(const char *map, unsigned int type, unsigned long 
*offset, unsigned long *size, unsigned long *vaddr)
 {
int clazz = map[EI_CLASS];
 
@@ -162,7 +162,7 @@ static int elf_find_section(const char *map, unsigned int 
type, unsigned int *of
return -1;
 }
 
-static int elf32_scan_dynamic(const char *map, int dyn_offset, int dyn_size, 
int load_offset)
+static int elf32_scan_dynamic(const char *map, unsigned long dyn_offset, 
unsigned long dyn_size, long load_offset)
 {
Elf32_Dyn *dynamic = (Elf32_Dyn *) (map + dyn_offset);
const char *strtab = NULL;
@@ -196,7 +196,7 @@ static int elf32_scan_dynamic(const char *map, int 
dyn_offset, int dyn_size, int
return 0;
 }
 
-static int elf64_scan_dynamic(const char *map, int dyn_offset, int dyn_size, 
int load_offset)
+static int elf64_scan_dynamic(const char *map, unsigned long dyn_offset, 
unsigned long dyn_size, long load_offset)
 {
Elf64_Dyn *dynamic = (Elf64_Dyn *) (map + dyn_offset);
const char *strtab = NULL;
@@ -232,9 +232,9 @@ static int elf64_scan_dynamic(const char *map, int 
dyn_offset, int dyn_size, int
 
 int elf_load_deps(const char *path, const char *map)
 {
-   unsigned int dyn_offset, dyn_size;
-   unsigned int load_offset, load_vaddr;
-   unsigned int interp_offset;
+   unsigned long dyn_offset, dyn_size;
+   unsigned long load_offset, load_vaddr;
+   unsigned long interp_offset;
 #if defined(__mips__) && (__mips == 64)
static int gcc_mips64_bug_work_around;
 
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: dnsmasq error message related to host file

2021-11-01 Thread Daniel Golle
On Mon, Nov 01, 2021 at 12:00:20PM +0100, e9hack wrote:
> Hi,
> 
> after commit "dnsmasq: improve init script", I get the following error in the 
> log file:
> 
> Sun Oct 31 14:08:11 2021 user.err : jail: 
> creat(/tmp/ujail-pbMGCD/tmp/hosts/dhcp.main) failed: Read-only file system
> Sun Oct 31 14:08:11 2021 user.err : jail: 
> creat(/tmp/ujail-iEpgOj/tmp/hosts/dhcp.guest) failed: Read-only file system
> 
> I think, the modification is in conflict with this part:
> 
>   config_get_bool ignore_hosts_dir "$cfg" ignore_hosts_dir 0
>   if [ "$ignore_hosts_dir" = "1" ]; then
>   xappend "--addn-hosts=$HOSTFILE"
>   append EXTRA_MOUNT "$HOSTFILE"
>   else
>   xappend "--addn-hosts=$(dirname $HOSTFILE)"
>   append EXTRA_MOUNT "$(dirname $HOSTFILE)"
>   fi
> 
> I did set ignore_hosts_dir for both instances.

I forgot about the existing handling of hosts_dir...
Fixed (as in: partial revert) it now.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


dnsmasq error message related to host file

2021-11-01 Thread e9hack

Hi,

after commit "dnsmasq: improve init script", I get the following error in the 
log file:

Sun Oct 31 14:08:11 2021 user.err : jail: 
creat(/tmp/ujail-pbMGCD/tmp/hosts/dhcp.main) failed: Read-only file system
Sun Oct 31 14:08:11 2021 user.err : jail: 
creat(/tmp/ujail-iEpgOj/tmp/hosts/dhcp.guest) failed: Read-only file system

I think, the modification is in conflict with this part:

config_get_bool ignore_hosts_dir "$cfg" ignore_hosts_dir 0
if [ "$ignore_hosts_dir" = "1" ]; then
xappend "--addn-hosts=$HOSTFILE"
append EXTRA_MOUNT "$HOSTFILE"
else
xappend "--addn-hosts=$(dirname $HOSTFILE)"
append EXTRA_MOUNT "$(dirname $HOSTFILE)"
fi

I did set ignore_hosts_dir for both instances.

Regards,
Hartmut

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel