Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fixed cygwin build with malloc wrap #27473

Merged
merged 3 commits into from
Jul 6, 2024

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Jul 6, 2024

on Cygwin we need to wrap _malloc_r not malloc
See https://cygwin.com/pipermail/cygwin/2000-July/038916.html
fixes #27197

@tridge tridge added the SITL label Jul 6, 2024
@robustini
Copy link
Contributor

@tridge thanks for the fix!
Cygwin64 correctly compiles the executable for SITL but then Mission Planner executes it and closes the task immediately with an error.
So ok to compile but then it doesn't work in Mission Planner.

@tridge tridge force-pushed the pr-cygwin-malloc-wrap branch from 4d942f4 to 5ac71d4 Compare July 6, 2024 09:11
@tridge
Copy link
Contributor Author

tridge commented Jul 6, 2024

Cygwin64 correctly compiles the executable for SITL but then Mission Planner executes it and closes the task immediately with an error.

it starts and runs for me fine.
http://uav.tridgell.net/tmp/cygwin-test/

@robustini
Copy link
Contributor

robustini commented Jul 6, 2024

At the moment I tried with the copter, compiling the master right, it runs it but closes it right away.
i use this simple custom script for a long time and it has always worked:

#!/bin/bash
cd /home/marco/src
rm -rf ardupilot
git clone https://github.com/ardupilot/ardupilot.git
cd ardupilot
git submodule update --init --recursive
modules/waf/waf-light distclean
modules/waf/waf-light configure --board sitl --toolchain x86_64-pc-cygwin
modules/waf/waf-light copter
cp /home/marco/src/ardupilot/build/sitl/bin/arducopter.exe "/cygdrive/c/users/marco/Documents/Mission Planner/sitl"

immagine

@tridge
Copy link
Contributor Author

tridge commented Jul 6, 2024

At the moment I tried with the copter, compiling the master right, it runs it but closes it right away.

I've put working copter here:
http://uav.tridgell.net/tmp/cygwin-test/

@robustini
Copy link
Contributor

robustini commented Jul 6, 2024

At the moment I tried with the copter, compiling the master right, it runs it but closes it right away.

I've put working copter here: http://uav.tridgell.net/tmp/cygwin-test/

Thanks, indeed yours works, mine doesn't but it doesn't give any error in compilation, nice mystery!
But I notice that the size of the exe is different.

@robustini
Copy link
Contributor

I deleted Cygwin completely and reinstalled from scratch with the wiki options, compiled the exe all the time with no problems but it keeps closing.
If I run it manually in the command prompt I get the prompt back without any writing or error.
I can't give an explanation, I don't understand how it works for you after compilation.

@tridge
Copy link
Contributor Author

tridge commented Jul 6, 2024

@robustini I have tested the version built by CI which is what we distribute, and it works, so I will merge so SITL works again

@tridge tridge merged commit 8be0a64 into ArduPilot:master Jul 6, 2024
92 checks passed
@robustini
Copy link
Contributor

I'm continuing to investigate because what I've described is happening here, but I'm not coming out of it, and I won't be I think the only one with this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom firmware for RealFlight and Mission planner doesn't work as per instructions
2 participants