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

Fix SITL compilation on macosx #9012

Merged
merged 7 commits into from
Apr 26, 2023
Merged

Fix SITL compilation on macosx #9012

merged 7 commits into from
Apr 26, 2023

Conversation

mmosca
Copy link
Collaborator

@mmosca mmosca commented Apr 25, 2023

Clean up cmake files for SITL and fix the compilation issues caused by tooling differences between gcc and clang (used in MacOSX).

SITL on MacOSX still has lots of compile time warnings that need to be addressed and some known issues that prevent it from working with simulators, but those will be addressed in 7.0.

At this point, I don't think MacOSX SITL is ready to be added to the configurator. That should be targeted for 7.0.

Still need some CMake work to write the final binary.

Has lots of warning, probably fixable by forcing C_STANDARD to 11 for everyone,
but that is probably a change for 7.0
@mmosca mmosca requested a review from stronnag April 25, 2023 18:23
@stronnag
Copy link
Collaborator

Agree that forcing C11 should be fine everywhere (SITL 6.1.0, all 7.0). SITL GCC 12 linux is happy with that.

@mmosca mmosca marked this pull request as ready for review April 25, 2023 20:07
@stronnag
Copy link
Collaborator

stronnag commented Apr 25, 2023

GCC, on linux (and freebsd), this now dumps out the map to STDOUT rather than a file. Undesirable.
Otherwise, it builds and runs (including passing calibration). It continues to fail to complete calibration on (my) MacOS VM.
I'll check Windows/Cygwin 2023-04-26

@mmosca
Copy link
Collaborator Author

mmosca commented Apr 25, 2023

GCC, on linux (and freebsd), this now dumps out the map to STDOUT rather than a file. Undesirable. Otherwise, it builds and runs (including passing calibration). It continues to fail to complete calibration on (my) MacOS VM. I'll check Windows/Cygwin 2023-04-26

What do you mean by dumping the map to stdout? I did not notice anything wrong on wsl.

@stronnag
Copy link
Collaborator

The cref map, e.g:

$ ninja
[0/1] Re-running CMake...
-- toolchain: host, WARNINGS_AS_ERRORS: OFF
-- DEBUG_HARDFAULTS: OFF, SEMIHOSTING: OFF
-- DEBUG_HARDFAULTS: OFF, SEMIHOSTING: OFF
-- 1 targets (1 for release) found for toolchain host
-- Build type: RelWithDebInfo
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /t/tmp/inav-makefile/_sitl
[1/290] Removing intermediate files for SITL
[1/1] Cleaning all built files...
Cleaning... 289 files.
[289/290] Linking C executable bin/SITL.elf
/usr/bin/ld: warning: bin/SITL.elf has a LOAD segment with RWX permissions

Cross Reference Table

Symbol                                            File
GForce.lto_priv.0                                 /tmp/ccsvhMwX.ltrans3.ltrans.o
                                                  /tmp/ccsvhMwX.ltrans6.ltrans.o
GForceAxis.lto_priv.0                             /tmp/ccsvhMwX.ltrans3.ltrans.o
                                                  /tmp/ccsvhMwX.ltrans6.ltrans.o
GLIBC_2.10                                        /usr/lib/libc.so.6
GLIBC_2.11                                        /usr/lib/libc.so.6
GLIBC_2.12                                        /usr/lib/libc.so.6
GLIBC_2.13                                        /usr/lib/libc.so.6
GLIBC_2.14                                        /usr/lib/libc.so.6
GLIBC_2.15                                        /usr/lib/libm.so.6
                                                  /usr/lib/libc.so.6
...*** (about 14600 lines removed ***...
                                                  src/main/target/SITL/CMakeFiles/SITL.elf.dir/__/__/blackbox/blackbox_encoding.c.o (symbol from plugin)
[290/290] cd /t/tmp/inav-makefile/_sit...mp/inav-makefile/_sitl/inav_6.1.0_SITL

c. 14600 lines of it.
I can look at it a bit later. but I'd hazard a guess that if we no longer use generate_map_file target for SITL, then we should also unconditionally remove --cref from the link stage; we don't need a cref for SITL.

@mmosca
Copy link
Collaborator Author

mmosca commented Apr 26, 2023 via email

@mmosca
Copy link
Collaborator Author

mmosca commented Apr 26, 2023

Turns out I was in the wrong branch in wsl. (facepalm)

@DzikuVx DzikuVx added this to the 6.1 milestone Apr 26, 2023
Copy link
Collaborator

@stronnag stronnag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No regressions for Linux, Windows/Cygwin or FreeBSD/GCC.

@mmosca mmosca merged commit 30ec804 into release_6.1.0 Apr 26, 2023
@mmosca mmosca deleted the mosca-sitl-mac branch April 26, 2023 14:20
sensei-hacker pushed a commit to sensei-hacker/inav_unofficial_targets that referenced this pull request Oct 4, 2023
Clean up cmake files for SITL and fix the compilation issues caused by tooling differences between gcc and clang (used in MacOSX).

SITL on MacOSX still has lots of compile time warnings that need to be addressed and some known issues that prevent it from working with simulators, but those will be addressed in 7.0.

At this point, I don't think MacOSX SITL is ready to be added to the configurator. That should be targeted for 7.0.
sensei-hacker pushed a commit to sensei-hacker/inav_unofficial_targets that referenced this pull request Oct 4, 2023
Clean up cmake files for SITL and fix the compilation issues caused by tooling differences between gcc and clang (used in MacOSX).

SITL on MacOSX still has lots of compile time warnings that need to be addressed and some known issues that prevent it from working with simulators, but those will be addressed in 7.0.

At this point, I don't think MacOSX SITL is ready to be added to the configurator. That should be targeted for 7.0.
sensei-hacker pushed a commit to sensei-hacker/inav_unofficial_targets that referenced this pull request Oct 4, 2023
Clean up cmake files for SITL and fix the compilation issues caused by tooling differences between gcc and clang (used in MacOSX).

SITL on MacOSX still has lots of compile time warnings that need to be addressed and some known issues that prevent it from working with simulators, but those will be addressed in 7.0.

At this point, I don't think MacOSX SITL is ready to be added to the configurator. That should be targeted for 7.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants