Zero fails to build on IDE 1.6.5-r2

Having issues to build any sketch for the Zero on IDE 1.6.5-r2. I have the SAMD installed via the Boards Manager. Just trying the basic Blink sketch. I do have verbose checked in preferences.

Arduino: 1.6.5 (Windows XP), Board: "Arduino Zero (Programming Port)"

C:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DF_CPU=48000000L -DARDUINO=10605 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON -DUSB_MANUFACTURER="Arduino LLC" -DUSB_PRODUCT="Arduino Zero" -IC:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\tools\CMSIS\4.0.0-atmel/CMSIS/Include/ -IC:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\tools\CMSIS\4.0.0-atmel/Device/ATMEL/ -IC:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\hardware\samd\1.6.0\cores\arduino -IC:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\hardware\samd\1.6.0\variants\arduino_zero C:\DOCUME~1\User\LOCALS~1\Temp\build8327364640953901596.tmp\Blink.cpp -o C:\DOCUME~1\User\LOCALS~1\Temp\build8327364640953901596.tmp\Blink.cpp.o 
In file included from C:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\hardware\samd\1.6.0\cores\arduino/Uart.h:25:0,
                 from C:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\hardware\samd\1.6.0\variants\arduino_zero/variant.h:40,
                 from C:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\hardware\samd\1.6.0\cores\arduino/delay.h:27,
                 from C:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\hardware\samd\1.6.0\cores\arduino/Arduino.h:75,
                 from Blink.ino:18:
c:\documents and settings\user\my documents\downloads\arduino\arduino-1.6.5-r2\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\cstddef:41:28: fatal error: bits/c++config.h: No such file or directory
 #include <bits/c++config.h>
                            ^
compilation terminated.
Error compiling.

It looks like it is looking for the /bits/ include files in the wrong place.

This bits folder appears to be empty.

C:\Documents and Settings\User\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\bits

I do see the include files a few levels down in:

C:\Documents and Settings\Randal\My Documents\Downloads\Arduino\arduino-1.6.5-r2\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\arm-none-eabi\bits

If I copy these files to the empty folder above then it will build okay.

@hiduino
are you using the portable folder?
it may be that the cause of the malfuncion?

Yes, I am using portable, will there be a fix?

Okay, I think this is most likely a Windows (or java) limitation on the directory path length to those include files from the portable folder.

I moved the whole IDE install dir one level up and then it was able to find those files and compile correctly.
Too many sub folders!

hiduino,
thank you for the heads up! We'll investigate on that.