-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Makefile: move INCDIROPT to common place #625
Conversation
Signed-off-by: Xiang Xiao <[email protected]>
This change effects systems using Cygwin under windows with Windos native toolchain. In that case WINTOOLS will be defined and the -w option must be used. Has that been verified? This change should not be merged if that test case has not been verified. This is the build configuration that I use Windows Cygwin plus Windows native toolchan and this looks to me like it would break my build. Mmm.. Isee that the -w was added in Config.mk. Perhaps there is no issue. We need to have a test case for this configuration! Merging the change is a very big risk with no testing. |
Yes, we need improve github/apache to verify the patch for windows cygwin/native/msys2.
-w doesn't lose, I set the -w in tools/Config.mk https://github.com/apache/incubator-nuttx/pull/625/files#diff-043fcc977f97645d33de793ab09bd262R99
|
Should there be a companion change to incubator-nuttx-apps? |
No, it does not appear to work. My system no longer builds. Looking into it. Never mind, seems to have been a bad initial setup. I do see this error during dependency generation:
Looks like the code is breaking modularity rules. |
Yes, here: apache/nuttx-apps#141 |
The same error occurs during compilation:
So I am unable to verify the changes. But quite a bit did compile. |
It's time to create wndows VM to very all PR for cygwin/native/msys. |
Whatever binfmt_execmodule.c needs it should not include sched/sched.h directly. the necessary things need to be moved into include/nuttx and binfmt must not include "sched/sched.h". It looks like I did this in commit d798dd3 . that should be fixed. Wow... that was back in 2014. |
So that change is not the direct, root cause of the problem. Rather some change in the include path has broken that build. Let me check. yes. I think this change broke the build.
This is the argumentthat caused the problem:
That is a Cygwin path, not a Windows path. The tool requires a Windows path (i.e., with the -w option). |
I think that the problem is in binfmt/Makefile.
It includes $(TOPDIR)/Make.defs, but apparently does not get the -w option? Any, the build is broken for all Cygwin uses which is the largest part of the user base. |
Should I revert the change? Or can you recommend a fix? |
[I know the problem. WINTOOL is not available to Config.mk. It is included by Make.defs BEFORE WINTOOL is defined. This must be reverted. |
This reverts commit b9ace36. This change was added by PR 625 but has a serious logic flaw. It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk: else ifeq ($(WINTOOL),y) DEFINE = "$(TOPDIR)/tools/define.sh" INCDIR = "$(TOPDIR)/tools/incdir.sh" -w This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined. As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
This reverts commit b9ace36. This change was added by PR 625 but has a serious logic flaw. It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk: else ifeq ($(WINTOOL),y) DEFINE = "$(TOPDIR)/tools/define.sh" INCDIR = "$(TOPDIR)/tools/incdir.sh" -w This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined. As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
Ok, I will find a method ensure WINTOOL get define before include Config.mk |
I fixed the issues with binfmt/binfmt_execmodule.c with PR #632 and I cannot find any other location with this exact failure setup, This does not fix the logical, ordering problem in general so I don't think recommends the PR. The best fix would be to make WINTOOL into a configuration option CONFIG_BUILD_WINTOOL that is set automatically if a Windows native toolcahin is selected and if the platform is Cygwin. Thent he definition with exist prior to the first inclusion of Config.mk. Currently WINTOOL is set in the Toolchain.defs file. It would affect several Kconfig files to make it a pre-existing configuration setting. |
Signed-off-by: Xiang Xiao [email protected]