-
Notifications
You must be signed in to change notification settings - Fork 2k
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
native: remove non required NATIVEINCLUDES #8652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK in general.
Did you compare the resulting command lines for gcc before and after?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for safety I tested with Valgrind and it still works ;-).
@gebart Normally the gcc command line must be different before and after but I did not compared the real difference. I am first waiting for murdock result at least :) I know my check is not against "system" includes directories and it could be a problem. I do not really know how to test this right now. |
The script output before my PR:
|
The script output with the PR:
|
For the difference between before and after by using #8714 The CFLAGS are the same, only includes changed. Before
After (I moved the
For all modules using
|
589c6c2
to
f800ce2
Compare
Some more testing by analyzing the generated I added a commit that replace |
Just pushing for testing on other machines, it should still be cleaned and tested. |
You don't need the special filter out of includes for native because the headers in sys/posix/include already have a preprocessor conditional include_next that forwards the include to the system header |
Without it, it was not compiling on @kYc0o mac for native. It was saying there was a type definition conflict or something. |
Without the last commit, while building examples/posix_sockets I have this error: /Users/facosta/git/RIOT-OS/RIOT/sys/posix/include/sys/bytes.h:31:16: error: typedef redefinition with different types ('size_t'
(aka 'unsigned long') vs '__darwin_socklen_t' (aka 'unsigned int'))
typedef size_t socklen_t; /**< socket address length */
^
/usr/include/sys/_types/_socklen_t.h:30:28: note: previous definition is here
typedef __darwin_socklen_t socklen_t;
^
1 error generated. |
f800ce2
to
bd9668a
Compare
Fixed the two compilation problems found for
A last round of test could be cool on different setups:
|
Re-tested and everything works OK. |
You may squash it to get Murdock green. |
@LudwigKnuepfer while you are online atm: do you remember why we did it this way? |
53911e7
to
cd4384a
Compare
In another header file, `socklen_t` is defined to `__darwin_socklen_t` which is an `uint32_t` and it conflicts. Preparation to remove NATIVEINCLUDES.
netdev_tap.c uses AF_LINK when compiled on OSX native. Preparation to remove NATIVEINCLUDES.
Some modules used a 'NATIVEINCLUDES' with different include path and no other included directories. It was defining basic 'include' in a different order and not using other things defined in INCLUDES. After doing some checks with the given include path and possible conflicting files, there should be no conflict when using the default one. * No common headers between all the NATIVEINCLUDES directories * No common headers files between board/native/include, cpu/native/include and other files in the repository (except other boards/cpus of course).
cd4384a
to
93a521c
Compare
Probably something with OSX... why don't you check the history? |
Well... I did, but
is less then helpful as a description ;-). |
It does make sense, as a module only needs to see its dependencies INCLUDES, not other unrelated modules INCLUDES. So in that case native board does not need to see the pkg/libfixmath includes which could be added by the build system to INCLUDES.. The reason I proposed to see if could be removed, is for cleanup purposes in the current build system.
Another solution for this could be to just match the default RIOT include order and document why its required. I started this PR to know why it was needed. So I could create another PR to fix it in this way. The provided patches fixes two definitions issues when building on osx. Also it removes a specific configuration in the build system that needs to be understood. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, looks ok for me. @gebart you want to approve this too?
IIRC: RIOT is an operating system that has some degree of POSIX support (but not complete and that is important here!), the host system of RIOT |
I thought the same and I tested this PR thoroughly, no errors so far both in compilation and tests (for those which have tests). So it may happen in the future, but it will break before it gets into RIOT. |
@kYc0o did you also test the tooling around native? |
(this isn't tested by Murdock, as far as I know) |
Just tested and works as good/bad than in master. Anything special thing/case that should I test? I just tested examples/posix_sockets which is the one caused trouble before. |
For info, the output: valgrind --leak-check=full --track-origins=yes --fullpath-after=/Users/facosta/git/RIOT-OS/RIOT/ --read-var-info=yes /Users/facosta/git/RIOT-OS/RIOT/examples/posix_sockets/bin/native/posix_sockets_example.elf tap0
==73341== Memcheck, a memory error detector
==73341== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==73341== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==73341== Command: /Users/facosta/git/RIOT-OS/RIOT/examples/posix_sockets/bin/native/posix_sockets_example.elf tap0
==73341==
--73341-- run: /usr/bin/dsymutil "/Users/facosta/git/RIOT-OS/RIOT/examples/posix_sockets/bin/native/posix_sockets_example.elf"
parse DIE(readdwarf3.c:3651): confused by:
<2><80>: Abbrev Number: 7 (DW_TAG_subrange_type)
DW_AT_type : <87>
DW_AT_count : 2
parse_type_DIE:
--73341-- WARNING: Serious error when reading debug info
--73341-- When reading debug info from /Users/facosta/git/RIOT-OS/RIOT/examples/posix_sockets/bin/native/posix_sockets_example.elf:
--73341-- confused by the above DIE
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.
main(): This is RIOT! (Version: 2018.07-devel-656-ga0017-snake.local)
RIOT socket example application
All up, running the shell now
> ^C
native: exiting
native: exiting
==73341==
==73341== HEAP SUMMARY:
==73341== in use at exit: 0 bytes in 0 blocks
==73341== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==73341==
==73341== All heap blocks were freed -- no leaks are possible
==73341==
==73341== For counts of detected and suppressed errors, rerun with: -v
==73341== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==73343==
==73343== HEAP SUMMARY:
==73343== in use at exit: 0 bytes in 0 blocks
==73343== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==73343==
==73343== All heap blocks were freed -- no leaks are possible
==73343==
==73343== For counts of detected and suppressed errors, rerun with: -v
==73343== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be enough (also tested the same with Ubuntu 17.04). Then let's finally merge this!
I disagree, but admit it's not as elaborative as it should have been. I guess the discussion here covered all points, at least as far as my (refreshed) memory goes... In particular the ticket (#793) referenced in the PR that contains that commit (#804), mentions:
I guess it would be worthwhile to see if the compiler invocation has changed significantly in between now and then to understand why there appear to be no problems anymore with this. Also, make sure no compiler warnings (try and enable more warnings that fit the problem) regarding this thematic complex show up. (I won't have time to dig into it).
I think having only definitions declared in compilation units the active compilation unit is modelled to depend on is a great idea. |
While trying to document more what is done in boards and cpu Makefile.include files I found this native 'NATIVEINCLUDES' special case and found no current reasons to have it.
Also, not real explanation on why it is needed.
Contribution description
Some modules used a 'NATIVEINCLUDES' with different include path and no other included directories.
It was defining basic 'include' in a different order and not using other things defined in INCLUDES.
After doing some checks with the given include path and possible conflicting files, there should be no conflict when using the default one.
other files in the repository (except other boards/cpus of course).
Notes
I found reference in a previous issue here #793 but it looks like its not the case anymore.
Maybe I am missing some things and would like to ask at least if it is still necessary.
Also they may be other solutions to not need this special case.
If its still necessary, I would change the PR to only use the same include order as the one currently used in RIOT as there is no reasons to have another one.
I tried to detect problems with this script:
Issues/PRs references
None.