Bug#953844: This appears to be due to "provide-stdint-for-embedded.patch"

2024-04-22 Thread Johannes Schauer Marin Rodrigues
Hi Keith,

On Thu, 14 Jul 2022 15:19:22 +0100 Steve Capper  wrote:
> With some stracing, it became apparent that the newlib headers were 
> pulling in an extra stdint.h (that wasn't part of newlib). I rebuilt the 
> gcc-arm-none-eabi package with the "provide-stdint-for-embedded.patch" 
> removed. That then allowed me to build the SCP firmware without issue.

I made the same discovery when building my package pico-sdk (currently in NEW).
The package builds fine if I remove provide-stdint-for-embedded.patch from
gcc-arm-none-eabi. But with gcc-arm-none-eabi in unstable I have to apply the
following patch to my package pico-sdk:

--- a/test/pico_stdlib_test/pico_stdlib_test.c
+++ b/test/pico_stdlib_test/pico_stdlib_test.c
@@ -9,6 +9,7 @@
 #include "pico/stdlib.h"
 #include "pico/bit_ops.h"
 #include 
+#define PRIu64 "lu"
 
 void test_builtin_bitops() {
 int32_t x = 0;
--- a/test/pico_time_test/pico_time_test.c
+++ b/test/pico_time_test/pico_time_test.c
@@ -12,6 +12,7 @@
 #include "pico/test.h"
 #include 
 PICOTEST_MODULE_NAME("pico_time_test", "pico_time test harness");
+#define PRIi64 "li"
 
 #define NUM_TIMEOUTS 500
 #define MAX_TIMERS_PER_POOL 250

I landed here as Raspberry PI developer Andrew Scheller found this bug with the
Debian packaging of of gcc-arm-none-eabi.

Thanks!

cheers, josch

signature.asc
Description: signature


Bug#953844: This appears to be due to "provide-stdint-for-embedded.patch"

2022-07-14 Thread Steve Capper

Hello,
I also ran into this issue when building firmware.

FWIW, my steps can be found condensed here:
=
FROM debian:sid
WORKDIR /build
RUN apt-get update && apt-get -y install gcc-arm-none-eabi git \
cmake make
RUN git clone https://git.morello-project.org/morello/scp-firmware.git && \
cd scp-firmware && git checkout \
97c99fcc60b5f3d86767c66390353d1205bce4a5
RUN mkdir build-scp && cd build-scp && cmake -DCMAKE_BUILD_TYPE=Debug \
-DSCP_FIRMWARE_SOURCE_DIR:PATH=morello/scp_ramfw_soc \
../scp-firmware
RUN cmake --build build-scp
=

This then led to:
=
In file included from 
/build/scp-firmware/module/cmn_skeena/src/cmn_skeena_ccix.c:18:
/build/scp-firmware/module/cmn_skeena/src/cmn_skeena_ccix.c: In function 
'enable_and_start_ccix_link_up_sequence':
/build/scp-firmware/module/cmn_skeena/src/cmn_skeena_ccix.c:383:46: 
error: expected ')' before 'PRIx64'

383 | MOD_NAME "CXLA_PCIE_HDR_FIELDS: 0x%" PRIx64,
| ^~
/build/scp-firmware/framework/include/fwk_log.h:222:46: note: in 
definition of macro 'FWK_LOG_INFO'

222 | # define FWK_LOG_INFO(...) fwk_log_printf(__VA_ARGS__)
| ^~~
/build/scp-firmware/module/cmn_skeena/src/cmn_skeena_ccix.c:28:18: 
error: spurious trailing '%' in format [-Werror=format=]

28 | #define MOD_NAME "[CMN_SKEENA] "
| ^~~
/build/scp-firmware/framework/include/fwk_log.h:222:46: note: in 
definition of macro 'FWK_LOG_INFO'

222 | # define FWK_LOG_INFO(...) fwk_log_printf(__VA_ARGS__)
| ^~~
/build/scp-firmware/module/cmn_skeena/src/cmn_skeena_ccix.c:383:9: note: 
in expansion of macro 'MOD_NAME'

383 | MOD_NAME "CXLA_PCIE_HDR_FIELDS: 0x%" PRIx64,
| ^~~~
cc1: all warnings being treated as errors
gmake[2]: *** 
[module/modules/cmn-skeena/CMakeFiles/module-cmn-skeena.dir/build.make:104: 
module/modules/cmn-skeena/CMakeFiles/module-cmn-skeena.dir/src/cmn_skeena_ccix.c.obj] 
Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1748: 
module/modules/cmn-skeena/CMakeFiles/module-cmn-skeena.dir/all] Error 2

gmake: *** [Makefile:91: all] Error 2
=

With some stracing, it became apparent that the newlib headers were 
pulling in an extra stdint.h (that wasn't part of newlib). I rebuilt the 
gcc-arm-none-eabi package with the "provide-stdint-for-embedded.patch" 
removed. That then allowed me to build the SCP firmware without issue.


Could the stdint patch please be tweaked? (apologies, I haven't the 
first clue how it can be tweaked :-( )


Cheers,
--
Steve