[PATCH] gnu: Add rkdeveloptool-pine64.

  • Open
  • quality assurance status badge
Details
2 participants
  • phodina
  • Glenn Morris
Owner
unassigned
Submitted by
phodina
Severity
normal
P
P
phodina wrote on 5 Oct 2021 23:36
(name . phodina via Guix-patches via)(address . guix-patches@gnu.org)
XeraZiDxiWFLBwhjjMyyRnlkdqQk9as-9yGJPUEv9M5OK7w8tlrKEm8ha6_Xcp7t1tJVQ7zhKefOUs93DhWkeJe6AMcFRMTenb95sK1cjMw=@protonmail.com
Hi,

I've added the suffix pine64 as this is fork of rkdeveloptool which uses different build system and targets additional mostly pine64 boards.

Petr

----

* gnu/packages/hardware.scm (rkdeveloptool-pine64): New variable.

Toggle diff (61 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index ff21c9c724..d871b36a90 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2021 Evgeny Pisemsky <evgeny@pisemsky.com>
;;; Copyright © 2021 Léo Le Bouter <lle-bout@zaclys.net>
;;; Copyright © 2021 Denis Carikli <GNUtoo@cyberdimension.org>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -55,6 +56,7 @@
#:use-module (gnu packages xorg)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system meson)
#:use-module (guix build-system python)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -531,6 +533,40 @@ supported by the Linux kernel.")
as the Pinebook Pro.")
(license license:gpl2+))))

+(define-public rkdeveloptool-pine64
+(package
+ (name "rkdeveloptool-pine64")
+ (version "1.0.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1qhb687x0djh8wb1famyjb81cllhq8crh7zwclws9ag872032ysc"))))
+ (build-system meson-build-system)
+ (arguments
+ `(#:tests? #f ; no test suite
+ #:phases
+ (modify-phases %standard-phases
+ ; attempts to place the file into the udev pkg read-only path
+ (add-after 'unpack 'fix-udev-path
+ (lambda* _
+ (substitute* "meson.build"
+ (("udev_rules_dir,")
+ (string-append "'" %output "/lib/udev/rules.d',"))))))))
+ (native-inputs `(("pkg-config" ,pkg-config)))
+ (inputs `(("eudev" ,eudev)
+ ("libusb" ,libusb)))
+ (synopsis "Read from and write to RockChicp devices over USB")
+ (description "Rkdeveloptool is a fastboot-like CLI tool to read from and
+write to RockChip devices over USB. Supports PineNote and Quartz64 as well
+as other Pine64 RK devices.")
+ (home-page "https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool")
+ (license license:gpl2+)))
+
(define-public libqb
(package
(name "libqb")
--
2.32.0
P
P
phodina wrote on 3 Dec 2021 16:02
rkdeveloptool-pine64 ping
(name . 51043@debbugs.gnu.org)(address . 51043@debbugs.gnu.org)
LR9bFGz0Tbm9N9FGz2YazZohXJSVe9IYwzMRAhP__Kxf3sdcM3SHUZMNwR6cEpEoZSGA1dN_jA-z4JSBn2h-bj3A16-AXvn4GRV73KbZLkM=@protonmail.com
ping
Attachment: file
P
P
phodina wrote on 21 Feb 2022 13:43
Fix build of rkdeveloptool
(name . 51043@debbugs.gnu.org)(address . 51043@debbugs.gnu.org)(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
UbNDhFyAp_6UmSgTIicxl617-LOqZ-hj1TQSPO8a4XbarG2T8MqZwrEguOHeQ-YanQ30pDM_zxd90BpOzMgg8anTh-P-VqSwpRX2DG1HEUM=@protonmail.com
Hi,

Here's fix of the rkdeveloptool package which fails to build due to GCC complaining about the truncation error.


----
Petr
Attachment: file
From 50e6bbcf7f648a7793ecf6b1ddd9a4148fc776b8 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 21 Feb 2022 13:25:16 +0100
Subject: [PATCH 1/2] gnu: rkdeveloptool: Fix build.

* gnu/packages/hardware.scm (rkdeveloptool): Update to newer commit 46bb4c.
[source]: Apply patch to fix GCC format truncation error.
[arguments]: Add phase after install to install udev rules.
* gnu/local.mk: Add patch.
* gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch: New file.

Toggle diff (93 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index dcee1611b2..3e84188937 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1754,6 +1754,7 @@ dist_patch_DATA = \
%D%/packages/patches/remake-impure-dirs.patch \
%D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \
%D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch \
+ %D%/packages/patches/rkdeveloptool-fix-format-truncation.patch \
%D%/packages/patches/rnp-add-version.cmake.patch \
%D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \
%D%/packages/patches/rnp-unbundle-googletest.patch \
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index a3ce90f75e..e4aceab54b 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -770,29 +770,40 @@ (define-public wavemon
(license license:gpl3+)))
(define-public rkdeveloptool
- (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
- (revision "0"))
+ (let ((commit "46bb4c073624226c3f05b37b9ecc50bbcf543f5a")
+ (revision "1"))
(package
(name "rkdeveloptool")
- (version (git-version "1.3" revision commit))
+ (version (git-version "1.32" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/rockchip-linux/rkdeveloptool")
(commit commit)))
+ ;; https://github.com/rockchip-linux/rkdeveloptool/pull/62
+ (patches (search-patches "rkdeveloptool-fix-format-truncation.patch"))
(file-name (git-file-name name version))
(sha256
- (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
+ (base32 "0kb2ylsrqqrdf4np66yxmk96kdc5g8nvjx13gifpm5rshv5770bq"))))
(build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'install-udev-rules
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((udev (string-append (assoc-ref outputs "out")
+ "/lib/udev/rules.d")))
+ (mkdir-p udev)
+ (install-file "99-rk-rockusb.rules" udev)))))))
(native-inputs
(list autoconf automake pkg-config))
(inputs
(list libusb))
(home-page "https://github.com/rockchip-linux/rkdeveloptool")
- (synopsis "Read from and write to RockChicp devices over USB")
+ (synopsis "Read/write to rockchip devices over USB")
(description
- "Rkdeveloptool can read from and write to RockChip devices over USB, such
+ "Rkdeveloptool can read from and write to rockchip devices over USB, such
as the Pinebook Pro.")
(license license:gpl2+))))
diff --git a/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch b/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch
new file mode 100644
index 0000000000..fd9a193e76
--- /dev/null
+++ b/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch
@@ -0,0 +1,22 @@
+From bc9e5f03d71b3dd4360721f4df3524c1dcba9bc8 Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina@protonmail.com>
+Date: Mon, 21 Feb 2022 13:00:53 +0100
+Subject: [PATCH] Fix format truncation for GCC >7.1.
+
+
+diff --git a/main.cpp b/main.cpp
+index 72bd94b..800db0b 100644
+--- a/main.cpp
++++ b/main.cpp
+@@ -1490,7 +1490,7 @@ static bool saveEntry(FILE* outFile, char* path, rk_entry_type type,
+ static inline uint32_t convertChipType(const char* chip) {
+ char buffer[5];
+ memset(buffer, 0, sizeof(buffer));
+- snprintf(buffer, sizeof(buffer), "%s", chip);
++ memcpy(buffer, chip, 4);
+ return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3];
+ }
+
+--
+2.34.0
+
--
2.34.0
From 1ed30235dbaae9f95c34826051eb88f9d6def032 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 21 Feb 2022 13:33:41 +0100
Subject: [PATCH 2/2] gnu: Add rkdeveloptool-pine64.

* gnu/packages/hardware.scm (rkdeveloptool-pine64): New variable.

Toggle diff (48 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index e4aceab54b..ceb63081b2 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -807,6 +807,41 @@ (define-public rkdeveloptool
as the Pinebook Pro.")
(license license:gpl2+))))
+(define-public rkdeveloptool-pine64
+ (package
+ (name "rkdeveloptool-pine64")
+ (version "1.1.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url
+ "https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0nh9592mllygycnxbw91vg58wwais7w3w62rl9gcvc4m3i909b1z"))))
+ (build-system meson-build-system)
+ (arguments
+ `(#:tests? #f ;no test suite
+ #:phases
+ (modify-phases %standard-phases
+ ;; attempts to place the file into the udev pkg read-only path
+ (add-after 'unpack 'fix-udev-path
+ (lambda* _
+ (substitute* "meson.build"
+ (("udev_rules_dir,") (string-append "'" %output
+ "/lib/udev/rules.d',"))))))))
+ (native-inputs (list pkg-config))
+ (inputs (list eudev libusb))
+ (synopsis "Read from and write to RockChicp devices over USB")
+ (description
+ "Rkdeveloptool is a fastboot-like CLI tool to read from and
+write to RockChip devices over USB. Supports PineNote and Quartz64 as well
+as other Pine64 RK devices.")
+ (home-page "https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool")
+ (license license:gpl2+)))
+
(define-public libqb
(package
(name "libqb")
--
2.34.0
G
G
Glenn Morris wrote on 21 Feb 2022 16:54
control message for bug 51043
(address . control@debbugs.gnu.org)
E1nMB0u-0003Vo-2A@fencepost.gnu.org
reassign 51043 guix-patches
P
P
phodina wrote on 15 Dec 2022 21:36
Re: Fix build of rkdeveloptool
(name . 51043@debbugs.gnu.org)(address . 51043@debbugs.gnu.org)
9bQQgGpGjEpK7TZ2fb-yyHVRE5iY_PwlW7-do2Vk-7GwTPccqK2gx8ZQxETFeCXM6RmGa8352V9dxCWEKLUc5UhLScl67ZdLVQk3FyUQFp8=@protonmail.com
Hi Ludo’,

speaking of lost patches this one is little bit annoying as it does not even build.

Excerpt of the build log, build failure caused probably by introducing stricter compilation flags in `gnu-build-system`:

starting phase `build'
make[1]: Entering directory '/tmp/guix-build-rkdeveloptool-1.3-0.6e92ebc.drv-0/source'
g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT crc.o -MD -MP -MF .deps/crc.Tpo -c -o crc.o crc.cpp
g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKBoot.o -MD -MP -MF .deps/RKBoot.Tpo -c -o RKBoot.o RKBoot.cpp
g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKComm.o -MD -MP -MF .deps/RKComm.Tpo -c -o RKComm.o RKComm.cpp
g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKDevice.o -MD -MP -MF .deps/RKDevice.Tpo -c -o RKDevice.o RKDevice.cpp
g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKImage.o -MD -MP -MF .deps/RKImage.Tpo -c -o RKImage.o RKImage.cpp
g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKLog.o -MD -MP -MF .deps/RKLog.Tpo -c -o RKLog.o RKLog.cpp
g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKScan.o -MD -MP -MF .deps/RKScan.Tpo -c -o RKScan.o RKScan.cpp
mv -f .deps/RKBoot.Tpo .deps/RKBoot.Po
mv -f .deps/RKImage.Tpo .deps/RKImage.Po
mv -f .deps/RKLog.Tpo .deps/RKLog.Po
mv -f .deps/RKDevice.Tpo .deps/RKDevice.Po
mv -f .deps/RKComm.Tpo .deps/RKComm.Po
mv -f .deps/crc.Tpo .deps/crc.Po
mv -f .deps/RKScan.Tpo .deps/RKScan.Po
main.cpp: In function ‘bool _Z9mergeBootv.part.0()’:
main.cpp:1541:36: error: ‘%s’ directive output may be truncated writing up to 557 bytes into a region of size 5 [-Werror=format-truncation=]
1541 | snprintf(buffer, sizeof(buffer), "%s", chip);
| ^~
......
1582 | chipType = convertChipType(chip + 2);
| ~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:1541:10: note: ‘snprintf’ output between 1 and 558 bytes into a destination of size 5
1541 | snprintf(buffer, sizeof(buffer), "%s", chip);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:473: main.o] Error 1
make[1]: Leaving directory '/tmp/guix-build-rkdeveloptool-1.3-0.6e92ebc.drv-0/source'
make: *** [Makefile:493: all-recursive] Error 1
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "16") exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 2.2 seconds
command "make" "-j" "16" failed with status 2
builder for `/gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv' failed with exit code 1
build of /gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv failed
View build log at '/var/log/guix/drvs/sr/ykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv.gz'.guix build: error: build of `/gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv' failed
------- Original Message -------
On Monday, February 21st, 2022 at 1:43 PM, phodina <phodina@protonmail.com> wrote:

Toggle quote (8 lines)
> Hi,
>
> Here's fix of the rkdeveloptool package which fails to build due to GCC complaining about the truncation error.
>
> See https://github.com/rockchip-linux/rkdeveloptool/pull/62.
>
> ----
> Petr
Attachment: file
From cebf1356add8d5299e71abf45fb71b5afe5a30ee Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 21 Feb 2022 13:25:16 +0100
Subject: [PATCH v2 1/2] gnu: rkdeveloptool: Fix build. Apply 'guix style'.

* gnu/packages/hardware.scm (rkdeveloptool): Update to newer commit 46bb4c.
Apply 'guix style'
[source]: Apply patch to fix GCC format truncation error.
[arguments]: Add phase after install to install udev rules.
* gnu/local.mk: Add patch.
* gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch: New file.

Toggle diff (103 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 9443dd617a..c01b063d17 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1810,6 +1810,7 @@ dist_patch_DATA = \
%D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \
%D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch \
%D%/packages/patches/r-mixedpower-r2power.patch \
+ %D%/packages/patches/rkdeveloptool-fix-format-truncation.patch \
%D%/packages/patches/rnp-add-version.cmake.patch \
%D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \
%D%/packages/patches/rnp-unbundle-googletest.patch \
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index f392bb8c16..255b077eaa 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -1108,29 +1108,38 @@ (define-public wavemon
(license license:gpl3+)))
(define-public rkdeveloptool
- (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
- (revision "0"))
+ (let ((commit "46bb4c073624226c3f05b37b9ecc50bbcf543f5a")
+ (revision "1"))
(package
(name "rkdeveloptool")
- (version (git-version "1.3" revision commit))
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/rockchip-linux/rkdeveloptool")
- (commit commit)))
- (file-name (git-file-name name version))
- (sha256
- (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
+ (version (git-version "1.32" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rockchip-linux/rkdeveloptool")
+ (commit commit)))
+ ;; https://github.com/rockchip-linux/rkdeveloptool/pull/62
+ (patches (search-patches
+ "rkdeveloptool-fix-format-truncation.patch"))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0kb2ylsrqqrdf4np66yxmk96kdc5g8nvjx13gifpm5rshv5770bq"))))
(build-system gnu-build-system)
- (native-inputs
- (list autoconf automake pkg-config))
- (inputs
- (list libusb))
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-after 'install 'install-udev-rules
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((udev (string-append (assoc-ref outputs "out")
+ "/lib/udev/rules.d")))
+ (mkdir-p udev)
+ (install-file "99-rk-rockusb.rules" udev)))))))
+ (native-inputs (list autoconf automake pkg-config))
+ (inputs (list libusb))
(home-page "https://github.com/rockchip-linux/rkdeveloptool")
- (synopsis "Read from and write to RockChicp devices over USB")
+ (synopsis "Read/write to rockchip devices over USB")
(description
- "Rkdeveloptool can read from and write to RockChip devices over USB, such
+ "Rkdeveloptool can read from and write to rockchip devices over USB, such
as the Pinebook Pro.")
(license license:gpl2+))))
diff --git a/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch b/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch
new file mode 100644
index 0000000000..fd9a193e76
--- /dev/null
+++ b/gnu/packages/patches/rkdeveloptool-fix-format-truncation.patch
@@ -0,0 +1,22 @@
+From bc9e5f03d71b3dd4360721f4df3524c1dcba9bc8 Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina@protonmail.com>
+Date: Mon, 21 Feb 2022 13:00:53 +0100
+Subject: [PATCH] Fix format truncation for GCC >7.1.
+
+
+diff --git a/main.cpp b/main.cpp
+index 72bd94b..800db0b 100644
+--- a/main.cpp
++++ b/main.cpp
+@@ -1490,7 +1490,7 @@ static bool saveEntry(FILE* outFile, char* path, rk_entry_type type,
+ static inline uint32_t convertChipType(const char* chip) {
+ char buffer[5];
+ memset(buffer, 0, sizeof(buffer));
+- snprintf(buffer, sizeof(buffer), "%s", chip);
++ memcpy(buffer, chip, 4);
+ return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3];
+ }
+
+--
+2.34.0
+
--
2.37.2
P
P
phodina wrote on 9 Jan 2023 13:49
cHZYahHjWhhpX_rF20vlvihwV_OvRd4G5DSv5adItQs9HF3UMCgGdKgSDSWIlg-5rAKPCxzbw9JoCEtVu0hG8vt_2Q3CURQnAp6SNlS1De0=@protonmail.com
Hi Efraim,

since you fixed the build can for the rkdeveloptool (commit 3ad3869297fd327ef417b1ecb95c2c4caf53d2e6) can you have a look also on the second patch please?

----
Petr
------- Original Message -------
On Thursday, December 15th, 2022 at 9:36 PM, phodina <phodina@protonmail.com> wrote:

Toggle quote (55 lines)
> Hi Ludo’,
>
> speaking of lost patches this one is little bit annoying as it does not even build.
>
> Excerpt of the build log, build failure caused probably by introducing stricter compilation flags in `gnu-build-system`:
>
> starting phase `build'
> make[1]: Entering directory '/tmp/guix-build-rkdeveloptool-1.3-0.6e92ebc.drv-0/source'
> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT crc.o -MD -MP -MF .deps/crc.Tpo -c -o crc.o crc.cpp
> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKBoot.o -MD -MP -MF .deps/RKBoot.Tpo -c -o RKBoot.o RKBoot.cpp
> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKComm.o -MD -MP -MF .deps/RKComm.Tpo -c -o RKComm.o RKComm.cpp
> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKDevice.o -MD -MP -MF .deps/RKDevice.Tpo -c -o RKDevice.o RKDevice.cpp
> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKImage.o -MD -MP -MF .deps/RKImage.Tpo -c -o RKImage.o RKImage.cpp
> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKLog.o -MD -MP -MF .deps/RKLog.Tpo -c -o RKLog.o RKLog.cpp
> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKScan.o -MD -MP -MF .deps/RKScan.Tpo -c -o RKScan.o RKScan.cpp
> mv -f .deps/RKBoot.Tpo .deps/RKBoot.Po
> mv -f .deps/RKImage.Tpo .deps/RKImage.Po
> mv -f .deps/RKLog.Tpo .deps/RKLog.Po
> mv -f .deps/RKDevice.Tpo .deps/RKDevice.Po
> mv -f .deps/RKComm.Tpo .deps/RKComm.Po
> mv -f .deps/crc.Tpo .deps/crc.Po
> mv -f .deps/RKScan.Tpo .deps/RKScan.Po
> main.cpp: In function ‘bool _Z9mergeBootv.part.0()’:
> main.cpp:1541:36: error: ‘%s’ directive output may be truncated writing up to 557 bytes into a region of size 5 [-Werror=format-truncation=]
> 1541 | snprintf(buffer, sizeof(buffer), "%s", chip);
> | ^~
> ......
> 1582 | chipType = convertChipType(chip + 2);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~
> main.cpp:1541:10: note: ‘snprintf’ output between 1 and 558 bytes into a destination of size 5
> 1541 | snprintf(buffer, sizeof(buffer), "%s", chip);
> | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1plus: all warnings being treated as errors
> make[1]: *** [Makefile:473: main.o] Error 1
> make[1]: Leaving directory '/tmp/guix-build-rkdeveloptool-1.3-0.6e92ebc.drv-0/source'
> make: *** [Makefile:493: all-recursive] Error 1
> error: in phase 'build': uncaught exception:
> %exception #<&invoke-error program: "make" arguments: ("-j" "16") exit-status: 2 term-signal: #f stop-signal: #f>
> phase `build' failed after 2.2 seconds
> command "make" "-j" "16" failed with status 2
> builder for `/gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv' failed with exit code 1
> build of /gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv failed
> View build log at '/var/log/guix/drvs/sr/ykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv.gz'.guix build: error: build of `/gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv' failed
> ------- Original Message -------
> On Monday, February 21st, 2022 at 1:43 PM, phodina <phodina@protonmail.com> wrote:
>
>> Hi,
>>
>> Here's fix of the rkdeveloptool package which fails to build due to GCC complaining about the truncation error.
>>
>> See https://github.com/rockchip-linux/rkdeveloptool/pull/62.
>>
>> ----
>> Petr
Attachment: file
P
P
phodina wrote on 9 Jan 2023 16:08
6XwlW0pv9PKJRs5EpjYqiuxGyWHP4CkN6LgVyRTWr2sckdnqv2IN4t4CXdwTMWobju8YsW1X1OdeFPm4hbc_Pl0-a2vQg9emVleqQsZ1GCY=@protonmail.com
Here's updated patch as it had some conflicts.

Plus I added patch to speedup the transfer. Tested on Pinenote and Quartz64.

----
Petr
------- Original Message -------
On Monday, January 9th, 2023 at 1:49 PM, phodina <phodina@protonmail.com> wrote:

Toggle quote (64 lines)
> Hi Efraim,
>
> since you fixed the build can for the rkdeveloptool (commit 3ad3869297fd327ef417b1ecb95c2c4caf53d2e6) can you have a look also on the second patch please?
>
> ----
> Petr
> ------- Original Message -------
> On Thursday, December 15th, 2022 at 9:36 PM, phodina <phodina@protonmail.com> wrote:
>
>> Hi Ludo’,
>>
>> speaking of lost patches this one is little bit annoying as it does not even build.
>>
>> Excerpt of the build log, build failure caused probably by introducing stricter compilation flags in `gnu-build-system`:
>>
>> starting phase `build'
>> make[1]: Entering directory '/tmp/guix-build-rkdeveloptool-1.3-0.6e92ebc.drv-0/source'
>> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
>> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT crc.o -MD -MP -MF .deps/crc.Tpo -c -o crc.o crc.cpp
>> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKBoot.o -MD -MP -MF .deps/RKBoot.Tpo -c -o RKBoot.o RKBoot.cpp
>> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKComm.o -MD -MP -MF .deps/RKComm.Tpo -c -o RKComm.o RKComm.cpp
>> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKDevice.o -MD -MP -MF .deps/RKDevice.Tpo -c -o RKDevice.o RKDevice.cpp
>> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKImage.o -MD -MP -MF .deps/RKImage.Tpo -c -o RKImage.o RKImage.cpp
>> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKLog.o -MD -MP -MF .deps/RKLog.Tpo -c -o RKLog.o RKLog.cpp
>> g++ -DHAVE_CONFIG_H -I. -I./cfg -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/include/libusb-1.0 -g -O2 -MT RKScan.o -MD -MP -MF .deps/RKScan.Tpo -c -o RKScan.o RKScan.cpp
>> mv -f .deps/RKBoot.Tpo .deps/RKBoot.Po
>> mv -f .deps/RKImage.Tpo .deps/RKImage.Po
>> mv -f .deps/RKLog.Tpo .deps/RKLog.Po
>> mv -f .deps/RKDevice.Tpo .deps/RKDevice.Po
>> mv -f .deps/RKComm.Tpo .deps/RKComm.Po
>> mv -f .deps/crc.Tpo .deps/crc.Po
>> mv -f .deps/RKScan.Tpo .deps/RKScan.Po
>> main.cpp: In function ‘bool _Z9mergeBootv.part.0()’:
>> main.cpp:1541:36: error: ‘%s’ directive output may be truncated writing up to 557 bytes into a region of size 5 [-Werror=format-truncation=]
>> 1541 | snprintf(buffer, sizeof(buffer), "%s", chip);
>> | ^~
>> ......
>> 1582 | chipType = convertChipType(chip + 2);
>> | ~~~~~~~~~~~~~~~~~~~~~~~~~
>> main.cpp:1541:10: note: ‘snprintf’ output between 1 and 558 bytes into a destination of size 5
>> 1541 | snprintf(buffer, sizeof(buffer), "%s", chip);
>> | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> cc1plus: all warnings being treated as errors
>> make[1]: *** [Makefile:473: main.o] Error 1
>> make[1]: Leaving directory '/tmp/guix-build-rkdeveloptool-1.3-0.6e92ebc.drv-0/source'
>> make: *** [Makefile:493: all-recursive] Error 1
>> error: in phase 'build': uncaught exception:
>> %exception #<&invoke-error program: "make" arguments: ("-j" "16") exit-status: 2 term-signal: #f stop-signal: #f>
>> phase `build' failed after 2.2 seconds
>> command "make" "-j" "16" failed with status 2
>> builder for `/gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv' failed with exit code 1
>> build of /gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv failed
>> View build log at '/var/log/guix/drvs/sr/ykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv.gz'.guix build: error: build of `/gnu/store/srykckhmy9lpdg2gl6702vs71b20apsj-rkdeveloptool-1.3-0.6e92ebc.drv' failed
>> ------- Original Message -------
>> On Monday, February 21st, 2022 at 1:43 PM, phodina <phodina@protonmail.com> wrote:
>>
>>> Hi,
>>>
>>> Here's fix of the rkdeveloptool package which fails to build due to GCC complaining about the truncation error.
>>>
>>> See https://github.com/rockchip-linux/rkdeveloptool/pull/62.
>>>
>>> ----
>>> Petr
Attachment: file
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 51043@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 51043
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch