1 Reply Latest reply on Feb 6, 2014 2:53 AM by MichaelCollier

    object files differ; Arduino IDE vs Compiling from command prompt.

    MichaelCollier

      The object files generated by the Arduino IDE, e.g. "stream.cpp.o", are different when compiled using the .."same?".. compile command from a windows command prompt..!?

       

      I have used this technique with success in the past with other versions of Arduino, and with Chipkit/Maple.

       

      The galileo IDE is the first time I have experienced this issue, could someon else please try so that I can confirm I'm not doing something really, really, stupid?

       

      Steps:

       

      1. Open Arduino IDE, go to Help/Preferences to get location of preferences.txt

      2. Close Arduino IDE (because it overwrites the preferences.txt file that you are about to modify)

      3. Open preferences.txt and add/modify the line build.verbose=true save and close.

      4. Open Arduino IDE, compile a bare minimum program, just setup(){} and loop(){} will do.

      5. Click Verify, the output window shows the commands being executed by the compiler

      6. Use your mouse to select all the output and press control+C (right clicking doesn't show copy command but keystroke works).

      7. Paste the output into any text editor.

      8. Locate the line that compiles Stream.ccp

       

      Looks like this on my machine logged in as a_user_name (the .tmp directory location will also change) so modify accordingly

       

      C:\arduino-1.5.3/hardware/tools/x86/i686-pokysdk-mingw32/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++ -m32 -march=i586 --sysroot=C:\arduino-1.5.3/hardware/tools/x86/i586-poky-linux-uclibc -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -march=i586 -m32 -DARDUINO=153 -IC:\arduino-1.5.3\hardware\arduino\x86\cores\arduino -IC:\arduino-1.5.3\hardware\arduino\x86\variants\galileo_fab_d C:\arduino-1.5.3\hardware\arduino\x86\cores\arduino\Stream.cpp -o C:\DOCUME~1\a_user_name\LOCALS~1\Temp\build8378500062392217781.tmp\Stream.cpp.o

       

      Open a command prompt in windows (start Menu/Run then type cmd ).

       

      Execute the above code but modified to use your own .tmp and a_user_name but change the output filename to Stream2.cpp.o

       

      C:\arduino-1.5.3/hardware/tools/x86/i686-pokysdk-mingw32/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++ -m32 -march=i586 --sysroot=C:\arduino-1.5.3/hardware/tools/x86/i586-poky-linux-uclibc -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -march=i586 -m32 -DARDUINO=153 -IC:\arduino-1.5.3\hardware\arduino\x86\cores\arduino -IC:\arduino-1.5.3\hardware\arduino\x86\variants\galileo_fab_d C:\arduino-1.5.3\hardware\arduino\x86\cores\arduino\Stream.cpp -o C:\DOCUME~1\a_user_name\LOCALS~1\Temp\build8378500062392217781.tmp\Stream2.cpp.o

       

      Use a hex viewer to compare the difference, although the difference can be seen with notepad too.

       

      I have attached 2 examples of the output from my windows NT machine. Stream_original.cpp.o and Stream_via_command_prompt.cpp.o