Skip to content

Commit 044408d

Browse files
committed
Upgrage rl78 for intended GCC 15.1
1 parent 67b5202 commit 044408d

8 files changed

Lines changed: 41 additions & 13 deletions

File tree

ref_app/src/app/benchmark/app_benchmark_trapezoid_integral.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828

2929
#endif
3030

31-
#if (defined(STDFLOAT_FLOAT64_NATIVE_TYPE) || (defined(__STDCPP_FLOAT64_T__) && (__STDCPP_FLOAT64_T__ == 1)))
31+
#if (defined(__GNUC__) && defined(__RL78__))
32+
33+
using local_float_type = std::float32_t;
34+
static_assert((std::numeric_limits<local_float_type>::digits >= 24), "Error: Incorrect local_float_type type definition");
35+
36+
#elif (defined(STDFLOAT_FLOAT64_NATIVE_TYPE) || (defined(__STDCPP_FLOAT64_T__) && (__STDCPP_FLOAT64_T__ == 1)))
3237

3338
using local_float_type = std::float64_t;
3439
static_assert((std::numeric_limits<local_float_type>::digits >= 53), "Error: Incorrect local_float_type type definition");

ref_app/src/math/calculus/integral.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{
3939
const std::uint_fast32_t two_j_plus_one { (j * UINT32_C(2)) + UINT32_C(1) };
4040

41-
sum += real_function(a + real_value_type(step * two_j_plus_one));
41+
sum += real_function(a + real_value_type(step * static_cast<real_value_type>(two_j_plus_one)));
4242
}
4343

4444
const real_value_type tmp { result };

ref_app/src/util/STL/cinttypes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2021.
2+
// Copyright Christopher Kormanyos 2021 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -8,7 +8,11 @@
88
#ifndef CINTTYPES_2021_10_19_
99
#define CINTTYPES_2021_10_19_
1010

11+
#if (defined(__GNUC__) && defined(__RL78__))
12+
#include <stdint-gcc.h>
13+
#else
1114
#include <inttypes.h>
15+
#endif
1216
#include <cstdint>
1317

1418
namespace std

ref_app/src/util/STL/cmath

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,13 +725,22 @@
725725
template<typename FloatType>
726726
inline bool isinf_impl(FloatType x)
727727
{
728+
#if defined(__GNUC__)
729+
#pragma GCC diagnostic push
730+
#pragma GCC diagnostic ignored "-Wfloat-equal"
731+
#endif
732+
728733
using float_type = FloatType;
729734

730735
return
731736
(
732737
( x == std::numeric_limits<float_type>::infinity())
733738
|| (-x == std::numeric_limits<float_type>::infinity())
734739
);
740+
741+
#if defined(__GNUC__)
742+
#pragma GCC diagnostic pop
743+
#endif
735744
}
736745

737746
} // namespace cmath_detail

ref_app/src/util/STL/stdfloat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
#define __STDCPP_FLOAT64_T__ 1
2727
#endif
2828

29+
#elif (defined(__GNUC__) && defined(__RL78__))
30+
31+
using float64_t = long double;
32+
#define __STDCPP_FLOAT64_T__ 1
33+
2934
#else
3035

3136
using float64_t = double;

ref_app/target/micros/rl78/make/rl78.ld

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/*
2-
Copyright Christopher Kormanyos 2007 - 2024.
2+
Copyright Christopher Kormanyos 2007 - 2025.
33
Distributed under the Boost Software License,
44
Version 1.0. (See accompanying file LICENSE_1_0.txt
55
or copy at http://www.boost.org/LICENSE_1_0.txt)
66
*/
77

8+
INPUT(libc.a libm.a libgcc.a)
9+
810
OUTPUT_ARCH(rl78)
911

1012
/* The beginning and end of the program ROM area */
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright Christopher Kormanyos 2014 -2024.
2+
# Copyright Christopher Kormanyos 2014 -2025.
33
# Distributed under the Boost Software License,
44
# Version 1.0. (See accompanying file LICENSE_1_0.txt
55
# or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -9,7 +9,7 @@
99
# compiler flags for the target architecture
1010
# ------------------------------------------------------------------------------
1111

12-
GCC_VERSION = 13.2.0
12+
GCC_VERSION = 15.1.0
1313
GCC_TARGET = rl78-unknown-elf
1414
GCC_PREFIX = rl78-unknown-elf
1515

@@ -18,21 +18,22 @@ TGT_SUFFIX = elf
1818
TGT_ALLFLAGS = -Os \
1919
-mcpu=g13 \
2020
-mmul=g13 \
21-
-fno-inline-functions
21+
-fno-inline-functions \
22+
-ffreestanding
2223

23-
TGT_CFLAGS = -std=c99 \
24+
TGT_CFLAGS = -std=c11 \
2425
-Wunsuffixed-float-constants \
2526
$(TGT_ALLFLAGS)
2627

27-
TGT_CXXFLAGS = -std=c++14 \
28+
TGT_CXXFLAGS = -std=c++20 \
2829
$(TGT_ALLFLAGS)
2930

30-
TGT_INCLUDES = -isystem $(PATH_APP)/util/STL
31+
TGT_INCLUDES = -isystem$(PATH_APP)/util/STL
3132

3233
TGT_AFLAGS =
3334

3435
TGT_LDFLAGS = -nostartfiles \
36+
-nostdlib \
3537
-Wl,--gc-sections \
3638
-Wl,-Map,$(APP).map \
37-
-T $(LINKER_DEFINITION_FILE) \
38-
--specs=nosys.specs
39+
-T $(LINKER_DEFINITION_FILE)

ref_app/target/micros/stm32f446/make/stm32f446_flags.gmk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ TGT_CXXFLAGS = -std=c++14
3333
-Wno-psabi \
3434
$(TGT_ALLFLAGS)
3535

36-
TGT_INCLUDES = -isystem $(PATH_APP)/util/STL
36+
INC_PREFIX := -isystem
37+
38+
TGT_INCLUDES = $(INC_PREFIX)$(PATH_APP)/util/STL
3739

3840
TGT_AFLAGS =
3941

0 commit comments

Comments
 (0)