File: u-boot-sam460ex-build.patch

package info (click to toggle)
qemu 1%3A10.1.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 415,888 kB
  • sloc: ansic: 4,763,605; pascal: 115,173; python: 105,698; asm: 68,689; sh: 53,146; makefile: 27,519; perl: 18,863; cpp: 11,443; xml: 3,629; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (57 lines) | stat: -rw-r--r-- 2,236 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Sat, 03 Aug 2024 11:18:58 +0300
Subject: u-boot-sam460ex: build fixes
Forwarded: https://lists.nongnu.org/archive/html/qemu-devel/2025-01/msg00767.html

Fixes or works around numerous build issues and one real bug.

Most are due to new defaults in gcc (in debian), like
 -Werror=implicit-function-declarations (there are a lot of missing decls)
 -Werror=incompatible-pointer-types (function types mismatches)
 -Werror=int-conversion (free int <=> pointer conversion)

Bug-Debian: https://bugs.debian.org/1075428
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/roms/u-boot-sam460ex/board/ACube/Sam460ex/Sam460ex.c b/roms/u-boot-sam460ex/board/ACube/Sam460ex/Sam460ex.c
index 4d5b953c02..5ecf16dbe2 100644
--- a/roms/u-boot-sam460ex/board/ACube/Sam460ex/Sam460ex.c
+++ b/roms/u-boot-sam460ex/board/ACube/Sam460ex/Sam460ex.c
@@ -843,7 +843,7 @@ int last_stage_init (void)
 	// cleanup last 8 bytes of the RTC registers bank -----
 	
 	char arr[8] = { 0 };
-	i2c_write(0x68, 0x08, 1, &arr, 8);
+	i2c_write(0x68, 0x08, 1, arr, 8);
 	
 	// USB Init -------------------------------------------
 
diff --git a/roms/u-boot-sam460ex/common/usb.c b/roms/u-boot-sam460ex/common/usb.c
index 203c9f7795..d645d36c8e 100644
--- a/roms/u-boot-sam460ex/common/usb.c
+++ b/roms/u-boot-sam460ex/common/usb.c
@@ -957,7 +957,7 @@ void usb_scan_devices(void)
 		printf("%d USB Device(s) found\n", dev_index);
 		
 #ifdef CONFIG_SAM460EX
-	static attempts = 0;
+	static int attempts = 0;
 	
     if (dev_index < 3) {  
         u16 fpga_val = in_be16((void *)CONFIG_SYS_FPGA_BASE + 0x2E);
diff --git a/roms/u-boot-sam460ex/config.mk b/roms/u-boot-sam460ex/config.mk
index bcda77611a..9928f5f4c6 100644
--- a/roms/u-boot-sam460ex/config.mk
+++ b/roms/u-boot-sam460ex/config.mk
@@ -191,6 +191,11 @@ endif
 
 CFLAGS += $(call cc-option,-fno-stack-protector)
 
+# this u-boot is an old bad code
+CFLAGS += $(call cc-option,-Wno-error=implicit-function-declaration)
+CFLAGS += $(call cc-option,-Wno-error=incompatible-pointer-types)
+CFLAGS += $(call cc-option,-Wno-error=int-conversion)
+
 # $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
 # option to the assembler.
 AFLAGS_DEBUG :=