Skip to content

Commit

Permalink
Tools: wrap _malloc_r on cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Jul 6, 2024
1 parent 2f9f58d commit 4d942f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Tools/ardupilotwaf/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,10 @@ def configure_env(self, cfg, env):
]

# wrap malloc to ensure memory is zeroed
# don't do this on MacOS as ld doesn't support --wrap
if platform.system() != 'Darwin':
if cfg.env.DEST_OS == 'cygwin':
# on cygwin we need to wrap _malloc_r instead
env.LINKFLAGS += ['-Wl,--wrap,_malloc_r']
elif platform.system() != 'Darwin':
env.LINKFLAGS += ['-Wl,--wrap,malloc']

if cfg.options.enable_sfml:
Expand Down

0 comments on commit 4d942f4

Please sign in to comment.