Skip to contentSkip to conversation

mtd: parsers: scpart: fix __udivdi3 undefined on mips

PATCH Superseded Mikhail Zhilkin 1 participant 2 messages Dec 8, 2022 Memory technology devices (MTD)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: parsers: scpart: fix __udivdi3 undefined on mips

This fixes the following compile error on mips architecture with clang version 16.0.0 reported by the 0-DAY CI Kernel Test Service:
ld.lld: error: undefined symbol: __udivdi3
referenced by scpart.c mtd/parsers/scpart.o:(scpart_parse) in archive drivers/built-in.a

As a workaround this makes 'offs' a 32-bit type. This is enough, because the mtd containing partition table practically does not exceed 1 MB. We can revert this when the [Link] has been resolved.

Fixes 9b78ef0c7997 ("mtd: parsers: add support for Sercomm partitions")
---
 drivers/mtd/parsers/scpart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/parsers/scpart.c +0 -0
index 02601bb33de4..6e5e11c37078 100644
@@ -50,7 +50,7 @@ static int scpart_scan_partmap(struct mtd_info

*master, loff_t partmap_offs,
int cnt = 0;
int res = 0;
int res2;
- loff_t offs;
+ uint32_t offs;
size_t retlen;
struct sc_part_desc *pdesc = NULL;
struct sc_part_desc *tmpdesc;

Signature · 1 line
2.34.1
#1 lore raw

Hi guys,

I'm sorry. I noticed that the patch below is broken. For some time now I can't send patches using git-send-mail since the gmail changed the authentication process and I have to use Thunderbird. The Thunderbird broke the line in the patch.

I've already sent the PATCH v2.

Link:
https://lore.kernel.org/linux-mtd/[email protected]/

Have a nice day!

Signature · 2 lines
Best regards,
Mikhail
Quoted 33 lines · Mikhail Zhilkin

This fixes the following compile error on mips architecture with clang version 16.0.0 reported by the 0-DAY CI Kernel Test Service:
ld.lld: error: undefined symbol: __udivdi3
referenced by scpart.c mtd/parsers/scpart.o:(scpart_parse) in archive drivers/built-in.a

As a workaround this makes 'offs' a 32-bit type. This is enough, because the mtd containing partition table practically does not exceed 1 MB. We can revert this when the [Link] has been resolved.

Fixes 9b78ef0c7997 ("mtd: parsers: add support for Sercomm partitions")
---
 drivers/mtd/parsers/scpart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/parsers/scpart.c +1 -1
index 02601bb33de4..6e5e11c37078 100644
@@ -50,7 +50,7 @@ static int scpart_scan_partmap(struct mtd_info
 *master, loff_t partmap_offs,
 	int cnt = 0;
 	int res = 0;
 	int res2;
-	loff_t offs;
+	uint32_t offs;
 	size_t retlen;
 	struct sc_part_desc *pdesc = NULL;

struct sc_part_desc *tmpdesc;