netsurf: branch master updated. release/3.10-261-g8b7bbb4
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/8b7bbb415828c72ba1719...
...commit http://git.netsurf-browser.org/netsurf.git/commit/8b7bbb415828c72ba1719d7...
...tree http://git.netsurf-browser.org/netsurf.git/tree/8b7bbb415828c72ba1719d7ed...
The branch, master has been updated
via 8b7bbb415828c72ba1719d7ed210772ff7cc4dc8 (commit)
from 1577d000501894217f59da389f9c08f2d8566f42 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=8b7bbb415828c72ba17...
commit 8b7bbb415828c72ba1719d7ed210772ff7cc4dc8
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Bitmap: Remove misleading format documentation.
diff --git a/include/netsurf/bitmap.h b/include/netsurf/bitmap.h
index 25923da..10e9a07 100644
--- a/include/netsurf/bitmap.h
+++ b/include/netsurf/bitmap.h
@@ -20,35 +20,13 @@
* \file
* Generic bitmap handling interface.
*
- * This interface wraps the native platform-specific image format, so that
- * portable image convertors can be written.
+ * This interface wraps the native platform-specific image format.
*
- * Bitmaps are required to be 32bpp with components in the order RR GG BB AA.
+ * Bitmaps are required to be 32bpp with 8-bit components. The components are
+ * red, green, blue, and alpha, in client specified order.
*
- * For example, an opaque 1x1 pixel image would yield the following bitmap
- * data:
- *
- * > Red : 0xff 0x00 0x00 0x00
- * > Green: 0x00 0xff 0x00 0x00
- * > Blue : 0x00 0x00 0xff 0x00
- *
- * Any attempt to read pixels by casting bitmap data to uint32_t or similar
- * will need to cater for the order of bytes in a word being different on
- * big and little endian systems. To avoid confusion, it is recommended
- * that pixel data is loaded as follows:
- *
- * uint32_t read_pixel(const uint8_t *bmp)
- * {
- * // red green blue alpha
- * return bmp[0] | (bmp[1] << 8) | (bmp[2] << 16) | (bmp[3] << 24);
- * }
- *
- * and *not* as follows:
- *
- * uint32_t read_pixel(const uint8_t *bmp)
- * {
- * return *((uint32_t *) bmp);
- * }
+ * The component order may be set in the front ends by calling
+ * \ref bitmap_set_format().
*/
#ifndef _NETSURF_BITMAP_H_
-----------------------------------------------------------------------
Summary of changes:
include/netsurf/bitmap.h | 32 +++++---------------------------
1 file changed, 5 insertions(+), 27 deletions(-)
diff --git a/include/netsurf/bitmap.h b/include/netsurf/bitmap.h
index 25923da..10e9a07 100644
--- a/include/netsurf/bitmap.h
+++ b/include/netsurf/bitmap.h
@@ -20,35 +20,13 @@
* \file
* Generic bitmap handling interface.
*
- * This interface wraps the native platform-specific image format, so that
- * portable image convertors can be written.
+ * This interface wraps the native platform-specific image format.
*
- * Bitmaps are required to be 32bpp with components in the order RR GG BB AA.
+ * Bitmaps are required to be 32bpp with 8-bit components. The components are
+ * red, green, blue, and alpha, in client specified order.
*
- * For example, an opaque 1x1 pixel image would yield the following bitmap
- * data:
- *
- * > Red : 0xff 0x00 0x00 0x00
- * > Green: 0x00 0xff 0x00 0x00
- * > Blue : 0x00 0x00 0xff 0x00
- *
- * Any attempt to read pixels by casting bitmap data to uint32_t or similar
- * will need to cater for the order of bytes in a word being different on
- * big and little endian systems. To avoid confusion, it is recommended
- * that pixel data is loaded as follows:
- *
- * uint32_t read_pixel(const uint8_t *bmp)
- * {
- * // red green blue alpha
- * return bmp[0] | (bmp[1] << 8) | (bmp[2] << 16) | (bmp[3] << 24);
- * }
- *
- * and *not* as follows:
- *
- * uint32_t read_pixel(const uint8_t *bmp)
- * {
- * return *((uint32_t *) bmp);
- * }
+ * The component order may be set in the front ends by calling
+ * \ref bitmap_set_format().
*/
#ifndef _NETSURF_BITMAP_H_
--
NetSurf Browser
1 year, 3 months
netsurf: branch master updated. release/3.10-260-g1577d00
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/1577d000501894217f59d...
...commit http://git.netsurf-browser.org/netsurf.git/commit/1577d000501894217f59da3...
...tree http://git.netsurf-browser.org/netsurf.git/tree/1577d000501894217f59da389...
The branch, master has been updated
via 1577d000501894217f59da389f9c08f2d8566f42 (commit)
from cd76c45e9ec422b63929ab386758b651df73ca45 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1577d000501894217f5...
commit 1577d000501894217f59da389f9c08f2d8566f42
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
RISC OS: fix awrender glue for EABI
The only hand-written asm is the glue to Artworks Render. Update
it to be ABI compliant when building for EABI and force the
alignment of the data in the .bss section (as unaligned rotated
loads are really not a thing).
No functional change for non-EABI builds but, as the stack framing
differs depending on the ABI in use, we can no longer reliably use
fp as the base pointer for on-stack function arguments to
awrender_render. Thus, this has been reworked to use ip as the
pointer instead and to also use r8/r9 to relieve excess register
pressure.
diff --git a/frontends/riscos/content-handlers/awrender.s b/frontends/riscos/content-handlers/awrender.s
index 5bcafe5..fe37f66 100644
--- a/frontends/riscos/content-handlers/awrender.s
+++ b/frontends/riscos/content-handlers/awrender.s
@@ -209,12 +209,18 @@ errblk % 256
@ os_error *awrender_init(byte **doc, size_t *doc_size, void *init_routine, void *init_workspace);
.global awrender_init
-awrender_init: MOV ip,sp
+awrender_init:
+#ifndef __ARM_EABI__
+ MOV ip,sp
STMFD sp!,{a1,a2,v1,v2,fp,ip,lr,pc}
SUB fp,ip,#4
SUB ip,sp,#512
CMP ip,sl
BLMI __rt_stkovf_split_big
+#else
+ STMFD sp!,{a1,a2,v1,v2,fp,lr}
+ ADD fp,sp,#4*4
+#endif
LDR v2,=aw_temp
LDR a1,[a1]
@@ -235,14 +241,18 @@ awrender_init: MOV ip,sp
@ return updated block ptr & size to caller
- LDR a2,[fp,#-28]
- LDR a3,[fp,#-24]
+ LDR a2,[sp],#4
+ LDR a3,[sp],#4
LDR ip,[v2,#aw_rsz_block]
LDR lr,[v2,#aw_rsz_size]
STR ip,[a2]
STR lr,[a3]
- LDMEA fp,{v1,v2,fp,sp,pc}
+#ifndef __ARM_EABI__
+ LDMDB fp,{v1,v2,fp,sp,pc}
+#else
+ LDMIA sp!,{v1,v2,fp,pc}
+#endif
@ os_error *awrender_render(const char *doc,
@@ -258,37 +268,46 @@ awrender_init: MOV ip,sp
@ void *workspace);
.global awrender_render
-awrender_render: MOV ip,sp
- STMFD sp!,{v1-v4,fp,ip,lr,pc}
+awrender_render:
+#ifndef __ARM_EABI__
+ MOV ip,sp
+ STMFD sp!,{v1-v6,fp,ip,lr,pc}
SUB fp,ip,#4
SUB ip,sp,#512
CMP ip,sl
BLMI __rt_stkovf_split_big
+ ADD ip,fp,#4 @ ip -> stacked args
+#else
+ MOV ip,sp @ ip -> stacked args
+ STMFD sp!,{v1-v6,fp,lr}
+ ADD fp,sp,#6*4
+#endif
- LDR R12,[fp,#20]
LDR R14,=aw_temp
- LDR R5,[fp,#4]
- LDR R6,[fp,#12]
+ LDR R5,[ip,#0] @ rsz_block
+ LDR R6,[ip,#8] @ wysiwyg_setting
LDR R4,[R5] @ resizable block
- LDR R7,[fp,#16]
+ LDR R7,[ip,#12] @ output_dest
+ LDR R8,[ip,#16] @ doc_size
+ LDR R9,[ip,#4] @ rsz_size
STR R4,[R14,#aw_rsz_block]
STR R0,[R14,#aw_fixed_block] @ document ptr
- STR R12,[R14,#aw_fixed_size] @ document size
- LDR R12,[fp,#8]
+ STR R8,[R14,#aw_fixed_size] @ document size
STR R5,[sp,#-4]! @ ptr to receive block
- STR R12,[sp,#-4]! @ ptr to receive size
+ STR R9,[sp,#-4]! @ ptr to receive size
- LDR R12,[R12]
+ LDR R9,[R9]
ADR R5,aw_callback
- STR R12,[R14,#aw_rsz_size]
+ STR R9,[R14,#aw_rsz_size]
STR sl,[R14,#aw_sl]
STR fp,[R14,#aw_fp]
- LDR R12,[fp,#28]
+ LDR R8,[ip,#20] @ routine
+ LDR R12,[ip,#24] @ workspace
MOV lr,pc
- LDR pc,[fp,#24]
+ MOV pc,R8
MOVVC a1,#0
@ return updated block ptr & size to caller
@@ -301,7 +320,11 @@ awrender_render: MOV ip,sp
STR R5,[R12]
STR R6,[R4]
- LDMEA fp,{v1-v4,fp,sp,pc}
+#ifndef __ARM_EABI__
+ LDMDB fp,{v1-v6,fp,sp,pc}
+#else
+ LDMIA sp!,{v1-v6,fp,pc}
+#endif
@ Callback routine for block resizing
@@ -340,11 +363,18 @@ aw_callback: TEQ R11,#3
CMP R1,R2
BLS aw_read
- STMFD R13!,{R1,R10-R12,R14}
+ STMFD R13!,{R1,R4,R10-R12,R14}
+#ifdef __ARM_EABI__
+ MOV R4,R13 @ save original sp
+ BIC R13,R13,#7 @ align to multiple of 8
+#endif
LDR sl,[R11,#aw_sl]
LDR fp,[R11,#aw_fp]
BL realloc
- LDMFD R13!,{R1,R10-R12,R14}
+#ifdef __ARM_EABI__
+ MOV R13,R4 @ restore unaligned sp
+#endif
+ LDMFD R13!,{R1,R4,R10-R12,R14}
CMP R0,#0 @ did it work?
BEQ aw_nomem
@@ -359,7 +389,11 @@ aw_read: @ return details of fixed block
SUBS R11,R11,R11 @ clear V
MOV PC,R14
-aw_nomem: STMFD R13!,{R10,R12,R14}
+aw_nomem: STMFD R13!,{R4,R10,R12,R14}
+#ifdef __ARM_EABI__
+ MOV R4,R13 @ save original sp
+ BIC R13,R13,#7 @ align to multiple of 8
+#endif
LDR sl,[R11,#aw_sl]
LDR fp,[R11,#aw_fp]
ADR R0,tok_nomem
@@ -370,13 +404,17 @@ aw_nomem: STMFD R13!,{R10,R12,R14}
SUB R0,R0,#4 @ error number already 0
MOV R11,#0 @ restore reason code
CMP PC,#1<<31 @ set V
- LDMFD R13!,{R10,R12,PC}
+#ifdef __ARM_EABI__
+ MOV R13,R4 @ restore original sp
+#endif
+ LDMFD R13!,{R4,R10,R12,PC}
tok_nomem: .asciz "NoMemory"
.align
.bss
+ .align
aw_temp: .space sizeof_aw
.type aw_temp, %object
.size aw_temp, . - aw_temp
-----------------------------------------------------------------------
Summary of changes:
frontends/riscos/content-handlers/awrender.s | 82 +++++++++++++++++++-------
1 file changed, 60 insertions(+), 22 deletions(-)
diff --git a/frontends/riscos/content-handlers/awrender.s b/frontends/riscos/content-handlers/awrender.s
index 5bcafe5..fe37f66 100644
--- a/frontends/riscos/content-handlers/awrender.s
+++ b/frontends/riscos/content-handlers/awrender.s
@@ -209,12 +209,18 @@ errblk % 256
@ os_error *awrender_init(byte **doc, size_t *doc_size, void *init_routine, void *init_workspace);
.global awrender_init
-awrender_init: MOV ip,sp
+awrender_init:
+#ifndef __ARM_EABI__
+ MOV ip,sp
STMFD sp!,{a1,a2,v1,v2,fp,ip,lr,pc}
SUB fp,ip,#4
SUB ip,sp,#512
CMP ip,sl
BLMI __rt_stkovf_split_big
+#else
+ STMFD sp!,{a1,a2,v1,v2,fp,lr}
+ ADD fp,sp,#4*4
+#endif
LDR v2,=aw_temp
LDR a1,[a1]
@@ -235,14 +241,18 @@ awrender_init: MOV ip,sp
@ return updated block ptr & size to caller
- LDR a2,[fp,#-28]
- LDR a3,[fp,#-24]
+ LDR a2,[sp],#4
+ LDR a3,[sp],#4
LDR ip,[v2,#aw_rsz_block]
LDR lr,[v2,#aw_rsz_size]
STR ip,[a2]
STR lr,[a3]
- LDMEA fp,{v1,v2,fp,sp,pc}
+#ifndef __ARM_EABI__
+ LDMDB fp,{v1,v2,fp,sp,pc}
+#else
+ LDMIA sp!,{v1,v2,fp,pc}
+#endif
@ os_error *awrender_render(const char *doc,
@@ -258,37 +268,46 @@ awrender_init: MOV ip,sp
@ void *workspace);
.global awrender_render
-awrender_render: MOV ip,sp
- STMFD sp!,{v1-v4,fp,ip,lr,pc}
+awrender_render:
+#ifndef __ARM_EABI__
+ MOV ip,sp
+ STMFD sp!,{v1-v6,fp,ip,lr,pc}
SUB fp,ip,#4
SUB ip,sp,#512
CMP ip,sl
BLMI __rt_stkovf_split_big
+ ADD ip,fp,#4 @ ip -> stacked args
+#else
+ MOV ip,sp @ ip -> stacked args
+ STMFD sp!,{v1-v6,fp,lr}
+ ADD fp,sp,#6*4
+#endif
- LDR R12,[fp,#20]
LDR R14,=aw_temp
- LDR R5,[fp,#4]
- LDR R6,[fp,#12]
+ LDR R5,[ip,#0] @ rsz_block
+ LDR R6,[ip,#8] @ wysiwyg_setting
LDR R4,[R5] @ resizable block
- LDR R7,[fp,#16]
+ LDR R7,[ip,#12] @ output_dest
+ LDR R8,[ip,#16] @ doc_size
+ LDR R9,[ip,#4] @ rsz_size
STR R4,[R14,#aw_rsz_block]
STR R0,[R14,#aw_fixed_block] @ document ptr
- STR R12,[R14,#aw_fixed_size] @ document size
- LDR R12,[fp,#8]
+ STR R8,[R14,#aw_fixed_size] @ document size
STR R5,[sp,#-4]! @ ptr to receive block
- STR R12,[sp,#-4]! @ ptr to receive size
+ STR R9,[sp,#-4]! @ ptr to receive size
- LDR R12,[R12]
+ LDR R9,[R9]
ADR R5,aw_callback
- STR R12,[R14,#aw_rsz_size]
+ STR R9,[R14,#aw_rsz_size]
STR sl,[R14,#aw_sl]
STR fp,[R14,#aw_fp]
- LDR R12,[fp,#28]
+ LDR R8,[ip,#20] @ routine
+ LDR R12,[ip,#24] @ workspace
MOV lr,pc
- LDR pc,[fp,#24]
+ MOV pc,R8
MOVVC a1,#0
@ return updated block ptr & size to caller
@@ -301,7 +320,11 @@ awrender_render: MOV ip,sp
STR R5,[R12]
STR R6,[R4]
- LDMEA fp,{v1-v4,fp,sp,pc}
+#ifndef __ARM_EABI__
+ LDMDB fp,{v1-v6,fp,sp,pc}
+#else
+ LDMIA sp!,{v1-v6,fp,pc}
+#endif
@ Callback routine for block resizing
@@ -340,11 +363,18 @@ aw_callback: TEQ R11,#3
CMP R1,R2
BLS aw_read
- STMFD R13!,{R1,R10-R12,R14}
+ STMFD R13!,{R1,R4,R10-R12,R14}
+#ifdef __ARM_EABI__
+ MOV R4,R13 @ save original sp
+ BIC R13,R13,#7 @ align to multiple of 8
+#endif
LDR sl,[R11,#aw_sl]
LDR fp,[R11,#aw_fp]
BL realloc
- LDMFD R13!,{R1,R10-R12,R14}
+#ifdef __ARM_EABI__
+ MOV R13,R4 @ restore unaligned sp
+#endif
+ LDMFD R13!,{R1,R4,R10-R12,R14}
CMP R0,#0 @ did it work?
BEQ aw_nomem
@@ -359,7 +389,11 @@ aw_read: @ return details of fixed block
SUBS R11,R11,R11 @ clear V
MOV PC,R14
-aw_nomem: STMFD R13!,{R10,R12,R14}
+aw_nomem: STMFD R13!,{R4,R10,R12,R14}
+#ifdef __ARM_EABI__
+ MOV R4,R13 @ save original sp
+ BIC R13,R13,#7 @ align to multiple of 8
+#endif
LDR sl,[R11,#aw_sl]
LDR fp,[R11,#aw_fp]
ADR R0,tok_nomem
@@ -370,13 +404,17 @@ aw_nomem: STMFD R13!,{R10,R12,R14}
SUB R0,R0,#4 @ error number already 0
MOV R11,#0 @ restore reason code
CMP PC,#1<<31 @ set V
- LDMFD R13!,{R10,R12,PC}
+#ifdef __ARM_EABI__
+ MOV R13,R4 @ restore original sp
+#endif
+ LDMFD R13!,{R4,R10,R12,PC}
tok_nomem: .asciz "NoMemory"
.align
.bss
+ .align
aw_temp: .space sizeof_aw
.type aw_temp, %object
.size aw_temp, . - aw_temp
--
NetSurf Browser
1 year, 3 months
toolchains: branch jmb/arm-riscos-gnueabihf updated. 0c7fc8e52cefbe787bc5f33dcc9ae95ef3a5247c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/0c7fc8e52cefbe787b...
...commit http://git.netsurf-browser.org/toolchains.git/commit/0c7fc8e52cefbe787bc5...
...tree http://git.netsurf-browser.org/toolchains.git/tree/0c7fc8e52cefbe787bc5f3...
The branch, jmb/arm-riscos-gnueabihf has been updated
via 0c7fc8e52cefbe787bc5f33dcc9ae95ef3a5247c (commit)
from 6cdc74a08eda519b862d93ad3cc549a0c055849e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/toolchains.git/commit/?id=0c7fc8e52cefbe78...
commit 0c7fc8e52cefbe787bc5f33dcc9ae95ef3a5247c
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Fix unixlib-stdtime.p
Previous attempt contained unrelated detritus already present in
posix-extended-locale.p
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
index fcdc7f3..3ad890a 100644
--- a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
@@ -15,12 +15,3 @@ Index: libunixlib/time/stdtime.c
: "r" (territory), "r" (ro_time), "r" (buf), "r" (size), "r" (str),
[SWI_Territory_ConvertDateAndTime] "i" (Territory_ConvertDateAndTime | (1<<17))
: "r14", "cc", "memory");
-@@ -48,7 +50,7 @@
- #ifdef __TARGET_SCL__
- -1,
- #else
-- __locale_territory[LC_TIME],
-+ __locale_global.locale_territory[LC_TIME],
- #endif
- riscos_time,
- result,
-----------------------------------------------------------------------
Summary of changes:
arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
index fcdc7f3..3ad890a 100644
--- a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
@@ -15,12 +15,3 @@ Index: libunixlib/time/stdtime.c
: "r" (territory), "r" (ro_time), "r" (buf), "r" (size), "r" (str),
[SWI_Territory_ConvertDateAndTime] "i" (Territory_ConvertDateAndTime | (1<<17))
: "r14", "cc", "memory");
-@@ -48,7 +50,7 @@
- #ifdef __TARGET_SCL__
- -1,
- #else
-- __locale_territory[LC_TIME],
-+ __locale_global.locale_territory[LC_TIME],
- #endif
- riscos_time,
- result,
--
Cross-compilation toolchains and environments
1 year, 3 months
toolchains: branch jmb/arm-riscos-gnueabihf updated. 6cdc74a08eda519b862d93ad3cc549a0c055849e
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/6cdc74a08eda519b86...
...commit http://git.netsurf-browser.org/toolchains.git/commit/6cdc74a08eda519b862d...
...tree http://git.netsurf-browser.org/toolchains.git/tree/6cdc74a08eda519b862d93...
The branch, jmb/arm-riscos-gnueabihf has been updated
via 6cdc74a08eda519b862d93ad3cc549a0c055849e (commit)
from 1853c8c1efc7fd269c853793e79b092160fe4bdd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/toolchains.git/commit/?id=6cdc74a08eda519b...
commit 6cdc74a08eda519b862d93ad3cc549a0c055849e
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Fix __standard_time()
Territory_ConvertDateAndTime modifies r0-r3. Previously, UnixLib
was only telling the compiler that r0 and r1 were modified. This
resulted in the register allocator assuming that the value of r2
on exit was the same as it was on entry and thus returning a
completely garbage value as the result of __standard_time().
Resolve this by telling the compiler the full facts.
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
new file mode 100644
index 0000000..fcdc7f3
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
@@ -0,0 +1,26 @@
+Index: libunixlib/time/stdtime.c
+===================================================================
+--- libunixlib/time/stdtime.c (revision 7698)
++++ libunixlib/time/stdtime.c (working copy)
+@@ -23,9 +23,11 @@
+ register const char *str __asm ("r4") = __str;
+ register const _kernel_oserror *err __asm ("r0");
+ register char *term __asm ("r1");
++ register size_t left __asm ("r2");
++ register const char *ostr __asm ("r3");
+ __asm__ volatile ("SWI\t%[SWI_Territory_ConvertDateAndTime]\n\t"
+ "MOVVC\tr0, #0\n\t"
+- : "=r" (err), "=r" (term)
++ : "=r" (err), "=r" (term), "=r" (left), "=r" (ostr)
+ : "r" (territory), "r" (ro_time), "r" (buf), "r" (size), "r" (str),
+ [SWI_Territory_ConvertDateAndTime] "i" (Territory_ConvertDateAndTime | (1<<17))
+ : "r14", "cc", "memory");
+@@ -48,7 +50,7 @@
+ #ifdef __TARGET_SCL__
+ -1,
+ #else
+- __locale_territory[LC_TIME],
++ __locale_global.locale_territory[LC_TIME],
+ #endif
+ riscos_time,
+ result,
-----------------------------------------------------------------------
Summary of changes:
.../recipes/patches/gccsdk/unixlib-stdtime.p | 26 ++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
new file mode 100644
index 0000000..fcdc7f3
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-stdtime.p
@@ -0,0 +1,26 @@
+Index: libunixlib/time/stdtime.c
+===================================================================
+--- libunixlib/time/stdtime.c (revision 7698)
++++ libunixlib/time/stdtime.c (working copy)
+@@ -23,9 +23,11 @@
+ register const char *str __asm ("r4") = __str;
+ register const _kernel_oserror *err __asm ("r0");
+ register char *term __asm ("r1");
++ register size_t left __asm ("r2");
++ register const char *ostr __asm ("r3");
+ __asm__ volatile ("SWI\t%[SWI_Territory_ConvertDateAndTime]\n\t"
+ "MOVVC\tr0, #0\n\t"
+- : "=r" (err), "=r" (term)
++ : "=r" (err), "=r" (term), "=r" (left), "=r" (ostr)
+ : "r" (territory), "r" (ro_time), "r" (buf), "r" (size), "r" (str),
+ [SWI_Territory_ConvertDateAndTime] "i" (Territory_ConvertDateAndTime | (1<<17))
+ : "r14", "cc", "memory");
+@@ -48,7 +50,7 @@
+ #ifdef __TARGET_SCL__
+ -1,
+ #else
+- __locale_territory[LC_TIME],
++ __locale_global.locale_territory[LC_TIME],
+ #endif
+ riscos_time,
+ result,
--
Cross-compilation toolchains and environments
1 year, 3 months
toolchains: branch jmb/arm-riscos-gnueabihf updated. 1853c8c1efc7fd269c853793e79b092160fe4bdd
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/1853c8c1efc7fd269c...
...commit http://git.netsurf-browser.org/toolchains.git/commit/1853c8c1efc7fd269c85...
...tree http://git.netsurf-browser.org/toolchains.git/tree/1853c8c1efc7fd269c8537...
The branch, jmb/arm-riscos-gnueabihf has been updated
via 1853c8c1efc7fd269c853793e79b092160fe4bdd (commit)
via f5e946d3a4215693381acee1da1ecfc56b2942bc (commit)
from 7f53178a4cdbed363328a5fa60bead742bd628aa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/toolchains.git/commit/?id=1853c8c1efc7fd26...
commit 1853c8c1efc7fd269c853793e79b092160fe4bdd
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Use UnixLib's atomics implementation
Stop libgcc pulling in the atomics implementation for Linux. This
does not work on RISC OS and will result in unexpected aborts
deep in application code.
Additionally, enable the __sync_fetch_and_<op>_<size> atomics
when building UnixLib for EABI. It's not clear why these were
disabled, but things that need them will fail to link if they
are not present.
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/gcc-libgcc-no-linux-atomics.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/gcc-libgcc-no-linux-atomics.p
new file mode 100644
index 0000000..12a88ac
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/gcc-libgcc-no-linux-atomics.p
@@ -0,0 +1,56 @@
+Index: gcc/libgcc.config.arm.t-riscos-gnueabihf
+===================================================================
+--- gcc/libgcc.config.arm.t-riscos-gnueabihf (revision 7698)
++++ gcc/libgcc.config.arm.t-riscos-gnueabihf (working copy)
+@@ -1,36 +1,2 @@
+-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+-# Contributed by John Tytgat (John.Tytgat(a)aaug.net).
+-#
+-# This file is part of GCC.
+-#
+-# GCC is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 3, or (at your option)
+-# any later version.
+-#
+-# GCC is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with GCC; see the file COPYING3. If not see
+-# <http://www.gnu.org/licenses/>.
+-
+-# vvv Part of config/arm/t-bpabi
+-LIB2ADD_ST += $(srcdir)/config/arm/fp16.c
+-
+-LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
+- $(srcdir)/config/arm/libunwind.S \
+- $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
+-# ^^^
+-
+-ifeq (,$(findstring mlibscl,$(CFLAGS))$(findstring mmodule,$(CFLAGS)))
+-# For shared libgcc building:
+-EXTRA_PARTS += crtbeginS.o crtendS.o
+-gcc_s_compile += -fPIC
+-SHLIB_LDFLAGS=-fPIC
+-include $(srcdir)/config/t-slibgcc
+-include $(srcdir)/config/t-slibgcc-nolc-override
+-endif
+-
++# Use a version of div0 which raises SIGFPE, and a special __clear_cache.
++LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx _clear_cache
+Index: gcc/libgcc.config.host.p
+===================================================================
+--- gcc/libgcc.config.host.p (revision 7698)
++++ gcc/libgcc.config.host.p (working copy)
+@@ -20,7 +20,7 @@
+ ;;
+ +arm*-riscos-gnueabihf)
+ + tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"
+-+ tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc t-slibgcc-nolc-override"
+++ tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-riscos-gnueabihf t-slibgcc-libgcc t-slibgcc-nolc-override"
+ + tm_file="$tm_file arm/bpabi-lib.h"
+ + unwind_header=config/arm/unwind-arm.h
+ + tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-sync-and-fetch-atomics.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-sync-and-fetch-atomics.p
new file mode 100644
index 0000000..f9764ba
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-sync-and-fetch-atomics.p
@@ -0,0 +1,22 @@
+Index: libunixlib/gcccompat/atomics.c
+===================================================================
+--- libunixlib/gcccompat/atomics.c (revision 7698)
++++ libunixlib/gcccompat/atomics.c (working copy)
+@@ -146,8 +146,6 @@
+ ATOMIC_COMPARE_AND_EXCHANGE(4,uint32_t)
+ ATOMIC_COMPARE_AND_EXCHANGE(8,uint64_t)
+
+-#ifndef __ARM_EABI__
+-
+ /* These built-in functions perform the operation suggested by the name,
+ * and return the value that had previously been in *ptr. That is,
+ *
+@@ -200,8 +198,6 @@
+ SYNC_FETCH_AND_OP(xor,^,8,long long)
+ SYNC_FETCH_AND_OP(and,&,8,long long)
+
+-#endif
+-
+ /* These built-in functions perform the operation suggested by the name,
+ * and return the new value. That is,
+ *
commitdiff http://git.netsurf-browser.org/toolchains.git/commit/?id=f5e946d3a4215693...
commit f5e946d3a4215693381acee1da1ecfc56b2942bc
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Revert "Fix stack backtraces from UnixLib"
This reverts commit 7f53178a4cdbed363328a5fa60bead742bd628aa.
It turns out that the situation with stack frames in the EABI
toolchain is currently completely inconsistent. Some functions
end up with APCS-32 stack frames, others with AAPCS frames. It
is not reliably possible to distinguish which is which when
unwinding the stack to generate a backtrace. It also means that
the signal stack frame created in _signal.s would need to reflect
whatever reality made sense for the function that aborted.
Give up.
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
deleted file mode 100644
index 2c971cd..0000000
--- a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
+++ /dev/null
@@ -1,37 +0,0 @@
---- libunixlib/signal/post.c 2021-06-15 21:42:03.000000000 +0100
-+++ libunixlib/signal/post.c 2022-06-03 19:52:18.316234729 +0100
-@@ -307,6 +307,7 @@
- }
-
- #ifdef __ARM_EABI__
-+ const unsigned int *pc = NULL;
- const unsigned int * const lr = (unsigned int *)fp[LR_OFFSET];
- fprintf (stderr, " (%8x) lr: %8x",
- (unsigned int)fp, (unsigned int)lr);
-@@ -350,7 +351,6 @@
- #endif
- oldfp = fp;
- fp = (const unsigned int *)fp[FP_OFFSET];
--#ifndef __ARM_EABI__
- if (__ul_callbackfp != NULL && fp == __ul_callbackfp)
- {
- /* At &oldfp[1] = cpsr, a1-a4, v1-v6, sl, fp, ip, sp, lr, pc */
-@@ -424,7 +424,6 @@
-
- fputs ("\n\n", stderr);
- }
--#endif
- }
-
- fputc ('\n', stderr);
---- libunixlib/signal/_signal.s 2020-05-31 20:11:06.000000000 +0100
-+++ libunixlib/signal/_signal.s 2022-06-03 19:45:32.872892834 +0100
-@@ -761,7 +761,7 @@
- LDR a3, [sp, #14*4 + 4] @ saved USR lr
- LDR a1, [sp, #11*4 + 4] @ saved USR fp
- STMFD sp!, {a1, a3} @ create signal frame
-- MOV fp, sp @ FIXME: check this with compiler output for similar function
-+ ADD fp, sp, #4 @ FIXME: check this with compiler output for similar function
- #else
- @ Create an APCS-32 compilant signal stack frame
- ADR a4, __h_cback + 4*3 @ point at handler name for backtrace
-----------------------------------------------------------------------
Summary of changes:
.../patches/gccsdk/gcc-libgcc-no-linux-atomics.p | 56 ++++++++++++++++++++
.../recipes/patches/gccsdk/unixlib-backtrace.p | 37 -------------
.../gccsdk/unixlib-sync-and-fetch-atomics.p | 22 ++++++++
3 files changed, 78 insertions(+), 37 deletions(-)
create mode 100644 arm-riscos-gnueabihf/recipes/patches/gccsdk/gcc-libgcc-no-linux-atomics.p
delete mode 100644 arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
create mode 100644 arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-sync-and-fetch-atomics.p
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/gcc-libgcc-no-linux-atomics.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/gcc-libgcc-no-linux-atomics.p
new file mode 100644
index 0000000..12a88ac
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/gcc-libgcc-no-linux-atomics.p
@@ -0,0 +1,56 @@
+Index: gcc/libgcc.config.arm.t-riscos-gnueabihf
+===================================================================
+--- gcc/libgcc.config.arm.t-riscos-gnueabihf (revision 7698)
++++ gcc/libgcc.config.arm.t-riscos-gnueabihf (working copy)
+@@ -1,36 +1,2 @@
+-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+-# Contributed by John Tytgat (John.Tytgat(a)aaug.net).
+-#
+-# This file is part of GCC.
+-#
+-# GCC is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 3, or (at your option)
+-# any later version.
+-#
+-# GCC is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with GCC; see the file COPYING3. If not see
+-# <http://www.gnu.org/licenses/>.
+-
+-# vvv Part of config/arm/t-bpabi
+-LIB2ADD_ST += $(srcdir)/config/arm/fp16.c
+-
+-LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
+- $(srcdir)/config/arm/libunwind.S \
+- $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
+-# ^^^
+-
+-ifeq (,$(findstring mlibscl,$(CFLAGS))$(findstring mmodule,$(CFLAGS)))
+-# For shared libgcc building:
+-EXTRA_PARTS += crtbeginS.o crtendS.o
+-gcc_s_compile += -fPIC
+-SHLIB_LDFLAGS=-fPIC
+-include $(srcdir)/config/t-slibgcc
+-include $(srcdir)/config/t-slibgcc-nolc-override
+-endif
+-
++# Use a version of div0 which raises SIGFPE, and a special __clear_cache.
++LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx _clear_cache
+Index: gcc/libgcc.config.host.p
+===================================================================
+--- gcc/libgcc.config.host.p (revision 7698)
++++ gcc/libgcc.config.host.p (working copy)
+@@ -20,7 +20,7 @@
+ ;;
+ +arm*-riscos-gnueabihf)
+ + tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"
+-+ tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc t-slibgcc-nolc-override"
+++ tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-riscos-gnueabihf t-slibgcc-libgcc t-slibgcc-nolc-override"
+ + tm_file="$tm_file arm/bpabi-lib.h"
+ + unwind_header=config/arm/unwind-arm.h
+ + tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
deleted file mode 100644
index 2c971cd..0000000
--- a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
+++ /dev/null
@@ -1,37 +0,0 @@
---- libunixlib/signal/post.c 2021-06-15 21:42:03.000000000 +0100
-+++ libunixlib/signal/post.c 2022-06-03 19:52:18.316234729 +0100
-@@ -307,6 +307,7 @@
- }
-
- #ifdef __ARM_EABI__
-+ const unsigned int *pc = NULL;
- const unsigned int * const lr = (unsigned int *)fp[LR_OFFSET];
- fprintf (stderr, " (%8x) lr: %8x",
- (unsigned int)fp, (unsigned int)lr);
-@@ -350,7 +351,6 @@
- #endif
- oldfp = fp;
- fp = (const unsigned int *)fp[FP_OFFSET];
--#ifndef __ARM_EABI__
- if (__ul_callbackfp != NULL && fp == __ul_callbackfp)
- {
- /* At &oldfp[1] = cpsr, a1-a4, v1-v6, sl, fp, ip, sp, lr, pc */
-@@ -424,7 +424,6 @@
-
- fputs ("\n\n", stderr);
- }
--#endif
- }
-
- fputc ('\n', stderr);
---- libunixlib/signal/_signal.s 2020-05-31 20:11:06.000000000 +0100
-+++ libunixlib/signal/_signal.s 2022-06-03 19:45:32.872892834 +0100
-@@ -761,7 +761,7 @@
- LDR a3, [sp, #14*4 + 4] @ saved USR lr
- LDR a1, [sp, #11*4 + 4] @ saved USR fp
- STMFD sp!, {a1, a3} @ create signal frame
-- MOV fp, sp @ FIXME: check this with compiler output for similar function
-+ ADD fp, sp, #4 @ FIXME: check this with compiler output for similar function
- #else
- @ Create an APCS-32 compilant signal stack frame
- ADR a4, __h_cback + 4*3 @ point at handler name for backtrace
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-sync-and-fetch-atomics.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-sync-and-fetch-atomics.p
new file mode 100644
index 0000000..f9764ba
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-sync-and-fetch-atomics.p
@@ -0,0 +1,22 @@
+Index: libunixlib/gcccompat/atomics.c
+===================================================================
+--- libunixlib/gcccompat/atomics.c (revision 7698)
++++ libunixlib/gcccompat/atomics.c (working copy)
+@@ -146,8 +146,6 @@
+ ATOMIC_COMPARE_AND_EXCHANGE(4,uint32_t)
+ ATOMIC_COMPARE_AND_EXCHANGE(8,uint64_t)
+
+-#ifndef __ARM_EABI__
+-
+ /* These built-in functions perform the operation suggested by the name,
+ * and return the value that had previously been in *ptr. That is,
+ *
+@@ -200,8 +198,6 @@
+ SYNC_FETCH_AND_OP(xor,^,8,long long)
+ SYNC_FETCH_AND_OP(and,&,8,long long)
+
+-#endif
+-
+ /* These built-in functions perform the operation suggested by the name,
+ * and return the new value. That is,
+ *
--
Cross-compilation toolchains and environments
1 year, 3 months
toolchains: branch jmb/arm-riscos-gnueabihf updated. 7f53178a4cdbed363328a5fa60bead742bd628aa
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/7f53178a4cdbed3633...
...commit http://git.netsurf-browser.org/toolchains.git/commit/7f53178a4cdbed363328...
...tree http://git.netsurf-browser.org/toolchains.git/tree/7f53178a4cdbed363328a5...
The branch, jmb/arm-riscos-gnueabihf has been updated
via 7f53178a4cdbed363328a5fa60bead742bd628aa (commit)
from 98fc44e4b6b635bbf261c03038d470e19a468ba6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/toolchains.git/commit/?id=7f53178a4cdbed36...
commit 7f53178a4cdbed363328a5fa60bead742bd628aa
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Fix stack backtraces from UnixLib
The frame pointer to the signal stack frame was off-by-one
resulting in unwinding terminating early. Additionally, we can
dump the register state at the point of the abort now.
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
new file mode 100644
index 0000000..2c971cd
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
@@ -0,0 +1,37 @@
+--- libunixlib/signal/post.c 2021-06-15 21:42:03.000000000 +0100
++++ libunixlib/signal/post.c 2022-06-03 19:52:18.316234729 +0100
+@@ -307,6 +307,7 @@
+ }
+
+ #ifdef __ARM_EABI__
++ const unsigned int *pc = NULL;
+ const unsigned int * const lr = (unsigned int *)fp[LR_OFFSET];
+ fprintf (stderr, " (%8x) lr: %8x",
+ (unsigned int)fp, (unsigned int)lr);
+@@ -350,7 +351,6 @@
+ #endif
+ oldfp = fp;
+ fp = (const unsigned int *)fp[FP_OFFSET];
+-#ifndef __ARM_EABI__
+ if (__ul_callbackfp != NULL && fp == __ul_callbackfp)
+ {
+ /* At &oldfp[1] = cpsr, a1-a4, v1-v6, sl, fp, ip, sp, lr, pc */
+@@ -424,7 +424,6 @@
+
+ fputs ("\n\n", stderr);
+ }
+-#endif
+ }
+
+ fputc ('\n', stderr);
+--- libunixlib/signal/_signal.s 2020-05-31 20:11:06.000000000 +0100
++++ libunixlib/signal/_signal.s 2022-06-03 19:45:32.872892834 +0100
+@@ -761,7 +761,7 @@
+ LDR a3, [sp, #14*4 + 4] @ saved USR lr
+ LDR a1, [sp, #11*4 + 4] @ saved USR fp
+ STMFD sp!, {a1, a3} @ create signal frame
+- MOV fp, sp @ FIXME: check this with compiler output for similar function
++ ADD fp, sp, #4 @ FIXME: check this with compiler output for similar function
+ #else
+ @ Create an APCS-32 compilant signal stack frame
+ ADR a4, __h_cback + 4*3 @ point at handler name for backtrace
-----------------------------------------------------------------------
Summary of changes:
.../recipes/patches/gccsdk/unixlib-backtrace.p | 37 ++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
new file mode 100644
index 0000000..2c971cd
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
@@ -0,0 +1,37 @@
+--- libunixlib/signal/post.c 2021-06-15 21:42:03.000000000 +0100
++++ libunixlib/signal/post.c 2022-06-03 19:52:18.316234729 +0100
+@@ -307,6 +307,7 @@
+ }
+
+ #ifdef __ARM_EABI__
++ const unsigned int *pc = NULL;
+ const unsigned int * const lr = (unsigned int *)fp[LR_OFFSET];
+ fprintf (stderr, " (%8x) lr: %8x",
+ (unsigned int)fp, (unsigned int)lr);
+@@ -350,7 +351,6 @@
+ #endif
+ oldfp = fp;
+ fp = (const unsigned int *)fp[FP_OFFSET];
+-#ifndef __ARM_EABI__
+ if (__ul_callbackfp != NULL && fp == __ul_callbackfp)
+ {
+ /* At &oldfp[1] = cpsr, a1-a4, v1-v6, sl, fp, ip, sp, lr, pc */
+@@ -424,7 +424,6 @@
+
+ fputs ("\n\n", stderr);
+ }
+-#endif
+ }
+
+ fputc ('\n', stderr);
+--- libunixlib/signal/_signal.s 2020-05-31 20:11:06.000000000 +0100
++++ libunixlib/signal/_signal.s 2022-06-03 19:45:32.872892834 +0100
+@@ -761,7 +761,7 @@
+ LDR a3, [sp, #14*4 + 4] @ saved USR lr
+ LDR a1, [sp, #11*4 + 4] @ saved USR fp
+ STMFD sp!, {a1, a3} @ create signal frame
+- MOV fp, sp @ FIXME: check this with compiler output for similar function
++ ADD fp, sp, #4 @ FIXME: check this with compiler output for similar function
+ #else
+ @ Create an APCS-32 compilant signal stack frame
+ ADR a4, __h_cback + 4*3 @ point at handler name for backtrace
--
Cross-compilation toolchains and environments
1 year, 3 months
toolchains: branch jmb/arm-riscos-gnueabihf updated. 98fc44e4b6b635bbf261c03038d470e19a468ba6
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/98fc44e4b6b635bbf2...
...commit http://git.netsurf-browser.org/toolchains.git/commit/98fc44e4b6b635bbf261...
...tree http://git.netsurf-browser.org/toolchains.git/tree/98fc44e4b6b635bbf261c0...
The branch, jmb/arm-riscos-gnueabihf has been updated
via 98fc44e4b6b635bbf261c03038d470e19a468ba6 (commit)
from f3df1663ab3e3a102d7903f9ab60b63eb964948e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/toolchains.git/commit/?id=98fc44e4b6b635bb...
commit 98fc44e4b6b635bbf261c03038d470e19a468ba6
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Teach elf2aif to handle EABI binaries
The previous attempt was bogus as elf2aif is built for the system
that the cross compiler runs on and thus __ARM_EABI__ would only
be set if the cross compiler was built for an ARM-based system.
Further, removing the OSABI check completely is fragile, so let's
not do that.
Instead, we introduce a new command line option for elf2aif which
must be specified if processing EABI binaries. This alters the
OSABI check to test for SysV, rather than ARM in the EABI case.
Additionally, correct functioning of ARMEABISupport is reliant on
the application loader to cause the ARMEABISupport abort handler
to be installed. For ELF binaries, this is ensured by SOManager.
For AIF binaries, however, RISC OS itself knows nothing about
ARMEABISupport and thus will not ensure that the abort handler
is installed. Make elf2aif inject the necessary SWI call into
_start (overwriting instructions that are meaningless when the
binary is not loaded by SOManager). This ensures that the abort
handler is installed as early in the application execution as
possible (and long before any memory managed by ARMEABISupport
is allocated).
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-eabi-support.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-eabi-support.p
new file mode 100644
index 0000000..1d8b841
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-eabi-support.p
@@ -0,0 +1,110 @@
+Index: elf2aif/src/elf2aif.c
+===================================================================
+--- elf2aif/src/elf2aif.c (revision 7698)
++++ elf2aif/src/elf2aif.c (working copy)
+@@ -72,12 +72,13 @@
+ } aifheader_t;
+
+ static int opt_verbose = 0;
++static int opt_eabi = 0;
+
+ static Elf32_External_Ehdr elf_ehdr;
+ static phdr_list_t *elf_phdrlistP;
+ static const char *elf_filename;
+
+-static const unsigned int aifcode[] = {
++static const uint32_t aifcode[] = {
+ 0xE1A00000, /* NOP (BL decompress) */
+ 0xE1A00000, /* NOP (BL self-relocate) */
+ 0xEB00000C, /* BL zero-init */
+@@ -113,6 +114,24 @@
+ 0xEAFFFFFB /* B zeroloop */
+ };
+
++static const uint32_t crt0code[] = {
++ 0xE59F3010, /* LDR R3, =crt1_data */
++ 0xE583000C, /* STR R0, [R3, #12] */
++ 0xE583101C, /* STR R1, [R3, #28] */
++ 0xE5832020, /* STR R2, [R3, #32] */
++ 0xE1A00003 /* MOV R0, R3 */
++ /* B __main */
++};
++
++static const uint32_t eabi_crt0code[] = {
++ 0xE59F3010, /* LDR R3, =crt1_data */
++ 0xE583000C, /* STR R0, [R3, #12] */
++ 0xE3A00002, /* MOV R0, #2 */
++ 0xEF059D01, /* SWI ARMEABISupport_AbortOp */
++ 0xE1A00003 /* MOV R0, R3 */
++ /* B __main */
++};
++
+ /* Read a little-endian 'short' value. */
+ static uint16_t
+ RdShort (const uint8_t sh[2])
+@@ -143,6 +162,7 @@
+ fprintf (stderr, "Usage: elf2aif [options] <ELF file> [<AIF file>]\n"
+ "Convert static ARM ELF binary to AIF (Acorn Image Format) binary.\n"
+ "Options:\n"
++ " -e, --eabi source binary uses EABI\n"
+ " -v, --verbose prints informational messages during processing\n"
+ " --help display this help and exit\n"
+ " --version output version information and exit\n");
+@@ -201,7 +221,8 @@
+ return EXIT_FAILURE;
+ }
+
+- if (elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_ARM)
++ if ((!opt_eabi && elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_ARM) ||
++ (opt_eabi && elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_NONE))
+ {
+ fprintf (stderr, "ELF file '%s' is not for ARM\n", elf_filename);
+ return EXIT_FAILURE;
+@@ -503,6 +524,37 @@
+ return EXIT_FAILURE;
+ }
+
++ /* In the EABI case we need to inject the code to install
++ * the ARMEABISupport abort handler */
++ if (opt_eabi)
++ {
++ uint32_t crt0[5];
++ assert(sizeof (crt0code) == sizeof (crt0));
++ assert(sizeof (eabi_crt0code) == sizeof (crt0));
++
++ if (opt_verbose)
++ printf ("Rewriting crt0 at offset 0x%x\n", (exec_addr - load_addr));
++
++ if (fseek (elfhandle, (exec_addr - load_addr), SEEK_SET) != 0 ||
++ fread (crt0, sizeof (crt0), 1, elfhandle) != 1)
++ {
++ fprintf (stderr, "Failed to read crt0\n");
++ return EXIT_FAILURE;
++ }
++ if (memcmp(crt0, crt0code, sizeof (crt0)) != 0)
++ {
++ fprintf (stderr, "crt0 code not as expected\n");
++ return EXIT_FAILURE;
++ }
++ if (fseek (aifhandle, (exec_addr - load_addr), SEEK_SET) != 0 ||
++ fwrite (eabi_crt0code, sizeof (crt0), 1, aifhandle) != 1 ||
++ fseek (aifhandle, aifend, SEEK_SET) != 0)
++ {
++ fprintf (stderr, "Failed to write crt0\n");
++ return EXIT_FAILURE;
++ }
++ }
++
+ return EXIT_SUCCESS;
+ }
+
+@@ -683,6 +735,9 @@
+ fprintf (stderr, "Warning: extra options/arguments ignored\n");
+ return EXIT_SUCCESS;
+ }
++ else if (!strcmp (&argv[i][1], "-eabi")
++ || !strcmp (&argv[i][1], "e"))
++ opt_eabi = 1;
+ else if (!strcmp (&argv[i][1], "-verbose")
+ || !strcmp (&argv[i][1], "v"))
+ ++opt_verbose;
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-no-abi-check.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-no-abi-check.p
deleted file mode 100644
index 3ad6372..0000000
--- a/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-no-abi-check.p
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: elf2aif/src/elf2aif.c
-===================================================================
---- elf2aif/src/elf2aif.c (revision 7698)
-+++ elf2aif/src/elf2aif.c (working copy)
-@@ -201,7 +201,11 @@
- return EXIT_FAILURE;
- }
-
-+#ifndef __ARM_EABI__
- if (elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_ARM)
-+#else
-+ if (elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_NONE)
-+#endif
- {
- fprintf (stderr, "ELF file '%s' is not for ARM\n", elf_filename);
- return EXIT_FAILURE;
-----------------------------------------------------------------------
Summary of changes:
.../recipes/patches/gccsdk/elf2aif-eabi-support.p | 110 ++++++++++++++++++++
.../recipes/patches/gccsdk/elf2aif-no-abi-check.p | 16 ---
2 files changed, 110 insertions(+), 16 deletions(-)
create mode 100644 arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-eabi-support.p
delete mode 100644 arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-no-abi-check.p
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-eabi-support.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-eabi-support.p
new file mode 100644
index 0000000..1d8b841
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-eabi-support.p
@@ -0,0 +1,110 @@
+Index: elf2aif/src/elf2aif.c
+===================================================================
+--- elf2aif/src/elf2aif.c (revision 7698)
++++ elf2aif/src/elf2aif.c (working copy)
+@@ -72,12 +72,13 @@
+ } aifheader_t;
+
+ static int opt_verbose = 0;
++static int opt_eabi = 0;
+
+ static Elf32_External_Ehdr elf_ehdr;
+ static phdr_list_t *elf_phdrlistP;
+ static const char *elf_filename;
+
+-static const unsigned int aifcode[] = {
++static const uint32_t aifcode[] = {
+ 0xE1A00000, /* NOP (BL decompress) */
+ 0xE1A00000, /* NOP (BL self-relocate) */
+ 0xEB00000C, /* BL zero-init */
+@@ -113,6 +114,24 @@
+ 0xEAFFFFFB /* B zeroloop */
+ };
+
++static const uint32_t crt0code[] = {
++ 0xE59F3010, /* LDR R3, =crt1_data */
++ 0xE583000C, /* STR R0, [R3, #12] */
++ 0xE583101C, /* STR R1, [R3, #28] */
++ 0xE5832020, /* STR R2, [R3, #32] */
++ 0xE1A00003 /* MOV R0, R3 */
++ /* B __main */
++};
++
++static const uint32_t eabi_crt0code[] = {
++ 0xE59F3010, /* LDR R3, =crt1_data */
++ 0xE583000C, /* STR R0, [R3, #12] */
++ 0xE3A00002, /* MOV R0, #2 */
++ 0xEF059D01, /* SWI ARMEABISupport_AbortOp */
++ 0xE1A00003 /* MOV R0, R3 */
++ /* B __main */
++};
++
+ /* Read a little-endian 'short' value. */
+ static uint16_t
+ RdShort (const uint8_t sh[2])
+@@ -143,6 +162,7 @@
+ fprintf (stderr, "Usage: elf2aif [options] <ELF file> [<AIF file>]\n"
+ "Convert static ARM ELF binary to AIF (Acorn Image Format) binary.\n"
+ "Options:\n"
++ " -e, --eabi source binary uses EABI\n"
+ " -v, --verbose prints informational messages during processing\n"
+ " --help display this help and exit\n"
+ " --version output version information and exit\n");
+@@ -201,7 +221,8 @@
+ return EXIT_FAILURE;
+ }
+
+- if (elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_ARM)
++ if ((!opt_eabi && elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_ARM) ||
++ (opt_eabi && elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_NONE))
+ {
+ fprintf (stderr, "ELF file '%s' is not for ARM\n", elf_filename);
+ return EXIT_FAILURE;
+@@ -503,6 +524,37 @@
+ return EXIT_FAILURE;
+ }
+
++ /* In the EABI case we need to inject the code to install
++ * the ARMEABISupport abort handler */
++ if (opt_eabi)
++ {
++ uint32_t crt0[5];
++ assert(sizeof (crt0code) == sizeof (crt0));
++ assert(sizeof (eabi_crt0code) == sizeof (crt0));
++
++ if (opt_verbose)
++ printf ("Rewriting crt0 at offset 0x%x\n", (exec_addr - load_addr));
++
++ if (fseek (elfhandle, (exec_addr - load_addr), SEEK_SET) != 0 ||
++ fread (crt0, sizeof (crt0), 1, elfhandle) != 1)
++ {
++ fprintf (stderr, "Failed to read crt0\n");
++ return EXIT_FAILURE;
++ }
++ if (memcmp(crt0, crt0code, sizeof (crt0)) != 0)
++ {
++ fprintf (stderr, "crt0 code not as expected\n");
++ return EXIT_FAILURE;
++ }
++ if (fseek (aifhandle, (exec_addr - load_addr), SEEK_SET) != 0 ||
++ fwrite (eabi_crt0code, sizeof (crt0), 1, aifhandle) != 1 ||
++ fseek (aifhandle, aifend, SEEK_SET) != 0)
++ {
++ fprintf (stderr, "Failed to write crt0\n");
++ return EXIT_FAILURE;
++ }
++ }
++
+ return EXIT_SUCCESS;
+ }
+
+@@ -683,6 +735,9 @@
+ fprintf (stderr, "Warning: extra options/arguments ignored\n");
+ return EXIT_SUCCESS;
+ }
++ else if (!strcmp (&argv[i][1], "-eabi")
++ || !strcmp (&argv[i][1], "e"))
++ opt_eabi = 1;
+ else if (!strcmp (&argv[i][1], "-verbose")
+ || !strcmp (&argv[i][1], "v"))
+ ++opt_verbose;
diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-no-abi-check.p b/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-no-abi-check.p
deleted file mode 100644
index 3ad6372..0000000
--- a/arm-riscos-gnueabihf/recipes/patches/gccsdk/elf2aif-no-abi-check.p
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: elf2aif/src/elf2aif.c
-===================================================================
---- elf2aif/src/elf2aif.c (revision 7698)
-+++ elf2aif/src/elf2aif.c (working copy)
-@@ -201,7 +201,11 @@
- return EXIT_FAILURE;
- }
-
-+#ifndef __ARM_EABI__
- if (elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_ARM)
-+#else
-+ if (elf_ehdr.e_ident[EI_OSABI] != ELFOSABI_NONE)
-+#endif
- {
- fprintf (stderr, "ELF file '%s' is not for ARM\n", elf_filename);
- return EXIT_FAILURE;
--
Cross-compilation toolchains and environments
1 year, 3 months
netsurf: branch master updated. release/3.10-259-gcd76c45
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/cd76c45e9ec422b63929a...
...commit http://git.netsurf-browser.org/netsurf.git/commit/cd76c45e9ec422b63929ab3...
...tree http://git.netsurf-browser.org/netsurf.git/tree/cd76c45e9ec422b63929ab386...
The branch, master has been updated
via cd76c45e9ec422b63929ab386758b651df73ca45 (commit)
from 926c0985e3cf6b025c37a0f16e69461051214eb1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=cd76c45e9ec422b6392...
commit cd76c45e9ec422b63929ab386758b651df73ca45
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Buildsystem: fix makefile snafu
99012dcd introduced a regression that caused builds for all
non-RISC OS platforms to fail. Fix this, ensuring that RISC OS
builds still do the things they need to.
diff --git a/Makefile b/Makefile
index 4fe124d..f66f796 100644
--- a/Makefile
+++ b/Makefile
@@ -329,12 +329,17 @@ IFLAGS = $(addprefix -I,$(INCLUDE_DIRS))
$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES) tools/linktrace-to-depfile.pl
$(VQ)echo " LINK: $(EXETARGET)"
-ifeq ($(TARGET)$(SUBTARGET),riscos-aof)
+ifneq ($(TARGET),riscos)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
else
+ @# RISC OS targets are a bit special: we need to convert ELF -> AIF
+ ifeq ($(SUBTARGET),riscos-aof)
+ $(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
+ else
$(Q)$(CXX) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
$(Q)$(ELF2AIF) $(EXETARGET:,ff8=,e1f) $(EXETARGET)
$(Q)$(RM) $(EXETARGET:,ff8=,e1f)
+ endif
endif
$(VQ)echo "LINKDEPS: $(EXETARGET)"
$(Q)echo -n "$(EXETARGET) $(DEPROOT)/link.d: " > $(DEPROOT)/link.d
-----------------------------------------------------------------------
Summary of changes:
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 4fe124d..f66f796 100644
--- a/Makefile
+++ b/Makefile
@@ -329,12 +329,17 @@ IFLAGS = $(addprefix -I,$(INCLUDE_DIRS))
$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES) tools/linktrace-to-depfile.pl
$(VQ)echo " LINK: $(EXETARGET)"
-ifeq ($(TARGET)$(SUBTARGET),riscos-aof)
+ifneq ($(TARGET),riscos)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
else
+ @# RISC OS targets are a bit special: we need to convert ELF -> AIF
+ ifeq ($(SUBTARGET),riscos-aof)
+ $(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
+ else
$(Q)$(CXX) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
$(Q)$(ELF2AIF) $(EXETARGET:,ff8=,e1f) $(EXETARGET)
$(Q)$(RM) $(EXETARGET:,ff8=,e1f)
+ endif
endif
$(VQ)echo "LINKDEPS: $(EXETARGET)"
$(Q)echo -n "$(EXETARGET) $(DEPROOT)/link.d: " > $(DEPROOT)/link.d
--
NetSurf Browser
1 year, 3 months
netsurf: branch master updated. release/3.10-258-g926c098
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/926c0985e3cf6b025c37a...
...commit http://git.netsurf-browser.org/netsurf.git/commit/926c0985e3cf6b025c37a0f...
...tree http://git.netsurf-browser.org/netsurf.git/tree/926c0985e3cf6b025c37a0f16...
The branch, master has been updated
via 926c0985e3cf6b025c37a0f16e69461051214eb1 (commit)
via e1d7928b3bdd97b24f1ff7d2b04ab7a2a65ef460 (commit)
via 617c6207bcd45daa8d66c35dbc4f1273686646f3 (commit)
via 0d114e10b23548ae8b5a6af6a5d47bf71651080e (commit)
via 69adc31d07f3b5b9cdfa1482efc00d18f4c21583 (commit)
via bfce4632b88c6386fa527509b91ad97ebcc6b1a4 (commit)
via 99012dcdd43b916902e4aab839694e311a98f22b (commit)
from c90fb03e58251b8798f1dfd0caaaf6ef6d4c9ff9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=926c0985e3cf6b025c3...
commit 926c0985e3cf6b025c37a0f16e69461051214eb1
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
RISC OS: fix type in awrender_init definition.
diff --git a/frontends/riscos/content-handlers/artworks.c b/frontends/riscos/content-handlers/artworks.c
index 0227603..c107ec6 100644
--- a/frontends/riscos/content-handlers/artworks.c
+++ b/frontends/riscos/content-handlers/artworks.c
@@ -93,7 +93,7 @@ struct awinfo_block {
/* Assembler routines for interfacing with the ArtworksRenderer module */
extern os_error *awrender_init(const char **doc,
- unsigned long *doc_size,
+ size_t *doc_size,
void *routine,
void *workspace);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e1d7928b3bdd97b24f1...
commit e1d7928b3bdd97b24f1ff7d2b04ab7a2a65ef460
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
RISC OS: fix snprintf usage
When computing throbber sprite names, ensure the current frame is
in range before using it.
Similarly ensure the buffer size for the temporary URL bar sprite
name is sized such that snprintf has space for the trailing NUL
when formatting it to the output buffer.
diff --git a/frontends/riscos/gui/throbber.c b/frontends/riscos/gui/throbber.c
index f3b79a6..e3e4106 100644
--- a/frontends/riscos/gui/throbber.c
+++ b/frontends/riscos/gui/throbber.c
@@ -32,6 +32,7 @@
#include "oslib/wimp.h"
#include "utils/log.h"
+#include "utils/utils.h"
#include "riscos/gui.h"
#include "riscos/gui/throbber.h"
@@ -385,7 +386,8 @@ bool ro_gui_throbber_animate(struct throbber *throbber)
throbber->current_frame = 1;
snprintf(sprite_name, THROBBER_SPRITE_NAME_LENGTH,
- "throbber%i", throbber->current_frame);
+ "throbber%i",
+ min(max(throbber->current_frame, 0), 999));
ro_gui_set_icon_string(throbber->window, throbber->icon,
sprite_name, true);
diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c
index ec21e93..8802db7 100644
--- a/frontends/riscos/gui/url_bar.c
+++ b/frontends/riscos/gui/url_bar.c
@@ -1506,7 +1506,7 @@ ro_gui_url_bar_set_content_favicon(struct url_bar *url_bar,
struct gui_window *g)
{
int type = 0;
- char sprite[URLBAR_FAVICON_NAME_LENGTH];
+ char sprite[URLBAR_FAVICON_NAME_LENGTH-1];
struct hlcache_handle *h;
if (url_bar == NULL ||
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=617c6207bcd45daa8d6...
commit 617c6207bcd45daa8d66c35dbc4f1273686646f3
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
RISC OS: fix up use of strncpy
Ensure that strings copied using strncpy are NUL terminated.
Additionally, replace use of strncpy entirely where we are writing
into non-indirected OS icon blocks (where an unterminated 12
character long string is perfectly valid).
diff --git a/frontends/riscos/download.c b/frontends/riscos/download.c
index bdc7054..216f575 100644
--- a/frontends/riscos/download.c
+++ b/frontends/riscos/download.c
@@ -313,8 +313,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
/** @todo change this to take a reference to the nsurl and use
* that value directly rather than using a fixed buffer.
*/
- strncpy(dw->url, nsurl_access(url), sizeof dw->url);
- dw->url[sizeof dw->url - 1] = 0;
+ strncpy(dw->url, nsurl_access(url), sizeof(dw->url) - 1);
+ dw->url[sizeof(dw->url) - 1] = 0;
dw->status[0] = 0;
gettimeofday(&dw->start_time, 0);
@@ -414,7 +414,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
return 0;
}
else {
- strncpy(dw->path, local_path, sizeof dw->path);
+ strncpy(dw->path, local_path, sizeof(dw->path) - 1);
+ dw->path[sizeof(dw->path)-1] = 0;
free(local_path);
}
@@ -484,7 +485,8 @@ static void gui_download_window_error(struct gui_download_window *dw,
riscos_schedule(-1, ro_gui_download_update_status_wrapper, dw);
/* place error message in status icon in red */
- strncpy(dw->status, error_msg, sizeof dw->status);
+ strncpy(dw->status, error_msg, sizeof(dw->status) - 1);
+ dw->status[sizeof(dw->status)-1] = 0;
error = xwimp_set_icon_state(dw->window,
ICON_DOWNLOAD_STATUS,
wimp_COLOUR_RED << wimp_ICON_FG_COLOUR_SHIFT,
@@ -872,11 +874,11 @@ bool ro_gui_download_click(wimp_pointer *pointer)
ro_gui_drag_icon(x, y, sprite);
} else if (pointer->i == ICON_DOWNLOAD_DESTINATION) {
- char command[256] = "Filer_OpenDir ";
+ char command[sizeof(dw->path) + 14 + 1] = "Filer_OpenDir ";
char *dot;
- strncpy(command + 14, dw->path, 242);
- command[255] = 0;
+ strncpy(command + 14, dw->path, sizeof(command) - 14 - 1);
+ command[sizeof(command) - 1] = 0;
dot = strrchr(command, '.');
if (dot) {
os_error *error;
@@ -1384,7 +1386,8 @@ bool ro_gui_download_save(struct gui_download_window *dw,
}
dw->saved = true;
- strncpy(dw->path, file_name, sizeof dw->path);
+ strncpy(dw->path, file_name, sizeof(dw->path) - 1);
+ dw->path[sizeof(dw->path)-1] = 0;
if (!dw->send_dataload || dw->save_message.data.data_xfer.est_size != -1)
ro_gui_download_remember_dir(file_name);
diff --git a/frontends/riscos/gui/button_bar.c b/frontends/riscos/gui/button_bar.c
index 34ae39a..50e1de3 100644
--- a/frontends/riscos/gui/button_bar.c
+++ b/frontends/riscos/gui/button_bar.c
@@ -189,7 +189,8 @@ struct button_bar *ro_gui_button_bar_create(struct theme_descriptor *theme,
icon->bar_next = NULL;
strncpy(icon->sprite, buttons[def].icon,
- BUTTONBAR_SPRITE_NAME_LENGTH);
+ BUTTONBAR_SPRITE_NAME_LENGTH - 1);
+ icon->sprite[BUTTONBAR_SPRITE_NAME_LENGTH-1] = 0;
snprintf(icon->validation, BUTTONBAR_VALIDATION_LENGTH,
"R5;S%s,p%s", icon->sprite, icon->sprite);
diff --git a/frontends/riscos/save.c b/frontends/riscos/save.c
index 325bccc..e6b43f1 100644
--- a/frontends/riscos/save.c
+++ b/frontends/riscos/save.c
@@ -40,8 +40,10 @@
#include "utils/config.h"
#include "utils/log.h"
#include "utils/messages.h"
-#include "utils/utf8.h"
+#include "utils/nsoption.h"
#include "utils/nsurl.h"
+#include "utils/utf8.h"
+#include "utils/utils.h"
#include "netsurf/browser_window.h"
#include "netsurf/window.h"
#include "netsurf/bitmap.h"
@@ -60,7 +62,6 @@
#include "riscos/menus.h"
#include "riscos/message.h"
#include "riscos/mouse.h"
-#include "utils/nsoption.h"
#include "riscos/query.h"
#include "riscos/save.h"
#include "riscos/save_draw.h"
@@ -257,7 +258,8 @@ ro_gui_save_create_thumbnail(struct hlcache_handle *h, const char *name)
}
sprite_header = (osspriteop_header *)(area + 1);
- strncpy(sprite_header->name, name, 12);
+ memset(sprite_header->name, 0, 12);
+ memcpy(sprite_header->name, name, min(strlen(name), 12));
/* we can't resize the saveas sprite area because it may move
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index 2c442ab..2b51c2f 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -3594,7 +3594,8 @@ static void gui_window_set_title(struct gui_window *g, const char *title)
title, scale_disp);
}
} else {
- strncpy(g->title, title, sizeof(g->title));
+ strncpy(g->title, title, sizeof(g->title) - 1);
+ g->title[sizeof(g->title)-1] = 0;
}
ro_gui_set_window_title(g->window, g->title);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0d114e10b23548ae8b5...
commit 0d114e10b23548ae8b5a6af6a5d47bf71651080e
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
RISC OS: GCC 10 approved fall-through markers
diff --git a/frontends/riscos/configure/con_image.c b/frontends/riscos/configure/con_image.c
index 23c663a..86e6b8f 100644
--- a/frontends/riscos/configure/con_image.c
+++ b/frontends/riscos/configure/con_image.c
@@ -209,6 +209,7 @@ bool ro_gui_options_image_click(wimp_pointer *pointer)
data.indirected_text.text, true);
ro_gui_set_icon_selected_state(pointer->w,
IMAGE_DISABLE_ANIMATION, false);
+ /* fall through */
case IMAGE_DISABLE_ANIMATION:
ro_gui_options_update_shading(pointer->w);
break;
diff --git a/frontends/riscos/save.c b/frontends/riscos/save.c
index 85fefea..325bccc 100644
--- a/frontends/riscos/save.c
+++ b/frontends/riscos/save.c
@@ -1018,7 +1018,7 @@ ro_gui_save_content(struct hlcache_handle *h, char *path, bool force_overwrite)
}
else
gui_save_current_type = GUI_SAVE_OBJECT_ORIG; /** \todo do this earlier? */
- /* no break */
+ /* fall through */
case GUI_SAVE_SOURCE:
case GUI_SAVE_OBJECT_ORIG:
source_data = content_get_source_data(h, &source_size);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=69adc31d07f3b5b9cdf...
commit 69adc31d07f3b5b9cdfa1482efc00d18f4c21583
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
inttypes: custom format for UnixLib ssize_t
UnixLib defines ssize_t to be a long int, which forces the
corresponding format string to need to be %ld to avoid compiler
warnings. Making this change uncovered a number of places where
we were using the wrong format specifier entirely (namely
PRIssizet where we meant PRIsizet). Fix these, too.
diff --git a/content/handlers/image/image_cache.c b/content/handlers/image/image_cache.c
index bc0b914..6ce6b52 100644
--- a/content/handlers/image/image_cache.c
+++ b/content/handlers/image/image_cache.c
@@ -632,15 +632,15 @@ case chr : \
slen++;
break;
- FMTCHR('a', PRIssizet, params.limit);
- FMTCHR('b', PRIssizet, params.hysteresis);
- FMTCHR('c', PRIssizet, total_bitmap_size);
+ FMTCHR('a', PRIsizet, params.limit);
+ FMTCHR('b', PRIsizet, params.hysteresis);
+ FMTCHR('c', PRIsizet, total_bitmap_size);
FMTCHR('d', "d", bitmap_count);
FMTCHR('e', "u", current_age / 1000);
- FMTCHR('f', PRIssizet, max_bitmap_size);
+ FMTCHR('f', PRIsizet, max_bitmap_size);
FMTCHR('g', "d", max_bitmap_size_count);
FMTCHR('h', "d", max_bitmap_count);
- FMTCHR('i', PRIssizet, max_bitmap_count_size);
+ FMTCHR('i', PRIsizet, max_bitmap_count_size);
case 'j':
@@ -770,7 +770,7 @@ image_cache_snentryf(char *string,
if (centry->bitmap != NULL) {
slen += snprintf(string + slen,
size - slen,
- "%" PRIssizet,
+ "%" PRIsizet,
centry->bitmap_size);
} else {
slen += snprintf(string + slen,
diff --git a/content/llcache.c b/content/llcache.c
index 81e0838..7db59de 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -2966,7 +2966,7 @@ static void llcache_persist(void *p)
total_bandwidth = (total_written * 1000) / total_elapsed;
NSLOG(llcache, DEBUG,
- "Wrote %"PRIssizet" bytes in %lums bw:%lu %s",
+ "Wrote %"PRIsizet" bytes in %lums bw:%lu %s",
written, elapsed, (written * 1000) / elapsed,
nsurl_access(lst[idx]->url) );
@@ -3034,7 +3034,7 @@ static void llcache_persist(void *p)
llcache->total_elapsed += total_elapsed;
NSLOG(llcache, DEBUG,
- "writeout size:%"PRIssizet" time:%lu bandwidth:%lubytes/s",
+ "writeout size:%"PRIsizet" time:%lu bandwidth:%lubytes/s",
total_written, total_elapsed, total_bandwidth);
NSLOG(llcache, DEBUG, "Rescheduling writeout in %dms", next);
@@ -3813,7 +3813,7 @@ void llcache_clean(bool purge)
llcache_size -= object->source_len;
NSLOG(llcache, DEBUG,
- "Freeing source data for %p len:%"PRIssizet,
+ "Freeing source data for %p len:%"PRIsizet,
object, object->source_len);
}
}
@@ -3832,7 +3832,7 @@ void llcache_clean(bool purge)
(object->store_state == LLCACHE_STATE_DISC) &&
(object->source_data == NULL)) {
NSLOG(llcache, DEBUG,
- "discarding backed object len:%"PRIssizet" age:%ld (%p) %s",
+ "discarding backed object len:%"PRIsizet" age:%ld (%p) %s",
object->source_len,
(long)(time(NULL) - object->last_used),
object,
@@ -3862,7 +3862,7 @@ void llcache_clean(bool purge)
(object->fetch.fetch == NULL) &&
(object->store_state == LLCACHE_STATE_RAM)) {
NSLOG(llcache, DEBUG,
- "discarding fresh object len:%"PRIssizet" age:%ld (%p) %s",
+ "discarding fresh object len:%"PRIsizet" age:%ld (%p) %s",
object->source_len,
(long)(time(NULL) - object->last_used),
object,
diff --git a/include/netsurf/inttypes.h b/include/netsurf/inttypes.h
index 3a16d0e..e222908 100644
--- a/include/netsurf/inttypes.h
+++ b/include/netsurf/inttypes.h
@@ -52,8 +52,13 @@
/** c99 standard printf formatting for size_t type */
#define PRIsizet "zu"
+#if defined(__riscos__)
+/** riscos/unixlib defines ssize_t as a long int */
+#define PRIssizet "ld"
+#else
/** c99 standard printf formatting for ssize_t type */
#define PRIssizet "zd"
+#endif
#endif
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=bfce4632b88c6386fa5...
commit bfce4632b88c6386fa527509b91ad97ebcc6b1a4
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
env.sh: update for arm-riscos-gnueabihf
diff --git a/docs/env.sh b/docs/env.sh
index 6908220..80292a4 100644
--- a/docs/env.sh
+++ b/docs/env.sh
@@ -284,7 +284,7 @@ case "${HOST}" in
# libraries required for the Darwin target abi
NS_FRONTEND_LIBS="libsvgtiny libnsfb"
;;
- arm-unknown-riscos)
+ arm-unknown-riscos|arm-riscos-gnueabihf)
# tools required to build the browser for RISC OS
NS_TOOLS="nsgenbind"
# libraries required for the risc os target abi
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=99012dcdd43b916902e...
commit 99012dcdd43b916902e4aab839694e311a98f22b
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Buildsystem: update for new RISC OS toolchain
The new toolchain has a different machine triplet, so update the
things that care about it to work either way.
Remove the expectation that ro-pkg-config exists (it's trivial
and the core buildsystem never used it, so let's have some
consistency).
Determine the location of the zip binary in Makefile.tools, just
like for all the other tooling and stop assuming where it's
installed in the netsurf.zip target.
diff --git a/Makefile b/Makefile
index ac38b50..4fe124d 100644
--- a/Makefile
+++ b/Makefile
@@ -329,7 +329,7 @@ IFLAGS = $(addprefix -I,$(INCLUDE_DIRS))
$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES) tools/linktrace-to-depfile.pl
$(VQ)echo " LINK: $(EXETARGET)"
-ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
+ifeq ($(TARGET)$(SUBTARGET),riscos-aof)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
else
$(Q)$(CXX) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
diff --git a/frontends/riscos/Makefile b/frontends/riscos/Makefile
index af6585c..79e6fc4 100644
--- a/frontends/riscos/Makefile
+++ b/frontends/riscos/Makefile
@@ -33,7 +33,7 @@ ifeq ($(HOST),riscos)
LDFLAGS += -LOSLib: -lOSLib32
else
LDFLAGS += -lOSLib32
- ifeq ($(SUBTARGET),-elf)
+ ifeq ($(findstring -elf,$(SUBTARGET)),-elf)
# Go for static builds & AIF binary at the moment:
CFLAGS += -static
LDFLAGS += -static
@@ -184,5 +184,5 @@ netsurf.zip: $(EXETARGET)
$(Q) rsync --archive --verbose $(FRONTEND_SOURCE_DIR)/distribution/3rdParty $($@_TMPDIR)
$(Q) cp $(FRONTEND_SOURCE_DIR)/distribution/ReadMe $($@_TMPDIR)
$(Q) cp $(FRONTEND_SOURCE_DIR)/distribution/LeesMij $($@_TMPDIR)
- $(Q) cd $($@_TMPDIR) && /opt/netsurf/arm-unknown-riscos/env/bin/zip -9vr\, $(CURDIR)/$@ *
+ $(Q) cd $($@_TMPDIR) && $(ZIP) -9vr\, $(CURDIR)/$@ *
$(Q) $(RM) -rf $($@_TMPDIR)
diff --git a/frontends/riscos/Makefile.tools b/frontends/riscos/Makefile.tools
index 9ea5c29..19a2e77 100644
--- a/frontends/riscos/Makefile.tools
+++ b/frontends/riscos/Makefile.tools
@@ -15,21 +15,42 @@ ifeq ($(HOST),riscos)
CXX := g++
EXEEXT :=
PKG_CONFIG :=
+ ZIP := zip
else
- # Cross-build for RO (either using GCCSDK 3.4.6 - AOF,
- # either using GCCSDK 4 - ELF)
+ # Cross-build for RO
+ # Three options are available:
+ # a. GCCSDK 3.4.6 - AOF (machine: arm-unknown-riscos)
+ # b. GCCSDK 4 - ELF (machine: arm-unknown-riscos)
+ # c. GCCSDK 8+ - ELF, using EABI (machine: arm-riscos-gnueabihf)
+ # GCCSDK 3.4.6 and 4 are distinguished by GCCSDK 3.4.6 binary names
+ # not having the machine prefix (e.g. gcc), whereas GCCSDK 4 binaries
+ # do (e.g. arm-unknown-riscos-gcc).
+
+ # Search for the toolchain install locations if we haven't been told
+ # The search order prefers GCCSDK 3.4.6/4 over 8+.
ifeq ($(origin GCCSDK_INSTALL_ENV),undefined)
ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/env),)
GCCSDK_INSTALL_ENV := /opt/netsurf/arm-unknown-riscos/env
else
- GCCSDK_INSTALL_ENV := /home/riscos/env
+ ifneq ($(realpath /opt/netsurf/arm-riscos-gnueabihf/env),)
+ GCCSDK_INSTALL_ENV := /opt/netsurf/arm-riscos-gnueabihf/env
+ else
+ # No NetSurf-specific toolchain found: try the "normal" GCCSDK path
+ GCCSDK_INSTALL_ENV := /home/riscos/env
+ endif
endif
endif
- ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
+
+ ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/cross/bin),)
GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-unknown-riscos/cross/bin
else
- GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
+ ifneq ($(realpath /opt/netsurf/arm-riscos-gnueabihf/cross/bin),)
+ GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-riscos-gnueabihf/cross/bin
+ else
+ # No NetSurf-specific toolchain found: try the "normal" GCCSDK path
+ GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
+ endif
endif
endif
@@ -39,14 +60,27 @@ else
SQUEEZE := $(GCCSDK_INSTALL_CROSSBIN)/squeeze
RUNEXT := ,feb
CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
+
+ # Work out what kind of toolchain we're dealing with
ifneq (,$(findstring arm-unknown-riscos-gcc,$(CC)))
+ # GCCSDK 4
SUBTARGET := -elf
EXEEXT := ,e1f
ELF2AIF := $(GCCSDK_INSTALL_CROSSBIN)/elf2aif
else
- SUBTARGET := -aof
- EXEEXT := ,ff8
+ ifneq (,$(findstring arm-riscos-gnueabihf-gcc,$(CC)))
+ # GCCSDK 8+
+ SUBTARGET := -elfeabi
+ EXEEXT := ,e1f
+ ELF2AIF := $(GCCSDK_INSTALL_CROSSBIN)/elf2aif -e
+ else
+ # GCCSDK 3.4.6
+ SUBTARGET := -aof
+ EXEEXT := ,ff8
+ endif
endif
+
CXX := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
- PKG_CONFIG := $(GCCSDK_INSTALL_ENV)/ro-pkg-config
+ PKG_CONFIG = PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/share/pkgconfig" pkg-config
+ ZIP := $(GCCSDK_INSTALL_CROSSBIN)/zip
endif
-----------------------------------------------------------------------
Summary of changes:
Makefile | 2 +-
content/handlers/image/image_cache.c | 12 +++----
content/llcache.c | 10 +++---
docs/env.sh | 2 +-
frontends/riscos/Makefile | 4 +--
frontends/riscos/Makefile.tools | 50 +++++++++++++++++++++-----
frontends/riscos/configure/con_image.c | 1 +
frontends/riscos/content-handlers/artworks.c | 2 +-
frontends/riscos/download.c | 19 +++++-----
frontends/riscos/gui/button_bar.c | 3 +-
frontends/riscos/gui/throbber.c | 4 ++-
frontends/riscos/gui/url_bar.c | 2 +-
frontends/riscos/save.c | 10 +++---
frontends/riscos/window.c | 3 +-
include/netsurf/inttypes.h | 5 +++
15 files changed, 89 insertions(+), 40 deletions(-)
diff --git a/Makefile b/Makefile
index ac38b50..4fe124d 100644
--- a/Makefile
+++ b/Makefile
@@ -329,7 +329,7 @@ IFLAGS = $(addprefix -I,$(INCLUDE_DIRS))
$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES) tools/linktrace-to-depfile.pl
$(VQ)echo " LINK: $(EXETARGET)"
-ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
+ifeq ($(TARGET)$(SUBTARGET),riscos-aof)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
else
$(Q)$(CXX) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
diff --git a/content/handlers/image/image_cache.c b/content/handlers/image/image_cache.c
index bc0b914..6ce6b52 100644
--- a/content/handlers/image/image_cache.c
+++ b/content/handlers/image/image_cache.c
@@ -632,15 +632,15 @@ case chr : \
slen++;
break;
- FMTCHR('a', PRIssizet, params.limit);
- FMTCHR('b', PRIssizet, params.hysteresis);
- FMTCHR('c', PRIssizet, total_bitmap_size);
+ FMTCHR('a', PRIsizet, params.limit);
+ FMTCHR('b', PRIsizet, params.hysteresis);
+ FMTCHR('c', PRIsizet, total_bitmap_size);
FMTCHR('d', "d", bitmap_count);
FMTCHR('e', "u", current_age / 1000);
- FMTCHR('f', PRIssizet, max_bitmap_size);
+ FMTCHR('f', PRIsizet, max_bitmap_size);
FMTCHR('g', "d", max_bitmap_size_count);
FMTCHR('h', "d", max_bitmap_count);
- FMTCHR('i', PRIssizet, max_bitmap_count_size);
+ FMTCHR('i', PRIsizet, max_bitmap_count_size);
case 'j':
@@ -770,7 +770,7 @@ image_cache_snentryf(char *string,
if (centry->bitmap != NULL) {
slen += snprintf(string + slen,
size - slen,
- "%" PRIssizet,
+ "%" PRIsizet,
centry->bitmap_size);
} else {
slen += snprintf(string + slen,
diff --git a/content/llcache.c b/content/llcache.c
index 81e0838..7db59de 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -2966,7 +2966,7 @@ static void llcache_persist(void *p)
total_bandwidth = (total_written * 1000) / total_elapsed;
NSLOG(llcache, DEBUG,
- "Wrote %"PRIssizet" bytes in %lums bw:%lu %s",
+ "Wrote %"PRIsizet" bytes in %lums bw:%lu %s",
written, elapsed, (written * 1000) / elapsed,
nsurl_access(lst[idx]->url) );
@@ -3034,7 +3034,7 @@ static void llcache_persist(void *p)
llcache->total_elapsed += total_elapsed;
NSLOG(llcache, DEBUG,
- "writeout size:%"PRIssizet" time:%lu bandwidth:%lubytes/s",
+ "writeout size:%"PRIsizet" time:%lu bandwidth:%lubytes/s",
total_written, total_elapsed, total_bandwidth);
NSLOG(llcache, DEBUG, "Rescheduling writeout in %dms", next);
@@ -3813,7 +3813,7 @@ void llcache_clean(bool purge)
llcache_size -= object->source_len;
NSLOG(llcache, DEBUG,
- "Freeing source data for %p len:%"PRIssizet,
+ "Freeing source data for %p len:%"PRIsizet,
object, object->source_len);
}
}
@@ -3832,7 +3832,7 @@ void llcache_clean(bool purge)
(object->store_state == LLCACHE_STATE_DISC) &&
(object->source_data == NULL)) {
NSLOG(llcache, DEBUG,
- "discarding backed object len:%"PRIssizet" age:%ld (%p) %s",
+ "discarding backed object len:%"PRIsizet" age:%ld (%p) %s",
object->source_len,
(long)(time(NULL) - object->last_used),
object,
@@ -3862,7 +3862,7 @@ void llcache_clean(bool purge)
(object->fetch.fetch == NULL) &&
(object->store_state == LLCACHE_STATE_RAM)) {
NSLOG(llcache, DEBUG,
- "discarding fresh object len:%"PRIssizet" age:%ld (%p) %s",
+ "discarding fresh object len:%"PRIsizet" age:%ld (%p) %s",
object->source_len,
(long)(time(NULL) - object->last_used),
object,
diff --git a/docs/env.sh b/docs/env.sh
index 6908220..80292a4 100644
--- a/docs/env.sh
+++ b/docs/env.sh
@@ -284,7 +284,7 @@ case "${HOST}" in
# libraries required for the Darwin target abi
NS_FRONTEND_LIBS="libsvgtiny libnsfb"
;;
- arm-unknown-riscos)
+ arm-unknown-riscos|arm-riscos-gnueabihf)
# tools required to build the browser for RISC OS
NS_TOOLS="nsgenbind"
# libraries required for the risc os target abi
diff --git a/frontends/riscos/Makefile b/frontends/riscos/Makefile
index af6585c..79e6fc4 100644
--- a/frontends/riscos/Makefile
+++ b/frontends/riscos/Makefile
@@ -33,7 +33,7 @@ ifeq ($(HOST),riscos)
LDFLAGS += -LOSLib: -lOSLib32
else
LDFLAGS += -lOSLib32
- ifeq ($(SUBTARGET),-elf)
+ ifeq ($(findstring -elf,$(SUBTARGET)),-elf)
# Go for static builds & AIF binary at the moment:
CFLAGS += -static
LDFLAGS += -static
@@ -184,5 +184,5 @@ netsurf.zip: $(EXETARGET)
$(Q) rsync --archive --verbose $(FRONTEND_SOURCE_DIR)/distribution/3rdParty $($@_TMPDIR)
$(Q) cp $(FRONTEND_SOURCE_DIR)/distribution/ReadMe $($@_TMPDIR)
$(Q) cp $(FRONTEND_SOURCE_DIR)/distribution/LeesMij $($@_TMPDIR)
- $(Q) cd $($@_TMPDIR) && /opt/netsurf/arm-unknown-riscos/env/bin/zip -9vr\, $(CURDIR)/$@ *
+ $(Q) cd $($@_TMPDIR) && $(ZIP) -9vr\, $(CURDIR)/$@ *
$(Q) $(RM) -rf $($@_TMPDIR)
diff --git a/frontends/riscos/Makefile.tools b/frontends/riscos/Makefile.tools
index 9ea5c29..19a2e77 100644
--- a/frontends/riscos/Makefile.tools
+++ b/frontends/riscos/Makefile.tools
@@ -15,21 +15,42 @@ ifeq ($(HOST),riscos)
CXX := g++
EXEEXT :=
PKG_CONFIG :=
+ ZIP := zip
else
- # Cross-build for RO (either using GCCSDK 3.4.6 - AOF,
- # either using GCCSDK 4 - ELF)
+ # Cross-build for RO
+ # Three options are available:
+ # a. GCCSDK 3.4.6 - AOF (machine: arm-unknown-riscos)
+ # b. GCCSDK 4 - ELF (machine: arm-unknown-riscos)
+ # c. GCCSDK 8+ - ELF, using EABI (machine: arm-riscos-gnueabihf)
+ # GCCSDK 3.4.6 and 4 are distinguished by GCCSDK 3.4.6 binary names
+ # not having the machine prefix (e.g. gcc), whereas GCCSDK 4 binaries
+ # do (e.g. arm-unknown-riscos-gcc).
+
+ # Search for the toolchain install locations if we haven't been told
+ # The search order prefers GCCSDK 3.4.6/4 over 8+.
ifeq ($(origin GCCSDK_INSTALL_ENV),undefined)
ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/env),)
GCCSDK_INSTALL_ENV := /opt/netsurf/arm-unknown-riscos/env
else
- GCCSDK_INSTALL_ENV := /home/riscos/env
+ ifneq ($(realpath /opt/netsurf/arm-riscos-gnueabihf/env),)
+ GCCSDK_INSTALL_ENV := /opt/netsurf/arm-riscos-gnueabihf/env
+ else
+ # No NetSurf-specific toolchain found: try the "normal" GCCSDK path
+ GCCSDK_INSTALL_ENV := /home/riscos/env
+ endif
endif
endif
- ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
+
+ ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/cross/bin),)
GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-unknown-riscos/cross/bin
else
- GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
+ ifneq ($(realpath /opt/netsurf/arm-riscos-gnueabihf/cross/bin),)
+ GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-riscos-gnueabihf/cross/bin
+ else
+ # No NetSurf-specific toolchain found: try the "normal" GCCSDK path
+ GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
+ endif
endif
endif
@@ -39,14 +60,27 @@ else
SQUEEZE := $(GCCSDK_INSTALL_CROSSBIN)/squeeze
RUNEXT := ,feb
CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
+
+ # Work out what kind of toolchain we're dealing with
ifneq (,$(findstring arm-unknown-riscos-gcc,$(CC)))
+ # GCCSDK 4
SUBTARGET := -elf
EXEEXT := ,e1f
ELF2AIF := $(GCCSDK_INSTALL_CROSSBIN)/elf2aif
else
- SUBTARGET := -aof
- EXEEXT := ,ff8
+ ifneq (,$(findstring arm-riscos-gnueabihf-gcc,$(CC)))
+ # GCCSDK 8+
+ SUBTARGET := -elfeabi
+ EXEEXT := ,e1f
+ ELF2AIF := $(GCCSDK_INSTALL_CROSSBIN)/elf2aif -e
+ else
+ # GCCSDK 3.4.6
+ SUBTARGET := -aof
+ EXEEXT := ,ff8
+ endif
endif
+
CXX := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
- PKG_CONFIG := $(GCCSDK_INSTALL_ENV)/ro-pkg-config
+ PKG_CONFIG = PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/share/pkgconfig" pkg-config
+ ZIP := $(GCCSDK_INSTALL_CROSSBIN)/zip
endif
diff --git a/frontends/riscos/configure/con_image.c b/frontends/riscos/configure/con_image.c
index 23c663a..86e6b8f 100644
--- a/frontends/riscos/configure/con_image.c
+++ b/frontends/riscos/configure/con_image.c
@@ -209,6 +209,7 @@ bool ro_gui_options_image_click(wimp_pointer *pointer)
data.indirected_text.text, true);
ro_gui_set_icon_selected_state(pointer->w,
IMAGE_DISABLE_ANIMATION, false);
+ /* fall through */
case IMAGE_DISABLE_ANIMATION:
ro_gui_options_update_shading(pointer->w);
break;
diff --git a/frontends/riscos/content-handlers/artworks.c b/frontends/riscos/content-handlers/artworks.c
index 0227603..c107ec6 100644
--- a/frontends/riscos/content-handlers/artworks.c
+++ b/frontends/riscos/content-handlers/artworks.c
@@ -93,7 +93,7 @@ struct awinfo_block {
/* Assembler routines for interfacing with the ArtworksRenderer module */
extern os_error *awrender_init(const char **doc,
- unsigned long *doc_size,
+ size_t *doc_size,
void *routine,
void *workspace);
diff --git a/frontends/riscos/download.c b/frontends/riscos/download.c
index bdc7054..216f575 100644
--- a/frontends/riscos/download.c
+++ b/frontends/riscos/download.c
@@ -313,8 +313,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
/** @todo change this to take a reference to the nsurl and use
* that value directly rather than using a fixed buffer.
*/
- strncpy(dw->url, nsurl_access(url), sizeof dw->url);
- dw->url[sizeof dw->url - 1] = 0;
+ strncpy(dw->url, nsurl_access(url), sizeof(dw->url) - 1);
+ dw->url[sizeof(dw->url) - 1] = 0;
dw->status[0] = 0;
gettimeofday(&dw->start_time, 0);
@@ -414,7 +414,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
return 0;
}
else {
- strncpy(dw->path, local_path, sizeof dw->path);
+ strncpy(dw->path, local_path, sizeof(dw->path) - 1);
+ dw->path[sizeof(dw->path)-1] = 0;
free(local_path);
}
@@ -484,7 +485,8 @@ static void gui_download_window_error(struct gui_download_window *dw,
riscos_schedule(-1, ro_gui_download_update_status_wrapper, dw);
/* place error message in status icon in red */
- strncpy(dw->status, error_msg, sizeof dw->status);
+ strncpy(dw->status, error_msg, sizeof(dw->status) - 1);
+ dw->status[sizeof(dw->status)-1] = 0;
error = xwimp_set_icon_state(dw->window,
ICON_DOWNLOAD_STATUS,
wimp_COLOUR_RED << wimp_ICON_FG_COLOUR_SHIFT,
@@ -872,11 +874,11 @@ bool ro_gui_download_click(wimp_pointer *pointer)
ro_gui_drag_icon(x, y, sprite);
} else if (pointer->i == ICON_DOWNLOAD_DESTINATION) {
- char command[256] = "Filer_OpenDir ";
+ char command[sizeof(dw->path) + 14 + 1] = "Filer_OpenDir ";
char *dot;
- strncpy(command + 14, dw->path, 242);
- command[255] = 0;
+ strncpy(command + 14, dw->path, sizeof(command) - 14 - 1);
+ command[sizeof(command) - 1] = 0;
dot = strrchr(command, '.');
if (dot) {
os_error *error;
@@ -1384,7 +1386,8 @@ bool ro_gui_download_save(struct gui_download_window *dw,
}
dw->saved = true;
- strncpy(dw->path, file_name, sizeof dw->path);
+ strncpy(dw->path, file_name, sizeof(dw->path) - 1);
+ dw->path[sizeof(dw->path)-1] = 0;
if (!dw->send_dataload || dw->save_message.data.data_xfer.est_size != -1)
ro_gui_download_remember_dir(file_name);
diff --git a/frontends/riscos/gui/button_bar.c b/frontends/riscos/gui/button_bar.c
index 34ae39a..50e1de3 100644
--- a/frontends/riscos/gui/button_bar.c
+++ b/frontends/riscos/gui/button_bar.c
@@ -189,7 +189,8 @@ struct button_bar *ro_gui_button_bar_create(struct theme_descriptor *theme,
icon->bar_next = NULL;
strncpy(icon->sprite, buttons[def].icon,
- BUTTONBAR_SPRITE_NAME_LENGTH);
+ BUTTONBAR_SPRITE_NAME_LENGTH - 1);
+ icon->sprite[BUTTONBAR_SPRITE_NAME_LENGTH-1] = 0;
snprintf(icon->validation, BUTTONBAR_VALIDATION_LENGTH,
"R5;S%s,p%s", icon->sprite, icon->sprite);
diff --git a/frontends/riscos/gui/throbber.c b/frontends/riscos/gui/throbber.c
index f3b79a6..e3e4106 100644
--- a/frontends/riscos/gui/throbber.c
+++ b/frontends/riscos/gui/throbber.c
@@ -32,6 +32,7 @@
#include "oslib/wimp.h"
#include "utils/log.h"
+#include "utils/utils.h"
#include "riscos/gui.h"
#include "riscos/gui/throbber.h"
@@ -385,7 +386,8 @@ bool ro_gui_throbber_animate(struct throbber *throbber)
throbber->current_frame = 1;
snprintf(sprite_name, THROBBER_SPRITE_NAME_LENGTH,
- "throbber%i", throbber->current_frame);
+ "throbber%i",
+ min(max(throbber->current_frame, 0), 999));
ro_gui_set_icon_string(throbber->window, throbber->icon,
sprite_name, true);
diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c
index ec21e93..8802db7 100644
--- a/frontends/riscos/gui/url_bar.c
+++ b/frontends/riscos/gui/url_bar.c
@@ -1506,7 +1506,7 @@ ro_gui_url_bar_set_content_favicon(struct url_bar *url_bar,
struct gui_window *g)
{
int type = 0;
- char sprite[URLBAR_FAVICON_NAME_LENGTH];
+ char sprite[URLBAR_FAVICON_NAME_LENGTH-1];
struct hlcache_handle *h;
if (url_bar == NULL ||
diff --git a/frontends/riscos/save.c b/frontends/riscos/save.c
index 85fefea..e6b43f1 100644
--- a/frontends/riscos/save.c
+++ b/frontends/riscos/save.c
@@ -40,8 +40,10 @@
#include "utils/config.h"
#include "utils/log.h"
#include "utils/messages.h"
-#include "utils/utf8.h"
+#include "utils/nsoption.h"
#include "utils/nsurl.h"
+#include "utils/utf8.h"
+#include "utils/utils.h"
#include "netsurf/browser_window.h"
#include "netsurf/window.h"
#include "netsurf/bitmap.h"
@@ -60,7 +62,6 @@
#include "riscos/menus.h"
#include "riscos/message.h"
#include "riscos/mouse.h"
-#include "utils/nsoption.h"
#include "riscos/query.h"
#include "riscos/save.h"
#include "riscos/save_draw.h"
@@ -257,7 +258,8 @@ ro_gui_save_create_thumbnail(struct hlcache_handle *h, const char *name)
}
sprite_header = (osspriteop_header *)(area + 1);
- strncpy(sprite_header->name, name, 12);
+ memset(sprite_header->name, 0, 12);
+ memcpy(sprite_header->name, name, min(strlen(name), 12));
/* we can't resize the saveas sprite area because it may move
@@ -1018,7 +1020,7 @@ ro_gui_save_content(struct hlcache_handle *h, char *path, bool force_overwrite)
}
else
gui_save_current_type = GUI_SAVE_OBJECT_ORIG; /** \todo do this earlier? */
- /* no break */
+ /* fall through */
case GUI_SAVE_SOURCE:
case GUI_SAVE_OBJECT_ORIG:
source_data = content_get_source_data(h, &source_size);
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index 2c442ab..2b51c2f 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -3594,7 +3594,8 @@ static void gui_window_set_title(struct gui_window *g, const char *title)
title, scale_disp);
}
} else {
- strncpy(g->title, title, sizeof(g->title));
+ strncpy(g->title, title, sizeof(g->title) - 1);
+ g->title[sizeof(g->title)-1] = 0;
}
ro_gui_set_window_title(g->window, g->title);
diff --git a/include/netsurf/inttypes.h b/include/netsurf/inttypes.h
index 3a16d0e..e222908 100644
--- a/include/netsurf/inttypes.h
+++ b/include/netsurf/inttypes.h
@@ -52,8 +52,13 @@
/** c99 standard printf formatting for size_t type */
#define PRIsizet "zu"
+#if defined(__riscos__)
+/** riscos/unixlib defines ssize_t as a long int */
+#define PRIssizet "ld"
+#else
/** c99 standard printf formatting for ssize_t type */
#define PRIssizet "zd"
+#endif
#endif
--
NetSurf Browser
1 year, 3 months
makerun: branch master updated. 3fe86945effb26bc695ce60bb766bb1524df41d9
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/makerun.git/shortlog/3fe86945effb26bc695ce...
...commit http://git.netsurf-browser.org/makerun.git/commit/3fe86945effb26bc695ce60...
...tree http://git.netsurf-browser.org/makerun.git/tree/3fe86945effb26bc695ce60bb...
The branch, master has been updated
via 3fe86945effb26bc695ce60bb766bb1524df41d9 (commit)
from abdbd16aed11a024d88920b3ad42b62db7e90ddd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/makerun.git/commit/?id=3fe86945effb26bc695...
commit 3fe86945effb26bc695ce60bb766bb1524df41d9
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Update buildsystem for new RISC OS tooling
If cross-compiling for RISC OS, ensure we correctly detect the
new toolchain.
diff --git a/Makefile b/Makefile
index b69eadf..a0a07c4 100644
--- a/Makefile
+++ b/Makefile
@@ -44,8 +44,13 @@ ifeq ($(TARGET),riscos)
EXEEXT := ,e1f
SUBTARGET := -elf-
else
- EXEEXT := ,ff8
- SUBTARGET := -aof-
+ ifneq (,$(findstring arm-riscos-gnueabihf-gcc,$(CC)))
+ EXEEXT := ,e1f
+ SUBTARGET := -elfeabi-
+ else
+ EXEEXT := ,ff8
+ SUBTARGET := -aof-
+ endif
endif
endif
-----------------------------------------------------------------------
Summary of changes:
Makefile | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b69eadf..a0a07c4 100644
--- a/Makefile
+++ b/Makefile
@@ -44,8 +44,13 @@ ifeq ($(TARGET),riscos)
EXEEXT := ,e1f
SUBTARGET := -elf-
else
- EXEEXT := ,ff8
- SUBTARGET := -aof-
+ ifneq (,$(findstring arm-riscos-gnueabihf-gcc,$(CC)))
+ EXEEXT := ,e1f
+ SUBTARGET := -elfeabi-
+ else
+ EXEEXT := ,ff8
+ SUBTARGET := -aof-
+ endif
endif
endif
--
WimpSlot calculator for NetSurf
1 year, 3 months