-
-
Notifications
You must be signed in to change notification settings - Fork 7k
avr-gcc 1.4.8 in windows sometimes ommits drive and start of path. #2422
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
Comments
Let me add I've checked this same problem occurs on drive |
Weird. I think that Windows does have the concept of an active drive, so you can refer to What seems weird is that in the end it does seem to end up with an include path?
This error message is also weird:
It also omits R:/Test from the preferred path. You say R:\test is the current directory (though in that case The cygwin docs don't really help here either, they suggest you'll need an
So perhaps cygwin is picking I'm inclined to say this debug output looks ok and there is no problem, but you didn't start all this for nothing :-) Reading the original report, I couldn't easily find the original problem, though, care to show some commands here that show the actual failure? |
Current directory is R:/Test/ArduinoIDE and the active drive concept is Il venerdì 7 novembre 2014, Matthijs Kooijman [email protected] ha
|
@matthijskooijman The reason for that is that the "avr-g++ -E -P -v -dD spec.c" command is designed for (and used by CDT) to find all "compiler specific include and library paths and defines". As the R:/Test is removed from the include and library paths most indexer based eclipse services fail due to bad compiler include paths. As the "path gathering" is actually the CDT way (and documented gcc way) I'm sure we can say "the arduino IDE 1.5.7 and higher do not work as a toolchain in eclipse" Here are the compilation options described that I think are being used. All info below comes from https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#Preprocessor-Options M -P |
Ok, thanks for providing the context. I think that gcc is not doing anything wrong - it's outputting the proper pathnames. However, it is outputting them as UNIX-style paths, using R:\Test as the root / of the filesystem. To properly interpret these paths, you'll need to know what / points to. So I can see two solutions:
I'm wondering where this change in behaviour comes from, and if any of the other CDT tools are suffering from this too. Is it a cygwin version change, or a gcc version change that caused the change? |
I've changed the current directory to one folder upward, from |
I confirm, the same error pops up with a message (translating from Italian here): Cannot run the program due to missing cygwin1.dll. To solve the issue try re-installing the software. It seems the problem is to properly identify the compiler's path as that is reported correctly by 1.5.5 but incorrectly by 1.5.7 and 1.5.8. I can run other tests if you wish, one thing I've tried is to use a different folder name I had GNU Coreutils installed and tried to remove that, still no joy. |
Launching folder was |
And here is another test. |
Weird enough I just tried another configuration, moving the Eclipse folder one level out, so that I now have
Note
|
I'm sorry to say I disagree. IMHO the behaviour is a bug. This for following reasons
I think it is a pretty complex problem as it involves gcc, cygwin and a glitch. IMHO it is a bug all-right. |
Apologies for the correction Jantje, but D:\Parent\eclipseArduino was On my environment (Win 7 Ultimate 64bits) it fails pretty consistently. Can you check if you have an Arduino IDE installation on your Z drive root? Il venerdì 7 novembre 2014, jantje [email protected] ha scritto:
|
I didn't say that this wasn't a bug per-se, just that it's not gcc's fault. It seems gcc was compiled against cygwin, which has some special path handling for Windows, which is a but unconventional and surprising, but there's probably some good reason for it. It's annoying that things are (or at least look) so unpredictible, though.
This seems true - the docs said that in case of multiple mounts the longest path is picked, which would be /r/.... Perhaps the output that mount gives does not correspond to the fstab that is used by gcc? If mount.exe was copied from another version, it's output might not be representative?
It's not a relative path, it's an absolute path that starts against /. Since Windows doesn't have a concept of /, / is mapped to R:/Test (or wherever, depending on the example), which makes it look like a relative path, but it really is an absolute path (in the Unix sense).
Uh, CYGWIN is specifically a port of UNIX tools to Windows. When using CYGWIN, I think you are essentially using UNIX, not Windows :-p Having said that, using native win32 paths might be easier to integrate of course. There's probably technical reasons to not always use them (which I don't know). I'm just responding to your remarks here directly. Unfortunately I don't understand what happens exactly either, so I can't offer any suggestions for a solution :-(
What happens when you make |
Here you go
|
Hmm, I had hoped that would show R:\Windows as /, which would make stuff more consistent, but apparently it doesn't work like that. Still, the mount.exe coming from another version could mean that gcc's and mount's view on the filesystem are different... |
Would you be able to supply the correct |
I don't know where to find a proper mount version. You could look at the scripts in https://github.com/arduino/toolchain-avr which are used to compile the (new version of the) toolchain. Perhaps you can run those scripts and compile mount and/or or find out what cygwin version was used exactly? |
Went through the scripts, no reference to the cygwin version whatsoever, just a mention in the readme it is required pointing directly to the cygwin site. I believe it just uses whatever version is installed on the building system... And |
Hm. @ffissore, I think you built the avr toolchain, right? Do you know what cygwin version was used? Could you provide the mount.exe from the building system to @rlogiacco for debugging? |
Ping! |
Pong ;-) |
Yes. I recently picked up some coding again with the latest and the greatest but I found this as well. |
your defeneatly not subscribed to my twitter. rofl https://twitter.com/Arduino_jantje |
@ffissore |
Hi @cmaglie yes I work with Cosa, but AFAIK @mikaelpatel works only with Linux not Windows, he also does not use an IDE. My purpose is to be able to use Cosa build system (itself based on Arduino-Makefile) and at the same time use Arduino Eclipse as the IDE (using Arduino IDE 1.5.8 behind the scenes). Tha's what brought me here as:
Since then, I have setup MSYS2, to verify the toolchain created by @ffissore, which fixes the initial problem on Eclipse. And this is where I stand currently. |
@jfpoilpret |
I can confirm that the second zip provided by @ffissore is wrong: it fails both from an MSYS2 command-line and from Eclipse with the Arduino plugin. So far, on one hand, I have reverted to the first provided MinGW-based zip as it seems to be OK from eclipse (I can build and upload as well); on the other hand, I keep cygwin-based toolchain in a special directory and I point the Cosa makefile there, hence I can still build in command line from Cygwin. |
@jantje can you please give it a run? Sorry to say that it works for me and that there are no cygwin dependencies. |
@ffissore Sorry I don't have a windows machine at hand right now. |
Has anyone been able to use arduino in Atmel studio or VS.net? |
I finally found some time to run a quick check and it seems that it is working as expected. I even tried using a folder containing spaces and I got no issues. To me this is definitely a solution. @ffissore Just to let you know, in the new toolchain the |
@jantje @ffissore I'm not sure if this is related to the new toolchain or not, but while everything works fine with the Uno and the Pro Mini, I'm having issues uploading to a Micro which seems not resetting the COM.
The issue doesn't occur when using the Arduino IDE 1.5.8 and I'm currently unable to verify if it's unrelated to the new toolchain, but somebody else might do a quick test. I'm trying to upload a simple blink firmware. |
@rlogiacco |
Cool thanks! |
@jantje can you then close this issue as solved? :) |
Assuming this fix is part of the next release, I'm happy to close it. |
Here is a quick fix. This fix is only requires two steps that are specific to the Arduino 1.5.8 IDE runtime: 1) copying the Cyg*.dll to a different folder location within the Arduino 1.5.8 IDE runtime, 2) copying the 'utils' folder from an older Arduino IDE runtime (i.e. I used v1.0.6, but other versions may work) into the Arduino 1.5.8 IDE runtime. Details:Step1) Step 2) Now all is happy. Compiling is successfully in both IDE's (Arduino native, and Eclipse Juno). |
Well, I don't know why, but the above fixed quick working (perhaps after I performed a 'build clean'). I had to fold in the ming32 tool chain referenced above; now my builds (and uploads) are stable again. See below for updated version of my Step 2 (given above). Details: Step 2) Replace the toolchain with the mingw32 tool chain (referenced above --> 'avr-toochain-win32-3.4.4.zip') by unzipping 'avr-toolchain-win32-3.4.4.zip' to %WHEREEVER%\arduino-1.5.8\hardware\tools\avr\avr. |
Before ya take offense, read first. As this has not been corrected I expand upon the previous messages with details. As I have said before under a different nym I think the Arduino plugin for Eclipse is great and is why I went through this. And hopefully others will find it the same. But those pesky indexing problems and that darn path. There is no bug with GCC in this regard and you can even see it in the message below. What is going on as previously stated is that it is VERY relative. The funny thing is what it is relative to on a Windoz system. One little DLL called "cygwin1.dll" if you just copy it to a directory which is on a seperate drive than the Arduino IDE directory being used, it work correctly. As it is a non-windows setup that is being forced to work on windoz, you may have to get creative. If for instance you are running on one large drive, just put it in the windows dir or create a bin dir off of the root dir. Add that dir to the path and make sure it is found before any other instance of it. ie your Arduino IDE dir If you have Arduino setup or installed on the same drive as the windows dir, and your eclipse dir is on a different drive, well then you may need to get creative. heh Just put the bin dir off of the root of the eclipse drive. You may need to uninstall the plugin and reinstall it if you start getting hundreds of errors. It happened to me the first time. Though it didn't happen after that even when monkeying around with the DLL's location while testing. Below you will see snippets of the log. The first note and the last three lines of the snippet are what we will be interested in.------- cygwin1.dll first found in windwos dir on different drive ------------------------------------
End of search list.---------------- cygwin1.dll first found in current dir same drive -------------------------------
End of search list.--------------- cygwin1.dll first found in arduinoxxx\bin --------------------------
End of search list.----------- cygwin1.dll first found in arduinoxxx -----------------------------------
End of search list.Corrected: |
@ffissore |
No, it wasn't fixed that I can tell. That was me trying to use the information on hand to find a solution. 1.6 with GCC 4.8.1 back until 1.54 with GCC 4.3.2 What you could do is have the plugin just copy the dll from arduino ide location to the plugin area of eclipse. I tried to run regsrv32 on it but not a valid dll type for to succeed. The only way I found it to work is put in the place that it was being called from, or simply put it my windoz dir as I have a separate drive for my linux style coding. |
No, new toolchain didn't make it for 1.6. #2568 has been merged right after and the new toolchain is now part of the nightly build and will be part of 1.6.1 |
any idea on the expected release date of 1.6.1? |
@GoGunner |
@jantje soon |
@ffissore :-) |
@jantje Yes, it appears so. Or at least more windoz friendly as I think the other was ok just not windoz friendly. |
I'm really glad @ffissore fixed it and it becomes part of 6.1. |
Users of my arduino eclipse plugin report strange behaviour since Arduino IDE 1.5.7.
After investigation it turns out that avr-gcc sometimes returns wrong information when running the command to get the "included folders and defines" in certain folder setups.
To be concrete when Arduino IDE 1.5.5 is installed in r:/test/ and the following command is run from r:/test/
hardware\tools\avr\bin\avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=158 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR -D__IN_ECLIPSE__=1 -E -P -v -dD R:/Test/Eclipse/workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C
it will return (for full listing see http://pastebin.com/ZeLiC7TV)
... ignoring nonexistent directory "r:/test/arduinoide/hardware/tools/avr/lib/gcc/../../avr/include/c++/4.3.2" ignoring nonexistent directory "r:/test/arduinoide/hardware/tools/avr/lib/gcc/../../avr/include/c++/4.3.2/avr/avr5" ignoring nonexistent directory "r:/test/arduinoide/hardware/tools/avr/lib/gcc/../../avr/include/c++/4.3.2/backward" ignoring nonexistent directory "r:/test/arduinoide/hardware/tools/avr/lib/gcc/../../avr/sys-include"
when Arduino 1.5.7 is installed in r:/test/ and the same command is run from r:/test/ you get
`cygwin warning:
MS-DOS style path detected: R:/Test/Eclipse/workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C
...
ignoring nonexistent directory "/ArduinoIDE/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/include/c++/4.8.1"
ignoring nonexistent directory "/ArduinoIDE/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/include/c++/4.8.1/avr/avr5"
...`
As you can see cygwin is reporting a path issue and the R:/test folder is missing from the include paths
With Arduino IDE 1.5.8 the same result is happening.
I think this is a glitch because when using Z:\windows as folder the problem does not occur.
rlogiacco and I have documented our steps in a issue (ignore the title and the part about the missing makefile) #arduino-eclipse-plugin/183
Sloeber/arduino-eclipse-plugin#183 (comment)
The text was updated successfully, but these errors were encountered: