Skip to content

Commit f06b801

Browse files
salkiniumrleh
authored andcommitted
[build] Remove GCC10 vs GCC12 detection at build-time
1 parent a04f58e commit f06b801

File tree

5 files changed

+4
-25
lines changed

5 files changed

+4
-25
lines changed

src/modm/platform/core/avr/module.lb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def build(env):
3636
env.outbasepath = "modm/link"
3737
env.copy("linkerscript.ld")
3838
env.collect(":build:linkflags", "-L{project_source_dir}",
39+
"-Wl,--no-warn-rwx-segment",
3940
"-T{}".format(env.relcwdoutpath("modm/link/linkerscript.ld")))
4041

4142
env.substitutions = {
@@ -78,5 +79,6 @@ def build(env):
7879
mmcu = mmcu[:-2] + mmcu[-2:].replace(suffix, "")
7980
env.collect(":build:archflags","-mmcu={}".format(mmcu))
8081
env.collect(":build:cppdefines", "F_CPU={}".format(env["f_cpu"]))
82+
env.collect(":build:ccflags", "--param=min-pagesize=0")
8183

8284

src/modm/platform/core/cortex/module.lb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ def build(env):
346346
if env.has_module(":architecture:unaligned"):
347347
env.template("unaligned_impl.hpp.in")
348348

349-
env.collect(":build:linkflags", "-Wl,--no-wchar-size-warning", "-L{project_source_dir}")
349+
env.collect(":build:linkflags", "-Wl,--no-wchar-size-warning",
350+
"-Wl,--no-warn-rwx-segment", "-L{project_source_dir}")
350351
# Linkerscript
351352
linkerscript = env["linkerscript.override"]
352353
env.collect(":build:linkflags", "-T{}".format(env.relcwdoutpath(

tools/build_script_generator/cmake/resources/ModmConfiguration.cmake.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,6 @@ set({{ name | upper }}{{ "_" ~ (profile | upper) if profile | length else "" }}
120120
{{ generate_flags("ccwarn") }}
121121
{{ generate_flags("cxxwarn") }}
122122

123-
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 12)
124-
list(APPEND LINKFLAGS -Wl,--no-warn-rwx-segment)
125-
%% if core.startswith("avr")
126-
list(APPEND CCFLAGS --param=min-pagesize=0)
127-
%% endif
128-
endif()
129-
130123
target_compile_definitions(${target_options} INTERFACE
131124
${CPPDEFINES}
132125
$<$<CONFIG:MinSizeRel>:${CPPDEFINES_RELEASE}>

tools/build_script_generator/make/resources/repo.mk.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ CCFLAGS += $(ARCHFLAGS)
4343
ASFLAGS += $(ARCHFLAGS)
4444
LINKFLAGS += $(ARCHFLAGS)
4545

46-
%% if platform != "hosted"
47-
# This flag is neccessary for GCC12, but fails for earlier GCCs
48-
ifeq "$(shell expr `echo $(COMPILER_VERSION) | cut -f1 -d.` \>= 12)" "1"
49-
LINKFLAGS += "-Wl,--no-warn-rwx-segment"
50-
%% if core.startswith("avr")
51-
CCFLAGS += "--param=min-pagesize=0"
52-
%% endif
53-
endif
54-
%% endif
5546
%% endif
5647

5748
%% if include_paths | length

tools/build_script_generator/scons/resources/SConscript.in

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ env.Append(CCFLAGS="$ARCHFLAGS")
8282
env.Append(ASFLAGS="$ARCHFLAGS")
8383
env.Append(LINKFLAGS="$ARCHFLAGS")
8484

85-
%% if platform != "hosted"
86-
if env.CompilerVersion() >= 120000:
87-
env.Append(LINKFLAGS="-Wl,--no-warn-rwx-segment")
88-
%% if core.startswith("avr")
89-
env.Append(CCFLAGS="--param=min-pagesize=0")
90-
%% endif
91-
%% endif
92-
9385
%% if family != "darwin"
9486
# Search all linked static libraries multiple times
9587
env["_LIBFLAGS"] = "-Wl,--start-group " + env["_LIBFLAGS"] + " -Wl,--end-group"

0 commit comments

Comments
 (0)