* [PATCH 1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE
@ 2025-06-05 11:25 Ahmad Fatoum
2025-06-05 11:25 ` [PATCH 2/2] ci: add new musl-tools Github CI workflow Ahmad Fatoum
2025-06-05 11:54 ` [PATCH 1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE Sascha Hauer
0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2025-06-05 11:25 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
musl was found to define PAGE_SIZE on its own, which conflicts with the
definition we use in the host tool. Add a RK_ prefix for the
Rockchip-specific SECTOR_SIZE and PAGE_SIZE macros to avoid this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
scripts/rk-usb-loader.c | 4 ++--
scripts/rkimage.c | 4 ++--
scripts/rockchip.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/rk-usb-loader.c b/scripts/rk-usb-loader.c
index ad70cfe27147..2e0d5488deb9 100644
--- a/scripts/rk-usb-loader.c
+++ b/scripts/rk-usb-loader.c
@@ -266,8 +266,8 @@ static int upload_image(const char *filename)
log_info("Uploading %d/%d\n", i + 1, n_files);
- foffset = (entry->sector & 0xffff) * SECTOR_SIZE;
- fsize = (entry->sector >> 16) * SECTOR_SIZE;
+ foffset = (entry->sector & 0xffff) * RK_SECTOR_SIZE;
+ fsize = (entry->sector >> 16) * RK_SECTOR_SIZE;
log_debug("image starting at offset 0x%08x, size 0x%08x\n", foffset, fsize);
diff --git a/scripts/rkimage.c b/scripts/rkimage.c
index 551114ed8220..b31893fe8f45 100644
--- a/scripts/rkimage.c
+++ b/scripts/rkimage.c
@@ -82,7 +82,7 @@ static int create_newidb(struct newidb *idb)
struct rkcode *c = &code[i];
unsigned int image_sector;
- image_sector = c->size / SECTOR_SIZE;
+ image_sector = c->size / RK_SECTOR_SIZE;
entry->sector = (image_sector << 16) + image_offset;
entry->unknown_ffffffff = 0xffffffff;
@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
exit(1);
c->path = path;
- c->size = ALIGN(s.st_size, PAGE_SIZE);
+ c->size = ALIGN(s.st_size, RK_PAGE_SIZE);
c->buf = calloc(c->size, 1);
if (!c->buf)
exit(1);
diff --git a/scripts/rockchip.h b/scripts/rockchip.h
index 8cc14f8f2fbd..2d060fdefe90 100644
--- a/scripts/rockchip.h
+++ b/scripts/rockchip.h
@@ -29,7 +29,7 @@ struct newidb {
unsigned char hash[512];
};
-#define SECTOR_SIZE 512
-#define PAGE_SIZE 2048
+#define RK_SECTOR_SIZE 512
+#define RK_PAGE_SIZE 2048
#endif /* __ROCKCHIP_H */
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] ci: add new musl-tools Github CI workflow
2025-06-05 11:25 [PATCH 1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE Ahmad Fatoum
@ 2025-06-05 11:25 ` Ahmad Fatoum
2025-06-05 11:54 ` [PATCH 1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2025-06-05 11:25 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
To avoid noticing musl breakage when barebox is updated in
OpenEmbedded-core, let's add a CI test at our side as well.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
.github/workflows/musl-tools.yml | 39 ++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 .github/workflows/musl-tools.yml
diff --git a/.github/workflows/musl-tools.yml b/.github/workflows/musl-tools.yml
new file mode 100644
index 000000000000..52cdd184ade3
--- /dev/null
+++ b/.github/workflows/musl-tools.yml
@@ -0,0 +1,39 @@
+name: build tools against musl
+
+on: [push, pull_request]
+
+jobs:
+ musl-tools:
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/barebox/barebox/barebox-ci:latest
+ # allow mounting and devtmpfs in the container
+ options: --user=root --privileged -v /dev:/dev
+
+ strategy:
+ fail-fast: false
+ matrix:
+
+ include:
+ - defconfig: hosttools_defconfig
+ suffix:
+
+ - defconfig: targettools_defconfig
+ suffix: -target
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Build
+ id: build
+ run: |
+ export PKG_CONFIG='pkg-config --keep-system-libs'
+ export CROSS_PKG_CONFIG='pkg-config --keep-system-libs'
+
+ m () { make -j$(nproc) CC=musl-gcc LD=musl-gcc HOSTCC=musl-gcc HOSTLD=musl-ld "$@"; }
+
+ m ${{matrix.defconfig}}
+ m scripts/
+
+ test -n "$(musl-ldd scripts/imx/imx-usb-loader${{matrix.suffix}} 2>/dev/null | grep musl)"
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE
2025-06-05 11:25 [PATCH 1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE Ahmad Fatoum
2025-06-05 11:25 ` [PATCH 2/2] ci: add new musl-tools Github CI workflow Ahmad Fatoum
@ 2025-06-05 11:54 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-06-05 11:54 UTC (permalink / raw)
To: barebox, Ahmad Fatoum
On Thu, 05 Jun 2025 13:25:23 +0200, Ahmad Fatoum wrote:
> musl was found to define PAGE_SIZE on its own, which conflicts with the
> definition we use in the host tool. Add a RK_ prefix for the
> Rockchip-specific SECTOR_SIZE and PAGE_SIZE macros to avoid this.
>
>
Applied, thanks!
[1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE
https://git.pengutronix.de/cgit/barebox/commit/?id=bcd40b0c8355 (link may not be stable)
[2/2] ci: add new musl-tools Github CI workflow
https://git.pengutronix.de/cgit/barebox/commit/?id=7917f92642a8 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-05 11:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-05 11:25 [PATCH 1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE Ahmad Fatoum
2025-06-05 11:25 ` [PATCH 2/2] ci: add new musl-tools Github CI workflow Ahmad Fatoum
2025-06-05 11:54 ` [PATCH 1/2] scripts: rockchip: rename SECTOR_SIZE/PAGE_SIZE Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox