arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.12k stars 7k forks source link

Enable link-time optimization (after switching to avr-gcc 4.5 or greater) [imported] #660

Closed cmaglie closed 8 years ago

cmaglie commented 11 years ago

This is Issue 660 moved from a Google Code project. Added by 2011-09-27T22:38:57.000Z by ca...@strayorange.com. Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

avr-gcc 4.5 has support for LTO. Enabling it would probably allow sizable object size reductions, especially with -Os when linking libraries spanning multiple compilation units.

matthijskooijman commented 11 years ago

Here's a comment copied from Google Code:

LTO stands for link-time optimization and basically it means deferring most optimizations until all compilation units (each file being compiled, including libraries) have been processed. As an example, consider a library function that's called only once in the current program. Without LTO both caller and callee will be compiled separately. With LTO the callee will be inlined (it's always profitable to inline a function that's called only once). While just inlining might look not much of a win, take into consideration that this also allows code specialization at compile-time. For more information, look up the -flto and -fwhole-program compile options (http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options)

I've been looking at LTO and whole program optimization as well, since it greatly increases optimization opportunities for a templated I/O library I've been working on.

To get this working, -flto needs to be passed to all C/C++ compiler commands and linker commands. It seems sensible to pass -O0 to the compiler commands since optimization is done in the linker stage, but a quick test shows that this greatly increases resulting binary size, so I guess not all optimizations are run at link time and -Os must still be passed both when compiling and linking.

I've tested this here on avr-gcc 4.7 in Debian using Arduino-mk and it indeed helps to reduce code size (haven't looked closely at code speed yet).

However, for optimal LTO, gcc needs a "linker plugin", which doesn't seem to be available in my setup (not sure if this is a limitation of the AVR target and/or if this was / will be fixed in a more recent GCC version, thogh). AFAIU this linker plugin serves two purposes: It allows gcc to get LTO information out of archives (allowing the arduino core code in libcore.a to be included in the LTO process) and it allows gcc to know which functions are externally visible (in this case, only main()) so it can really tell if a function is used or not.

As an alternative for such a linker plugin, -fwhole-program can be passed to the linker. This flag tells gcc, "I've passed you all the code for this program and only main() and any functions with the externally_visible attribute are externally visible". However, since no linker plugin is used, any .o files compiled without -flto and any .a files included in the link are not included in the LTO and the optimizer will pretend they don't exist. In the Arduino case, the LTO will not see the actual main() function (which is in libcore.a) referencing setup() and loop(), making it remove the setup() and loop() functions (and probably all of the rest of your code as well). After LTO, the linker will then try to link your (now-empty) program with libcore.a and error out with "undefined symbol setup" and "undefined symbol loop".

Making -fwhole-program can be done by marking setup and loop as externally visible. e.g. put this in Arduino.h (or any other place included in the .ino file, just in main.cpp isn't enough):

void loop(void) __attribute__((externally_visible));
void setup(void) __attribute__((externally_visible));

Doing this makes the program a bit smaller and probably faster as well (it allows inlining and removing functions that are called in on place only, for example). However, it is probably a bit error prone to manually keep this list of externally visible functions, so I would advise only applying it if linker plugin support for AVR isn't going to happen soon and it turns out the optimization gain of -fwhole-program is significant.

matthijskooijman commented 10 years ago

It seems that since gcc 4.8, avr-gcc has the linker plugin working, meaning we can enable -flto and it should just work :-)

cmaglie commented 10 years ago

This may be enable after merging #1903 (just to keep a note inside the pull request).

mikaelpatel commented 10 years ago

The -flto option needs to be passed to the linker as well (compiler.c.elf). Below are the extra flags I am using for Cosa build (See https://github.com/mikaelpatel/Cosa/blob/master/platform.txt-gcc-4.8.1)

# These can be overridden in platform.local.txt
compiler.c.extra_flags=-Wextra -flto
compiler.c.elf.extra_flags=-w -flto
compiler.S.extra_flags=
compiler.cpp.extra_flags=-Wextra -flto
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=

This work nicely for the Cosa Arduino Framework. So far have all tests passed. Please note that some warnings from the link needs to suppressed (See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396)

Cheers! Mikael

ffissore commented 9 years ago

Current toolchain supports link time optimization, which is disabled by default. If you wish to use you can either modify platform.txt or provide your own custom core

mikaelpatel commented 9 years ago

There are still problems with the LTO plugin (for Windows). It is not always included and "collect" will fail. I have disabled LTO in the Arduino IDE build (platform.txt) and only use this from the Cosa command line build (Makefile).

matthijskooijman commented 9 years ago

Is it still the ambition to enable LTO, if this is possible without introducing any broken behaviour? If so, perhaps this issue should be left open, to track any problems and solutions with LTO found so far?

I just noticed a problem with LTO giving incorrect ISR warnings. This is reported upstream and fixed in 4.8.3.

cmaglie commented 9 years ago

I guess so, let's reopen this one and collect all the problems around LTO:

@mikaelpatel what's the problem you're facing exactly with the plugin? are you using the same toolchain shipped with Arduino for your makefile?

@Lauszus @xxxajk IIRC there was a problem with LTO and USB_Host_2 library?

if anyone has information and links, please post here.

cmaglie commented 9 years ago

Dev-list discussion here: https://groups.google.com/a/arduino.cc/d/msg/developers/21G5w2HbUOg/000Ql0O6CCwJ

xxxajk commented 9 years ago

@cmaglie we disable optimization in the code for the versions of GCC that we know have the problem.

facchinm commented 9 years ago

Some goodies for the weekend: a new shiny avr-gcc 5.1.0 for all major platforms with LTO plugin support!

Windows x86 OSX x86_64 Linux x86_64

All the toolchains has been cross compiled on Linux using this script (in case you want to compile it by yourself).

To enable LTO simply add the following flags to your platform.txt

compiler.c.extra_flags=-Wextra -flto
compiler.c.elf.extra_flags=-w -flto -fuse-linker-plugin
compiler.S.extra_flags=-flto
compiler.cpp.extra_flags=-Wextra -flto
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=

and a platform-dependant

compiler.ar.extra_flags=--plugin={$extraction_path}/libexec/gcc/avr/5.1.0/liblto_plugin.so
compiler.ar.extra_flags=--plugin={$extraction_path}/libexec/gcc/avr/5.1.0/liblto_plugin-0.dll

As usual, testing and error reporting is VERY well accepted :wink:

@matthijskooijman - could you give this compiler+flags a spin with your arduino-mass-builder to get some metrics?

matthijskooijman commented 9 years ago

Cool! This script, is it based on on in the avr-toolchain repo? And the patch you linked is the only one applied, or does this include patches from Atmel too (like the ones in the avr-toolchain repo)?

In your compiler flags, I assume -Wextra isn't actually needed for LTO?

I didn't realize about -fuse-linker-plugin, so I tested without that before. Also, I take the ar options allow ar to store lto info inside .a files? From reading the gcc manpage, it looks like this option might not be needed if you call gcc-ar instead of just ar?

Finally, it seems that -fno-fat-lto-objects might be useful to speed up compilation by not generating machine code twice.

I'll run this through my mass-builder script, but I don't have a laptop adapter with me, so can't do that right now :-)

Lauszus commented 9 years ago

@cmaglie I just tried enabling LTO with the current toolchain bundled with the Arduino IDE and unfortunately the issue is still present:

Without LTO:

Sketch uses 21,908 bytes (8%) of program storage space. Maximum is 253,952 bytes.
Global variables use 968 bytes (11%) of dynamic memory, leaving 7,224 bytes for local variables. Maximum is 8,192 bytes.

With LTO:

Sketch uses 70,492 bytes (27%) of program storage space. Maximum is 253,952 bytes.
Global variables use 1,289 bytes (15%) of dynamic memory, leaving 6,903 bytes for local variables. Maximum is 8,192 bytes.

@facchinm I tried to test it with the updated toolchain you linked to, but I am getting the following error:

/Users/Lauszus/Github/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -flto -I/Users/Lauszus/Github/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Users/Lauszus/Github/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Users/Lauszus/Dropbox/Arduino/libraries/USB_Host_Shield_2.0 -I/Users/Lauszus/Dropbox/Arduino/libraries/spi4teensy3 -I/Users/Lauszus/Github/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI /var/folders/st/ln3d8j1n7x91gq9gk8304gtw0000gn/T/build1230170329459071487.tmp/sketch/PS3BT.cpp -o /var/folders/st/ln3d8j1n7x91gq9gk8304gtw0000gn/T/build1230170329459071487.tmp/sketch/PS3BT.cpp.o 
FATAL:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
Error compiling.
facchinm commented 9 years ago

@Lauszus it seems that the default x86_64 toolchain from Xcode was chosen for linking... I suggest to extract the 5.1.0 toolchain in a different folder (not inside Arduino.app ) and then hardcode the path in compiler.path and compiler.ar.extra_flags fields. I've tested it in a MacMini (10.9) and the paths are taken correctly. BTW, thanks for testing!!

facchinm commented 9 years ago

@matthijskooijman , you are clearly right about -Wextra, it was a leftover from previous tests. ar and gcc-ar are alias in an effort to have the exact same compilation flags (and thus the same behaviour) on all the three platforms.

I've tested also with -fno-fat-lto-objects but I couldn't appreciate the speedup (I didn't measured it, though).

Finally, the script is loosely based on avr-toolchain repo but its main target is to enable canadian cross compiling for all the platform with the same flags on a single machine. No Atmel patch applied at the moment (except one for the GCC linker bug)

Eagerly waiting for the results of your tests!

facchinm commented 9 years ago

@Lauszus , compiling the PS3BT example from your library gives the following result with the newest toolchain (under Linux)

Sketch uses 20,266 bytes (7%) of program storage space. Maximum is 253,952 bytes.
Global variables use 958 bytes (11%) of dynamic memory, leaving 7,234 bytes for local variables. Maximum is 8,192 bytes.

so it seems that LTO code has quite improved :wink:

matthijskooijman commented 9 years ago

I did a full test run. The 5.1 toolchain you supplied worked perfectly for me, I didn't see any of the errors @Lauszus saw.

I did four builds:

The full data is available here:

https://www.google.com/fusiontables/DataSource?docid=1_tmjQtI1PrCz02fsV0N8AkOZ-2nF04XQ6QAhcM1H

None of the examples were broken or fixed by enabling LTO or upgrading the toolchain. 21 builds compiled to the exactly the same hex file (this was only bare minimum using the 5.1 toolchain without lto), all other builds were changed in some way.

Data size I had a closer look at some of the cases where the sizes increase. There are only 4 RAM size increases with 5.1-lto, all of which concern the tone() function on the Gemma. Somehow it seems that with lto, gcc fails to optimize away a few unused global variables. This same problem occurs with lto, but there it also occurs for other 32u4-based boards (the variable is not unused on e.g. 328). Somehow the non-lto build does optimize the variable away as it should. The lto build has a lot more RAM size increases, but I haven't looked closely at those. There might also be some increase that are masked by other decreases, resulting in a net decrease. On average, the datasize decreases by 2 bytes for lto and 17 bytes for 5.1-lto, and worst-case is a 17 respectively 8 byte increase, so I don't think this is something to worry about.

program size The size increases for flash are limited, only 6 builds for lto and 22 for 5.1-lto. The few size increases > 40 bytes (up to 180 bytes) seem related to the Gemma and the tone library (caused by #3519, I think). All other size increases add 36 bytes on the toneMultiple example. I couldn't really find what caused this, it seems that somehow the compiler is less smart about what timer could possibly be used and fails to remove some code.

Overall, it seems that lto enables more inlining to happen. I've seen main() become huge, but setup(), loop() and initVariant() disappeared, making the result significantly smaller. On average, sketches become 429 bytes smaller with lto and even 493 with 5.1-lto (and also 24 bytes smaller with 5.1 without lto).

matthijskooijman commented 9 years ago

On potential issue with lto is that it seems to kill debugging information

The gcc-4.9 and gcc-5.1 manpage says:

Link-time optimization does not work well with generation of debugging information. Combining -flto with -g is currently experimental and expected to produce unexpected results.

When disassembling code compiled with lto, I've seen that objdump was unable to show source.

This isn't much of an issue now, but we might need to keep this into account if debugging support is added to the compiler later (this would probably require the use of separate "debugging" recipies in platform.txt).

facchinm commented 9 years ago

@matthijskooijman , great work as usual! I believe that a ~400 byte decrease in program size is enough to justify some extensive testing "in the field" to also check functionality compliance.

About debugging capability being lost, we only need to keep LTO flags separate from the standard flags and disable them when the target is set to debugging (just my thoughts, I'm not sure if/when the debugging capabilities will also be extended to AVR products)

Lauszus commented 9 years ago

@facchinm hmm I already tried that:

compiler.path=/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/
compiler.ar.extra_flags=--plugin=/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/libexec/gcc/avr/5.1.0/liblto_plugin.so

But it keeps picking up the default toolchain. I guess it is a problem with my particular setup.

Lauszus commented 9 years ago

Anyway it's good to see that LTO seems to work properly now :)

Lauszus commented 9 years ago

It's a bit weird, as it picks up the right path for avr-g++ but not for the linker:

/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -flto -I/Users/Lauszus/Github/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Users/Lauszus/Github/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Users/Lauszus/Dropbox/Arduino/libraries/USB_Host_Shield_2.0 -I/Users/Lauszus/Dropbox/Arduino/libraries/spi4teensy3 -I/Users/Lauszus/Github/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI /var/folders/st/ln3d8j1n7x91gq9gk8304gtw0000gn/T/build8881266524840038019.tmp/sketch/PS3BT.cpp -o /var/folders/st/ln3d8j1n7x91gq9gk8304gtw0000gn/T/build8881266524840038019.tmp/sketch/PS3BT.cpp.o 
FATAL:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
Error compiling.

I am wondering if the runtime.tools path is set correctly for the linker?

matthijskooijman commented 9 years ago

@Lauszus, But the error you show is about as, which I think is the assembler, not the linker, called from g++? Perhaps somehow g++ is calling as internally, but is using an absolute path? It seems that the linux build does this correctly, though it needs a few tries before finding as. This is part of the output of strace -f avr-gcc-5.1/bin/avr-g++ -c test.cpp does OSX have something similar to strace?m

stat("/home/matthijs/docs/Electronics/Arduino/avr-gcc-5.1/bin/../libexec/gcc/avr/5.1.0/as", 0x7ffd7234ce50) = -1 ENOENT (No such file or directory)
stat("/home/matthijs/docs/Electronics/Arduino/avr-gcc-5.1/bin/../libexec/gcc/as", 0x7ffd7234ce50) = -1 ENOENT (No such file or directory)
stat("/home/matthijs/docs/Electronics/Arduino/avr-gcc-5.1/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/avr/5.1.0/as", 0x7ffd7234ce50) = -1 ENOENT (No such file
 or directory)
stat("/home/matthijs/docs/Electronics/Arduino/avr-gcc-5.1/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/as", {st_mode=S_IFREG|0755, st_size=5236792, ...}) = 0
access("/home/matthijs/docs/Electronics/Arduino/avr-gcc-5.1/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/as", X_OK) = 0
vfork(Process 15129 attached
 <unfinished ...>
[pid 15129] execve("/home/matthijs/docs/Electronics/Arduino/avr-gcc-5.1/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/as", ["/home/matthijs/docs/Electronics/"..., "-mmcu=avr2", "-o", "test.o", "/tmp/ccpZcWLM.s"], [/* 76 vars */] <unfinished ...>
Lauszus commented 9 years ago

Yes sorry I meant the assembler.

Here is the output when running sudo dtruss -f bin/avr-g++ -c bin/test.cpp:

    PID/THRD  SYSCALL(args)          = return
 6801/0x17176:  open("/dev/dtracehelper\0", 0x2, 0x7FFF5FBFF1A0)         = 3 0
 6801/0x17176:  ioctl(0x3, 0x80086804, 0x7FFF5FBFF128)       = 0 0
 6801/0x17176:  close(0x3)       = 0 0
 6801/0x17176:  access("/home/admin/avr-gcc-5.1.0/pkg-x86_64-apple-darwin14/lib/gcc/avr/specs\0", 0x4, 0x0)      = -1 Err#2
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/device-specs\0", 0x4, 0x0)       = 0 0
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/device-specs/specs-avr2\0", 0x4, 0x100700120)        = 0 0
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/-specs=device-specs/specs-avr2\0", 0x4, 0x0)         = -1 Err#2
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/-specs=device-specs/specs-avr2\0", 0x4, 0x0)       = -1 Err#2
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/lib/avr/5.1.0/-specs=device-specs/specs-avr2\0", 0x4, 0x0)       = -1 Err#2
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/lib/-specs=device-specs/specs-avr2\0", 0x4, 0x0)         = -1 Err#2
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/device-specs/specs-avr2\0", 0x4, 0x0)        = 0 0
 6801/0x17176:  open("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/device-specs/specs-avr2\0", 0x0, 0x0)      = 3 0
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/device-specs/specs-avr2\0", 0x7FFF5FBFF9D0, 0x0)       = 0 0
 6801/0x17176:  read(0x3, "#\n# Auto-generated specs for AVR core architecture avr2\n#\n# Generated by   : ./gcc/config/avr/gen-avr-mmcu-specs.c\n# Generated from : ./gcc/config/gcc.c\n#                  ./gcc/config/avr/specs.h\n#                  ./gcc/config/avr/avrlibc.h\n# Used by    ", 0x319)      = 793 0
 6801/0x17176:  close(0x3)       = 0 0
 6801/0x17176:  access("/var/tmp/\0", 0x7, 0x100203DD0)      = 0 0
 6801/0x17176:  open_nocancel("/dev/random\0", 0x0, 0x0)         = 3 0
 6801/0x17176:  read_nocancel(0x3, "y\2540\335\357\016\267\214\207\365\027\376\256!/\251gr\372\330w\324\240#\032;@l\301\034\364\340\332}n\2422cM\267\r{Gr\276\270\003\256\204A=\bI\306[\371\342\244\347#\001\002`3MtS\332%\226u\021\2415\257\330\370:#E\226.\207t\2447\314\002\177\324\356\263\337Wt\211\231\0306\331\252!4S\336\363\356d\"h\361\005\275P\337+\215\217\021*\0", 0x80)        = 128 0
 6801/0x17176:  close_nocancel(0x3)      = 0 0
 6801/0x17176:  open_nocancel("/dev/random\0", 0x0, 0x0)         = 3 0
 6801/0x17176:  read_nocancel(0x3, "\204\256_\213\2469u\004kc\300i\330\303\3474\n\\o\227s),Hq\230\027\304/\333\353\365f\256\231\326a:\340\002_\251\311\026\201N\263U\361\214@:r/&E\002\030\235cv\256\312\234\316,\270\215\335\3330\326\022T\352\314L\372\305t\335hQ\206~\210\\\200\360\275\311&%\203\247\246\360#*o\3337\215\362ds\333em\212u\353u`\320\356Y\352\242\325\244\257Uh\264\357\271\374\0", 0x80)         = 128 0
 6801/0x17176:  close_nocancel(0x3)      = 0 0
 6801/0x17176:  stat64("/var/tmp/\0", 0x7FFF5FBFE790, 0x0)       = 0 0
 6801/0x17176:  open_nocancel("/var/tmp//ccZpzOqE.s\0", 0xA02, 0x180)        = 3 0
 6801/0x17176:  close(0x3)       = 0 0
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../libexec/gcc/avr/5.1.0/cc1plus\0", 0x7FFF5FBFEA40, 0x0)       = 0 0
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../libexec/gcc/avr/5.1.0/cc1plus\0", 0x1, 0x0)        = 0 0
 6803/0x17176:  vfork()      = 6803 0
 6801/0x17176:  vfork()      = 6803 0
 6803/0x17195:  ioctl(0x3, 0x80086804, 0x7FFF5FBFEE98)       = 0 0
 6803/0x17195:  close(0x3)       = 0 0
 6803/0x17195:  __sysctl(0x7FFF5FBFE928, 0x2, 0x7FFF5FBFE938)        = 0 0
 6803/0x17195:  thread_selfid(0x7FFF7CBFD310, 0x7FFF7CBFD258, 0x10101)       = 94613 0
 6803/0x17195:  bsdthread_register(0x7FFF94309FBC, 0x7FFF94309FAC, 0x2000)       = 0 0
 6803/0x17195:  mprotect(0x140F5D000, 0x88, 0x1)         = 0 0
 6803/0x17195:  mprotect(0x140F5F000, 0x1000, 0x0)       = 0 0
 6803/0x17195:  mprotect(0x140F75000, 0x1000, 0x0)       = 0 0
 6803/0x17195:  mprotect(0x140F76000, 0x1000, 0x0)       = 0 0
 6803/0x17195:  mprotect(0x140F8C000, 0x1000, 0x0)       = 0 0
 6803/0x17195:  mprotect(0x140F8D000, 0x1000, 0x1)       = 0 0
 6803/0x17195:  mprotect(0x140F5D000, 0x88, 0x3)         = 0 0
 6803/0x17195:  mprotect(0x140F5D000, 0x88, 0x1)         = 0 0
 6803/0x17195:  issetugid(0x7FFF7C63B480, 0x7FFFFFE00034, 0x7FFFFFE00036)        = 0 0
 6803/0x17195:  getpid(0x1, 0x140F8E000, 0x49656E69)         = 6803 0
 6803/0x17195:  __mac_syscall(0x7FFF96E0FE47, 0x2, 0x7FFF5FBFE7A8)       = 0 0
 6803/0x17195:  stat64("/AppleInternal\0", 0x7FFF5FBFE828, 0x0)      = -1 Err#2
 6803/0x17195:  audit_session_self(0x7FFF5FBFE6E0, 0x7FFF5FBFE518, 0x4)      = 3587 0
 6803/0x17195:  geteuid(0x7FFF5FBFE6E0, 0x7FFF5FBFE518, 0x0)         = 0 0
 6803/0x17195:  getegid(0x7FFF5FBFE6E0, 0x7FFF5FBFE518, 0x0)         = 0 0
 6803/0x17195:  getaudit_addr(0x7FFF5FBFE7B8, 0x30, 0x0)         = 0 0
 6803/0x17195:  csops(0x1A93, 0x7, 0x7FFF5FBFE3A0)       = -1 Err#22
 6803/0x17195:  getrlimit(0x1003, 0x7FFF5FBFF850, 0x7FFF5FBFF938)        = 0 0
 6803/0x17195:  ioctl(0x2, 0x4004667A, 0x7FFF5FBFF824)       = 0 0
 6803/0x17195:  sigaction(0xB, 0x7FFF5FBFF828, 0x7FFF5FBFF850)       = 0 0
 6803/0x17195:  sigaction(0x4, 0x7FFF5FBFF828, 0x7FFF5FBFF850)       = 0 0
 6803/0x17195:  sigaction(0xA, 0x7FFF5FBFF828, 0x7FFF5FBFF850)       = 0 0
 6803/0x17195:  sigaction(0x6, 0x7FFF5FBFF828, 0x7FFF5FBFF850)       = 0 0
 6803/0x17195:  sigaction(0x8, 0x7FFF5FBFF828, 0x7FFF5FBFF850)       = 0 0
 6803/0x17195:  __sysctl(0x7FFF5FBFF828, 0x2, 0x7FFF7B4A1180)        = 0 0
 6803/0x17195:  mmap(0x0, 0x1000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)      = 0x140F8F000 0
 6803/0x17195:  mmap(0x0, 0x200000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)        = 0x141500000 0
 6803/0x17195:  mmap(0x0, 0x2000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)      = 0x140FB1000 0
 6803/0x17195:  mmap(0x0, 0x2000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)      = 0x140FB3000 0
 6803/0x17195:  mmap(0x0, 0x2000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)      = 0x140FB5000 0
 6803/0x17195:  mmap(0x0, 0x4000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)      = 0x140FB7000 0
 6803/0x17195:  mmap(0x0, 0x2000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)      = 0x140FBB000 0
 6803/0x17195:  __sysctl(0x100EC85E8, 0x2, 0x7FFF5FBFF824)       = 0 0
 6803/0x17195:  getrlimit(0x1005, 0x7FFF5FBFF820, 0x0)       = 0 0
 6803/0x17195:  __sysctl(0x100EC85E8, 0x2, 0x7FFF5FBFF834)       = 0 0
 6803/0x17195:  getrlimit(0x1005, 0x7FFF5FBFF830, 0x0)       = 0 0
 6803/0x17195:  getrlimit(0x1005, 0x7FFF5FBFF860, 0x7FFFFFFFFFFFFFFF)        = 0 0
 6803/0x17195:  __sysctl(0x100EC85E8, 0x2, 0x7FFF5FBFF824)       = 0 0
 6803/0x17195:  getrlimit(0x1005, 0x7FFF5FBFF820, 0x0)       = 0 0
 6803/0x17195:  ioctl(0x2, 0x4004667A, 0x7FFF5FBFF834)       = 0 0
 6803/0x17195:  open("/dev/urandom\0", 0x0, 0x0)         = 3 0
 6803/0x17195:  read(0x3, "\022\3140S\304\300\352\370\0", 0x8)       = 8 0
 6803/0x17195:  close(0x3)       = 0 0
 6803/0x17195:  stat64("/\0", 0x7FFF5FBFDDC0, 0x141018988)       = 0 0
 6803/0x17195:  getattrlist("/Users\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDE50)      = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDE50)      = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus/Downloads\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDE50)        = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDE50)      = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDE50)      = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/lib\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDE50)      = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/lib/gcc\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDE50)      = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/lib/gcc/dummy\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDE50)        = -1 Err#2
 6803/0x17195:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6803/0x17195:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6803/0x17195:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6803/0x17195:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6803/0x17195:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6803/0x17195:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6803/0x17195:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/include/c++/5.1.0\0", 0x7FFF5FBFF6F0, 0x0)         = -1 Err#2
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/include/c++/5.1.0/avr\0", 0x7FFF5FBFF6F0, 0xE3230)         = -1 Err#2
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/include/c++/5.1.0/backward\0", 0x7FFF5FBFF6F0, 0xE32F0)        = -1 Err#2
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/include\0", 0x7FFF5FBFF6F0, 0xE33B0)       = 0 0
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/include-fixed\0", 0x7FFF5FBFF6F0, 0x0)         = 0 0
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/sys-include\0", 0x7FFF5FBFF6F0, 0x100000501CD1F65)         = -1 Err#2
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/include\0", 0x7FFF5FBFF6F0, 0xE3460)       = 0 0
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/../../lib/gcc/avr/5.1.0/../../../../avr/include/c++/5.1.0\0", 0x7FFF5FBFF6F0, 0x100000501CD291F)         = -1 Err#2
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/../../lib/gcc/avr/5.1.0/../../../../avr/include/c++/5.1.0/avr\0", 0x7FFF5FBFF6F0, 0xE3520)       = -1 Err#2
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/../../lib/gcc/avr/5.1.0/../../../../avr/include/c++/5.1.0/backward\0", 0x7FFF5FBFF6F0, 0xE35E0)      = -1 Err#2
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/../../lib/gcc/avr/5.1.0/include\0", 0x7FFF5FBFF6F0, 0xE36B0)         = 0 0
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/../../lib/gcc/avr/5.1.0/include-fixed\0", 0x7FFF5FBFF6F0, 0xE3760)       = 0 0
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/../../lib/gcc/avr/5.1.0/../../../../avr/sys-include\0", 0x7FFF5FBFF6F0, 0xE3810)         = -1 Err#2
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/../../lib/gcc/avr/5.1.0/../../../../avr/include\0", 0x7FFF5FBFF6F0, 0xE38D0)         = 0 0
 6803/0x17195:  stat("bin/test.cpp.gch\0", 0x7FFF5FBFF750, 0x4)      = -1 Err#2
 6803/0x17195:  open("bin/test.cpp\0", 0x20000, 0x1B6)       = 3 0
 6803/0x17195:  fstat(0x3, 0x141018578, 0x0)         = 0 0
 6803/0x17195:  read(0x3, "\0", 0x0)         = 0 0
 6803/0x17195:  close(0x3)       = 0 0
 6803/0x17195:  mmap(0x0, 0x4000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)      = 0x140FBD000 0
 6803/0x17195:  mmap(0x0, 0x2000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)      = 0x140FC1000 0
 6803/0x17195:  getattrlist("/var\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDFF0)        = 0 0
 6803/0x17195:  readlink("/var\0", 0x7FFF5FBFE810, 0x3FF)        = 11 0
 6803/0x17195:  getattrlist("/private\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDFF0)        = 0 0
 6803/0x17195:  getattrlist("/private/var\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDFF0)        = 0 0
 6803/0x17195:  getattrlist("/private/var/tmp\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDFF0)        = 0 0
 6803/0x17195:  getattrlist("/private/var/tmp/ccZpzOqE.s\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDFF0)         = 0 0
 6803/0x17195:  open_nocancel(".\0", 0x0, 0x1)       = 3 0
 6803/0x17195:  fstat64(0x3, 0x7FFF5FBFD490, 0x0)        = 0 0
 6803/0x17195:  fcntl_nocancel(0x3, 0x32, 0x7FFF5FBFF450)        = 0 0
 6803/0x17195:  close_nocancel(0x3)      = 0 0
 6803/0x17195:  stat64("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF5FBFD400, 0x0)      = 0 0
 6803/0x17195:  stat64("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF5FBFDF60, 0x5)      = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDFF0)      = 0 0
 6803/0x17195:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/test.cpp\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFDFF0)         = 0 0
 6803/0x17195:  getrlimit(0x1008, 0x7FFF5FBFF710, 0x7FFF8DBC7E7C)        = 0 0
 6803/0x17195:  open_nocancel("/var/tmp//ccZpzOqE.s\0", 0x601, 0x1B6)        = 3 0
 6803/0x17195:  fstat64(0x3, 0x7FFF5FBFF658, 0x7FFF5FBFF71C)         = 0 0
 6803/0x17195:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF5FBFF790, 0x7FFF5FBFF9D8)         = 0 0
 6803/0x17195:  stat(".\0", 0x7FFF5FBFF710, 0x0)         = 0 0
 6803/0x17195:  munmap(0x100F3B000, 0x40000000)      = 0 0
 6803/0x17195:  mmap(0x0, 0x40000, 0x3, 0x1002, 0xFFFFFFFF, 0x0)         = 0x100F3B000 0
 6803/0x17195:  write_nocancel(0x3, "\t.file\t\"test.cpp\"\n__SP_H__ = 0x3e\n__SP_L__ = 0x3d\n__SREG__ = 0x3f\n__tmp_reg__ = 0\n__zero_reg__ = 1\n\t.ident\t\"GCC: (GNU) 5.1.0\"\n\0", 0x7E)         = 126 0
 6803/0x17195:  close_nocancel(0x3)      = 0 0
 6804/0x17197:  vfork()      = 0 0
 6804/0x17197:  thread_selfid(0x0, 0x1DC0, 0x7FFF6B287550)       = 94615 0
 6804/0x17197:  csops(0x0, 0x0, 0x7FFF5620B214)      = 0 0
 6804/0x17197:  issetugid(0x0, 0x0, 0x0)         = 0 0
 6804/0x17197:  shared_region_check_np(0x7FFF56209148, 0x1099F4000, 0x4)         = 0 0
 6804/0x17197:  stat64("/usr/lib/libxcselect.dylib\0", 0x7FFF5620A108, 0x7FFF5620AFA0)       = 0 0
 6804/0x17197:  open("/usr/lib/libxcselect.dylib\0", 0x0, 0x0)       = 3 0
 6804/0x17197:  pread(0x3, "\317\372\355\376\a\0", 0x1000, 0x0)      = 4096 0
 6804/0x17197:  fcntl(0x3, 0x3D, 0x7FFF562083F0)         = 0 0
 6804/0x17197:  mmap(0x1099F9000, 0x3000, 0x5, 0x12, 0x3, 0x0)       = 0x1099F9000 0
 6804/0x17197:  mmap(0x1099FC000, 0x1000, 0x3, 0x12, 0x3, 0x3000)        = 0x1099FC000 0
 6804/0x17197:  mmap(0x1099FD000, 0x2420, 0x1, 0x12, 0x3, 0x4000)        = 0x1099FD000 0
 6804/0x17197:  fcntl(0x3, 0x2C, 0x7FFF56208408)         = 0 0
 6804/0x17197:  close(0x3)       = 0 0
 6804/0x17197:  stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF5620A108, 0x7FFF5620AFA0)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcompiler_rt.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)         = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcopyfile.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcorecrypto.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libdispatch.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libdyld.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libkeymgr.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/liblaunch.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libmacho.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libquarantine.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libremovefile.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_asl.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_blocks.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_c.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_configuration.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_dnssd.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_info.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)         = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_kernel.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_m.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_malloc.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_network.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_notify.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_platform.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)         = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_pthread.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_sandbox.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_stats.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libunc.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)         = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libunwind.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libxpc.dylib\0", 0x7FFF56209C78, 0x7FFF5620AB10)         = 0 0
 6804/0x17197:  stat64("/usr/lib/libobjc.A.dylib\0", 0x7FFF56208EB8, 0x7FFF56209D50)         = 0 0
 6804/0x17197:  stat64("/usr/lib/libauto.dylib\0", 0x7FFF56208EB8, 0x7FFF56209D50)       = 0 0
 6804/0x17197:  stat64("/usr/lib/libc++abi.dylib\0", 0x7FFF56208968, 0x7FFF56209800)         = 0 0
 6804/0x17197:  stat64("/usr/lib/libc++.1.dylib\0", 0x7FFF56208968, 0x7FFF56209800)      = 0 0
 6804/0x17197:  stat64("/usr/lib/libDiagnosticMessagesClient.dylib\0", 0x7FFF56208848, 0x7FFF562096E0)       = 0 0
 6804/0x17197:  open("/dev/dtracehelper\0", 0x2, 0x7FFF5620B100)         = 3 0
 6804/0x17197:  ioctl(0x3, 0x80086804, 0x7FFF5620B088)       = 0 0
 6804/0x17197:  close(0x3)       = 0 0
 6804/0x17197:  __sysctl(0x7FFF5620AB18, 0x2, 0x7FFF5620AB28)        = 0 0
 6804/0x17197:  thread_selfid(0x7FFF7CBFD310, 0x7FFF7CBFD258, 0x10101)       = 94615 0
 6804/0x17197:  bsdthread_register(0x7FFF94309FBC, 0x7FFF94309FAC, 0x2000)       = 0 0
 6804/0x17197:  mprotect(0x109A00000, 0x88, 0x1)         = 0 0
 6804/0x17197:  mprotect(0x109A02000, 0x1000, 0x0)       = 0 0
 6804/0x17197:  mprotect(0x109A18000, 0x1000, 0x0)       = 0 0
 6804/0x17197:  mprotect(0x109A19000, 0x1000, 0x0)       = 0 0
 6804/0x17197:  mprotect(0x109A2F000, 0x1000, 0x0)       = 0 0
 6804/0x17197:  mprotect(0x1099F8000, 0x1000, 0x1)       = 0 0
 6804/0x17197:  mprotect(0x109A00000, 0x88, 0x3)         = 0 0
 6804/0x17197:  mprotect(0x109A00000, 0x88, 0x1)         = 0 0
 6804/0x17197:  issetugid(0x7FFF7C63B480, 0x7FFFFFE00034, 0x7FFFFFE00036)        = 0 0
 6804/0x17197:  getpid(0x1, 0x109A30000, 0x49656E69)         = 6804 0
 6804/0x17197:  __mac_syscall(0x7FFF96E0FE47, 0x2, 0x7FFF5620A998)       = 0 0
 6804/0x17197:  stat64("/AppleInternal\0", 0x7FFF5620AA18, 0x0)      = -1 Err#2
 6804/0x17197:  audit_session_self(0x7FFF5620A8D0, 0x7FFF5620A708, 0x4)      = 3587 0
 6804/0x17197:  geteuid(0x7FFF5620A8D0, 0x7FFF5620A708, 0x0)         = 0 0
 6804/0x17197:  getegid(0x7FFF5620A8D0, 0x7FFF5620A708, 0x0)         = 0 0
 6804/0x17197:  getaudit_addr(0x7FFF5620A9A8, 0x30, 0x0)         = 0 0
 6804/0x17197:  csops(0x1A94, 0x7, 0x7FFF5620A590)       = 0 0
 6804/0x17197:  __mac_syscall(0x7FFF96E0FE47, 0x4, 0x7FFF5620A938)       = -1 Err#45
 6804/0x17197:  readlink("/var/db/xcode_select_link\0", 0x7FFF5620B630, 0x3FF)       = -1 Err#2
 6804/0x17197:  readlink("/usr/share/xcode-select/xcode_dir_link\0", 0x7FFF5620B630, 0x3FF)      = -1 Err#2
 6804/0x17197:  open("/usr/share/xcode-select/xcode_dir_path\0", 0x0, 0x1099FBD9B)       = -1 Err#2
 6804/0x17197:  stat64("/Applications/Xcode.app\0", 0x7FFF5620A8C0, 0xFFFFFFFFFFFFFFFF)      = 0 0
 6804/0x17197:  stat64("/Applications/Xcode.app/Contents/Developer/usr/lib/libxcrun.dylib\0", 0x7FFF5620BA38, 0x7)       = 0 0
 6804/0x17197:  stat64("/Applications/Xcode.app/Contents/Developer/usr/lib/libxcrun.dylib\0", 0x7FFF56209ED8, 0x7FFF5620AD80)        = 0 0
 6804/0x17197:  open("/Applications/Xcode.app/Contents/Developer/usr/lib/libxcrun.dylib\0", 0x0, 0x0)        = 3 0
 6804/0x17197:  pread(0x3, "\317\372\355\376\a\0", 0x1000, 0x0)      = 4096 0
 6804/0x17197:  fcntl(0x3, 0x3D, 0x7FFF56208180)         = 0 0
 6804/0x17197:  mmap(0x109A31000, 0x6000, 0x5, 0x12, 0x3, 0x0)       = 0x109A31000 0
 6804/0x17197:  mmap(0x109A37000, 0x1000, 0x3, 0x12, 0x3, 0x6000)        = 0x109A37000 0
 6804/0x17197:  mmap(0x109A38000, 0x3D30, 0x1, 0x12, 0x3, 0x7000)        = 0x109A38000 0
 6804/0x17197:  close(0x3)       = 0 0
 6804/0x17197:  geteuid(0x7FFF7B49BF48, 0x0, 0x0)        = 0 0
 6804/0x17197:  stat64("/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/\0", 0x7FFF5620A378, 0x7FE6C9801200)      = 0 0
 6804/0x17197:  mkdir("/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/\0", 0x1C0, 0x0)         = -1 Err#17
 6804/0x17197:  access("/Applications/Xcode.app/Contents/Developer\0", 0x4, 0x7FE6C9403940)      = 0 0
 6804/0x17197:  open("/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/xcrun_db\0", 0x0, 0x7FFF5620AB8F)         = 3 0
 6804/0x17197:  fstat64(0x3, 0x7FFF5620A620, 0x0)        = 0 0
 6804/0x17197:  mmap(0x0, 0xFE, 0x1, 0x2, 0x3, 0x0)      = 0x109A3C000 0
 6804/0x17197:  close(0x3)       = 0 0
 6804/0x17197:  stat64("/Applications/Xcode.app/Contents/Info.plist\0", 0x7FFF5620ABD8, 0x7FFF5620A5A8)      = 0 0
 6804/0x17197:  stat64("/usr/share/current-os.sdk/Info.plist\0", 0x7FFF5620AC18, 0x1)        = 0 0
 6804/0x17197:  stat64("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as\0", 0x7FFF5620AC30, 0x7FFF5620A6B8)        = 0 0
 6804/0x17197:  munmap(0x109A3C000, 0xFE)        = 0 0
dtrace: error on enabled probe ID 1834 (ID 260: syscall::execve:return): invalid address (0x7fe6c9403d90) in action #12 at DIF offset 24
 6804/0x17197:  thread_selfid(0x0, 0x1DC0, 0x7FFF6075D550)       = 94615 0
 6804/0x17197:  csops(0x0, 0x0, 0x7FFF54B72174)      = 0 0
 6804/0x17197:  issetugid(0x0, 0x0, 0x0)         = 0 0
 6804/0x17197:  shared_region_check_np(0x7FFF54B700A8, 0x10B08D000, 0x4)         = 0 0
 6804/0x17197:  stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF54B71078, 0x7FFF54B71F10)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcompiler_rt.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)         = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcopyfile.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libcorecrypto.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libdispatch.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libdyld.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libkeymgr.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/liblaunch.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libmacho.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libquarantine.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libremovefile.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_asl.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_blocks.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_c.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_configuration.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_dnssd.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_info.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)         = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_kernel.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_m.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_malloc.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_network.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_notify.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)       = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_platform.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)         = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_pthread.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_sandbox.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libsystem_stats.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)        = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libunc.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)         = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libunwind.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)      = 0 0
 6804/0x17197:  stat64("/usr/lib/system/libxpc.dylib\0", 0x7FFF54B70CD8, 0x7FFF54B71B70)         = 0 0
 6804/0x17197:  stat64("/usr/lib/libobjc.A.dylib\0", 0x7FFF54B6FF18, 0x7FFF54B70DB0)         = 0 0
 6804/0x17197:  stat64("/usr/lib/libauto.dylib\0", 0x7FFF54B6FF18, 0x7FFF54B70DB0)       = 0 0
 6804/0x17197:  stat64("/usr/lib/libc++abi.dylib\0", 0x7FFF54B6F9C8, 0x7FFF54B70860)         = 0 0
 6804/0x17197:  stat64("/usr/lib/libc++.1.dylib\0", 0x7FFF54B6F9C8, 0x7FFF54B70860)      = 0 0
 6804/0x17197:  stat64("/usr/lib/libDiagnosticMessagesClient.dylib\0", 0x7FFF54B6F8A8, 0x7FFF54B70740)       = 0 0
 6804/0x17197:  open("/dev/dtracehelper\0", 0x2, 0x7FFF54B72060)         = 3 0
 6801/0x17176:  __sysctl(0x7FFF5FBFEB28, 0x2, 0x7FFF5FBFEB38)        = 0 0
 6801/0x17176:  thread_selfid(0x7FFF7CBFD310, 0x7FFF7CBFD258, 0x10101)       = 94582 0
 6801/0x17176:  bsdthread_register(0x7FFF94309FBC, 0x7FFF94309FAC, 0x2000)       = 0 0
 6801/0x17176:  mprotect(0x1000E5000, 0x88, 0x1)         = 0 0
 6801/0x17176:  mprotect(0x1000E7000, 0x1000, 0x0)       = 0 0
 6801/0x17176:  mprotect(0x1000FD000, 0x1000, 0x0)       = 0 0
 6801/0x17176:  mprotect(0x1000FE000, 0x1000, 0x0)       = 0 0
 6801/0x17176:  mprotect(0x100114000, 0x1000, 0x0)       = 0 0
 6801/0x17176:  mprotect(0x100115000, 0x1000, 0x1)       = 0 0
 6801/0x17176:  mprotect(0x1000E5000, 0x88, 0x3)         = 0 0
 6801/0x17176:  mprotect(0x1000E5000, 0x88, 0x1)         = 0 0
 6801/0x17176:  issetugid(0x7FFF7C63B480, 0x7FFFFFE00034, 0x7FFFFFE00036)        = 0 0
 6801/0x17176:  getpid(0x1, 0x100116000, 0x49656E69)         = 6801 0
 6801/0x17176:  __mac_syscall(0x7FFF96E0FE47, 0x2, 0x7FFF5FBFE9A8)       = 0 0
 6801/0x17176:  stat64("/AppleInternal\0", 0x7FFF5FBFEA28, 0x0)      = -1 Err#2
 6801/0x17176:  audit_session_self(0x7FFF5FBFE8E0, 0x7FFF5FBFE718, 0x4)      = 4099 0
 6801/0x17176:  geteuid(0x7FFF5FBFE8E0, 0x7FFF5FBFE718, 0x0)         = 0 0
 6801/0x17176:  getegid(0x7FFF5FBFE8E0, 0x7FFF5FBFE718, 0x0)         = 0 0
 6801/0x17176:  getaudit_addr(0x7FFF5FBFE9B8, 0x30, 0x0)         = 0 0
 6801/0x17176:  csops(0x1A91, 0x7, 0x7FFF5FBFE5A0)       = -1 Err#22
 6801/0x17176:  ioctl(0x2, 0x4004667A, 0x7FFF5FBFFAE4)       = 0 0
 6801/0x17176:  ioctl(0x2, 0x4004667A, 0x7FFF5FBFFAF4)       = 0 0
 6801/0x17176:  sigaction(0x2, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)       = 0 0
 6801/0x17176:  sigaction(0x2, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)       = 0 0
 6801/0x17176:  sigaction(0x1, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)       = 0 0
 6801/0x17176:  sigaction(0x1, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)       = 0 0
 6801/0x17176:  sigaction(0xF, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)       = 0 0
 6801/0x17176:  sigaction(0xF, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)       = 0 0
 6801/0x17176:  sigaction(0xD, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)       = 0 0
 6801/0x17176:  sigaction(0xD, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)       = 0 0
 6801/0x17176:  sigaction(0x14, 0x7FFF5FBFFAE8, 0x7FFF5FBFFB10)      = 0 0
 6801/0x17176:  getrlimit(0x1003, 0x7FFF5FBFFB10, 0x0)       = 0 0
 6801/0x17176:  setrlimit(0x1003, 0x7FFF5FBFFB10, 0x3FFF000)         = 0 0
 6801/0x17176:  stat64("/\0", 0x7FFF5FBFE040, 0x7FFF5FBFFCCC)        = 0 0
 6801/0x17176:  open_nocancel(".\0", 0x0, 0x1)       = 3 0
 6801/0x17176:  fstat64(0x3, 0x7FFF5FBFD570, 0x0)        = 0 0
 6801/0x17176:  fcntl_nocancel(0x3, 0x32, 0x7FFF5FBFF530)        = 0 0
 6801/0x17176:  close_nocancel(0x3)      = 0 0
 6801/0x17176:  stat64("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF5FBFD4E0, 0x0)      = 0 0
 6801/0x17176:  stat64("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF5FBFE040, 0x4)      = 0 0
 6801/0x17176:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFE0D0)      = 0 0
 6801/0x17176:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/avr-g++\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFE0D0)      = 0 0
 6801/0x17176:  open_nocancel(".\0", 0x0, 0x1)       = 3 0
 6801/0x17176:  fstat64(0x3, 0x7FFF5FBFD570, 0x0)        = 0 0
 6801/0x17176:  fcntl_nocancel(0x3, 0x32, 0x7FFF5FBFF530)        = 0 0
 6801/0x17176:  close_nocancel(0x3)      = 0 0
 6801/0x17176:  stat64("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF5FBFD4E0, 0x0)      = 0 0
 6801/0x17176:  stat64("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF5FBFE040, 0x4)      = 0 0
 6801/0x17176:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFE0D0)      = 0 0
 6801/0x17176:  getattrlist("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/avr-g++\0", 0x7FFF8DC1DCC4, 0x7FFF5FBFE0D0)      = 0 0
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6801/0x17176:  access("bin/test.cpp\0", 0x0, 0x5)       = 0 0
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/\0", 0x1, 0x0)        = 0 0
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/specs\0", 0x4, 0x0)      = -1 Err#2
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/specs\0", 0x4, 0x0)        = -1 Err#2
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/lib/avr/5.1.0/specs\0", 0x4, 0x0)        = -1 Err#2
 6801/0x17176:  access("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/lib/specs\0", 0x4, 0x0)      = -1 Err#2
 6803/0x17195:  vfork()      = 0 0
 6803/0x17195:  thread_selfid(0x0, 0x1DC0, 0x7FFF60EEB550)       = 94613 0
 6803/0x17195:  csops(0x0, 0x0, 0x7FFF5FBFF024)      = 0 0
 6803/0x17195:  issetugid(0x0, 0x0, 0x0)         = 0 0
 6803/0x17195:  shared_region_check_np(0x7FFF5FBFCF58, 0x100000000, 0x4)         = 0 0
 6803/0x17195:  stat64("/usr/lib/libiconv.2.dylib\0", 0x7FFF5FBFDF18, 0x7FFF5FBFEDB0)        = 0 0
 6803/0x17195:  stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF5FBFDF18, 0x7FFF5FBFEDB0)       = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)       = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libcompiler_rt.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)         = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libcopyfile.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libcorecrypto.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libdispatch.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libdyld.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libkeymgr.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/liblaunch.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libmacho.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)       = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libquarantine.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libremovefile.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_asl.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_blocks.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)       = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_c.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_configuration.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_dnssd.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_info.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)         = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_kernel.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)       = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_m.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_malloc.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)       = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_network.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_notify.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)       = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_platform.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)         = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_pthread.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_sandbox.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libsystem_stats.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)        = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libunc.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)         = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libunwind.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)      = 0 0
 6803/0x17195:  stat64("/usr/lib/system/libxpc.dylib\0", 0x7FFF5FBFDA88, 0x7FFF5FBFE920)         = 0 0
 6803/0x17195:  stat64("/usr/lib/libobjc.A.dylib\0", 0x7FFF5FBFCCC8, 0x7FFF5FBFDB60)         = 0 0
 6803/0x17195:  stat64("/usr/lib/libauto.dylib\0", 0x7FFF5FBFCCC8, 0x7FFF5FBFDB60)       = 0 0
 6803/0x17195:  stat64("/usr/lib/libc++abi.dylib\0", 0x7FFF5FBFC778, 0x7FFF5FBFD610)         = 0 0
 6803/0x17195:  stat64("/usr/lib/libc++.1.dylib\0", 0x7FFF5FBFC778, 0x7FFF5FBFD610)      = 0 0
 6803/0x17195:  stat64("/usr/lib/libDiagnosticMessagesClient.dylib\0", 0x7FFF5FBFC658, 0x7FFF5FBFD4F0)       = 0 0
 6803/0x17195:  open("/dev/dtracehelper\0", 0x2, 0x7FFF5FBFEF10)         = 3 0
 6801/0x17176:  wait4(0x1A93, 0x1002049E0, 0x0)      = 6803 0
 6804/0x17197:  ioctl(0x3, 0x80086804, 0x7FFF54B71FE8)       = 0 0
 6804/0x17197:  fork()       = 6805 0
 6801/0x17176:  thread_selfid(0x0, 0x1DC0, 0x7FFF6B396550)       = 94582 0
 6801/0x17176:  open(".\0", 0x0, 0x1)        = 3 0
 6801/0x17176:  fstat64(0x3, 0x7FFF5FBFF030, 0x0)        = 0 0
 6801/0x17176:  fcntl(0x3, 0x32, 0x7FFF5FBFF2F0)         = 0 0
 6801/0x17176:  close(0x3)       = 0 0
 6801/0x17176:  stat64("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14\0", 0x7FFF5FBFEFA0, 0x0)      = 0 0
 6801/0x17176:  csops(0x0, 0x0, 0x7FFF5FBFF2B4)      = 0 0
 6801/0x17176:  issetugid(0x0, 0x0, 0x0)         = 0 0
 6801/0x17176:  shared_region_check_np(0x7FFF5FBFD1E8, 0x100000000, 0x4)         = 0 0
 6801/0x17176:  stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x7FFF5FBFE398, 0x7FFF5FBFF2D0)         = 0 0
 6801/0x17176:  open("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x0, 0x0)         = 3 0
 6801/0x17176:  pread(0x3, "\312\376\272\276\0", 0x1000, 0x0)        = 4096 0
 6801/0x17176:  pread(0x3, "\317\372\355\376\a\0", 0x1000, 0x1000)       = 4096 0
 6801/0x17176:  fcntl(0x3, 0x3D, 0x7FFF5FBFC700)         = 0 0
 6801/0x17176:  mmap(0x1000DF000, 0x2000, 0x5, 0x12, 0x3, 0x1000)        = 0x1000DF000 0
 6801/0x17176:  mmap(0x1000E1000, 0x1000, 0x3, 0x12, 0x3, 0x3000)        = 0x1000E1000 0
 6801/0x17176:  mmap(0x1000E2000, 0x2050, 0x1, 0x12, 0x3, 0x4000)        = 0x1000E2000 0
 6801/0x17176:  close(0x3)       = 0 0
 6801/0x17176:  stat64("/usr/lib/libiconv.2.dylib\0", 0x7FFF5FBFE1A8, 0x7FFF5FBFF040)        = 0 0
 6801/0x17176:  stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF5FBFE1A8, 0x7FFF5FBFF040)       = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)       = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libcompiler_rt.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)         = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libcopyfile.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libcorecrypto.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libdispatch.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libdyld.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libkeymgr.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/liblaunch.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libmacho.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)       = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libquarantine.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libremovefile.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_asl.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_blocks.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)       = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_c.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_configuration.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_dnssd.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_info.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)         = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_kernel.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)       = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_m.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_malloc.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)       = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_network.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_notify.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)       = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_platform.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)         = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_pthread.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_sandbox.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libsystem_stats.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)        = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libunc.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)         = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libunwind.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/system/libxpc.dylib\0", 0x7FFF5FBFDD18, 0x7FFF5FBFEBB0)         = 0 0
 6801/0x17176:  stat64("/usr/lib/libobjc.A.dylib\0", 0x7FFF5FBFCF58, 0x7FFF5FBFDDF0)         = 0 0
 6801/0x17176:  stat64("/usr/lib/libauto.dylib\0", 0x7FFF5FBFCF58, 0x7FFF5FBFDDF0)       = 0 0
 6801/0x17176:  stat64("/usr/lib/libc++abi.dylib\0", 0x7FFF5FBFCA08, 0x7FFF5FBFD8A0)         = 0 0
 6801/0x17176:  stat64("/usr/lib/libc++.1.dylib\0", 0x7FFF5FBFCA08, 0x7FFF5FBFD8A0)      = 0 0
 6801/0x17176:  stat64("/usr/lib/libDiagnosticMessagesClient.dylib\0", 0x7FFF5FBFC8E8, 0x7FFF5FBFD780)       = 0 0
 6801/0x17176:  getpid(0x7FFF5FBFF0A8, 0x1000DE004, 0xEA60)      = 6801 0
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../libexec/gcc/avr/5.1.0/as\0", 0x7FFF5FBFF7E0, 0x0)        = -1 Err#2
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../libexec/gcc/as\0", 0x7FFF5FBFF7E0, 0x0)      = -1 Err#2
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/avr/5.1.0/as\0", 0x7FFF5FBFF7E0, 0x0)      = -1 Err#2
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/as\0", 0x7FFF5FBFF7E0, 0x0)        = -1 Err#2
 6804/0x17176:  vfork()      = 6804 0
 6801/0x17176:  vfork()      = 6804 0
 6801/0x17176:  vfork()      = 6804 Err#2
 6804/0x17197:  close(0x3)       = 0 0
 6804/0x17197:  __sysctl(0x7FFF54B71AF8, 0x2, 0x7FFF54B71B08)        = 0 0
 6804/0x17197:  thread_selfid(0x7FFF7CBFD310, 0x7FFF7CBFD258, 0x10101)       = 94615 0
 6804/0x17197:  bsdthread_register(0x7FFF94309FBC, 0x7FFF94309FAC, 0x2000)       = 0 0
 6804/0x17197:  mprotect(0x10B095000, 0x88, 0x1)         = 0 0
 6804/0x17197:  mprotect(0x10B097000, 0x1000, 0x0)       = 0 0
 6804/0x17197:  mprotect(0x10B0AD000, 0x1000, 0x0)       = 0 0
 6804/0x17197:  mprotect(0x10B0AE000, 0x1000, 0x0)       = 0 0
 6804/0x17197:  mprotect(0x10B0C4000, 0x1000, 0x0)       = 0 0
 6804/0x17197:  mprotect(0x10B0C5000, 0x1000, 0x1)       = 0 0
 6804/0x17197:  mprotect(0x10B095000, 0x88, 0x3)         = 0 0
 6804/0x17197:  mprotect(0x10B095000, 0x88, 0x1)         = 0 0
 6804/0x17197:  issetugid(0x7FFF7C63B480, 0x7FFFFFE00034, 0x7FFFFFE00036)        = 0 0
 6804/0x17197:  getpid(0x1, 0x10B0C6000, 0x49656E69)         = 6804 0
 6804/0x17197:  __mac_syscall(0x7FFF96E0FE47, 0x2, 0x7FFF54B71978)       = 0 0
 6804/0x17197:  stat64("/AppleInternal\0", 0x7FFF54B719F8, 0x0)      = -1 Err#2
 6804/0x17197:  audit_session_self(0x7FFF54B718B0, 0x7FFF54B716E8, 0x4)      = 263 0
 6804/0x17197:  geteuid(0x7FFF54B718B0, 0x7FFF54B716E8, 0x0)         = 0 0
 6804/0x17197:  getegid(0x7FFF54B718B0, 0x7FFF54B716E8, 0x0)         = 0 0
 6804/0x17197:  getaudit_addr(0x7FFF54B71988, 0x30, 0x0)         = 0 0
 6804/0x17197:  csops(0x1A94, 0x7, 0x7FFF54B71570)       = 0 0
 6804/0x17197:  stat64("/\0", 0x7FFF54B70CE0, 0x7FFF7C929110)        = 0 0
 6804/0x17197:  getattrlist("/Applications\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)       = 0 0
 6804/0x17197:  getattrlist("/Applications/Xcode.app\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)         = 0 0
 6804/0x17197:  getattrlist("/Applications/Xcode.app/Contents\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)        = 0 0
 6804/0x17197:  getattrlist("/Applications/Xcode.app/Contents/Developer\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)      = 0 0
 6804/0x17197:  getattrlist("/Applications/Xcode.app/Contents/Developer/Toolchains\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)       = 0 0
 6804/0x17197:  getattrlist("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)      = 0 0
 6804/0x17197:  getattrlist("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)      = 0 0
 6804/0x17197:  getattrlist("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)      = 0 0
 6804/0x17197:  getattrlist("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as\0", 0x7FFF8DC1DCC4, 0x7FFF54B70D70)       = 0 0
 6804/0x17197:  access("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../libexec/as/x86_64/as\0", 0x0, 0x0)         = 0 0
 6805/0x17198:  bsdthread_register(0x7FFF94309FBC, 0x7FFF94309FAC, 0x2000)       = -1 Err#22
dtrace: error on enabled probe ID 1834 (ID 260: syscall::execve:return): invalid address (0x7fa6894037c0) in action #12 at DIF offset 24
 6805/0x17198:  thread_selfid(0x0, 0x1DC0, 0x7FFF6556D550)       = 94616 0
 6805/0x17198:  csops(0x0, 0x0, 0x7FFF55EBE144)      = 0 0
 6805/0x17198:  issetugid(0x0, 0x0, 0x0)         = 0 0
 6805/0x17198:  shared_region_check_np(0x7FFF55EBC078, 0x109D41000, 0x4)         = 0 0
 6805/0x17198:  stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF55EBD048, 0x7FFF55EBDEE0)       = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)       = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libcompiler_rt.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)         = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libcopyfile.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libcorecrypto.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libdispatch.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libdyld.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libkeymgr.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/liblaunch.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libmacho.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)       = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libquarantine.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libremovefile.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_asl.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_blocks.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)       = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_c.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_configuration.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_dnssd.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_info.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)         = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_kernel.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)       = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_m.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_malloc.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)       = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_network.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_notify.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)       = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_platform.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)         = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_pthread.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_sandbox.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libsystem_stats.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)        = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libunc.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)         = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libunwind.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)      = 0 0
 6805/0x17198:  stat64("/usr/lib/system/libxpc.dylib\0", 0x7FFF55EBCCA8, 0x7FFF55EBDB40)         = 0 0
 6805/0x17198:  stat64("/usr/lib/libobjc.A.dylib\0", 0x7FFF55EBBEE8, 0x7FFF55EBCD80)         = 0 0
 6805/0x17198:  stat64("/usr/lib/libauto.dylib\0", 0x7FFF55EBBEE8, 0x7FFF55EBCD80)       = 0 0
 6805/0x17198:  stat64("/usr/lib/libc++abi.dylib\0", 0x7FFF55EBB998, 0x7FFF55EBC830)         = 0 0
 6805/0x17198:  stat64("/usr/lib/libc++.1.dylib\0", 0x7FFF55EBB998, 0x7FFF55EBC830)      = 0 0
 6805/0x17198:  stat64("/usr/lib/libDiagnosticMessagesClient.dylib\0", 0x7FFF55EBB878, 0x7FFF55EBC710)       = 0 0
 6805/0x17198:  open("/dev/dtracehelper\0", 0x2, 0x7FFF55EBE030)         = 3 0
 6805/0x17198:  fork()       = 0 0
 6805/0x17198:  thread_selfid(0x7FFF7CBFD310, 0x7FFF927E2E2E, 0x1)       = 94616 0
FATAL:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
 6805/0x17198:  ioctl(0x3, 0x80086804, 0x7FFF55EBDFB8)       = 0 0
 6805/0x17198:  close(0x3)       = 0 0
 6805/0x17198:  __sysctl(0x7FFF55EBDAC8, 0x2, 0x7FFF55EBDAD8)        = 0 0
 6805/0x17198:  thread_selfid(0x7FFF7CBFD310, 0x7FFF7CBFD258, 0x10101)       = 94616 0
 6805/0x17198:  bsdthread_register(0x7FFF94309FBC, 0x7FFF94309FAC, 0x2000)       = 0 0
 6805/0x17198:  mprotect(0x109D7A000, 0x88, 0x1)         = 0 0
 6805/0x17198:  mprotect(0x109D7C000, 0x1000, 0x0)       = 0 0
 6805/0x17198:  mprotect(0x109D92000, 0x1000, 0x0)       = 0 0
 6805/0x17198:  mprotect(0x109D93000, 0x1000, 0x0)       = 0 0
 6805/0x17198:  mprotect(0x109DA9000, 0x1000, 0x0)       = 0 0
 6805/0x17198:  mprotect(0x109DAA000, 0x1000, 0x1)       = 0 0
 6805/0x17198:  mprotect(0x109D7A000, 0x88, 0x3)         = 0 0
 6805/0x17198:  mprotect(0x109D7A000, 0x88, 0x1)         = 0 0
 6805/0x17198:  issetugid(0x7FFF7C63B480, 0x7FFFFFE00034, 0x7FFFFFE00036)        = 0 0
 6805/0x17198:  getpid(0x1, 0x109DAB000, 0x49656E69)         = 6805 0
 6805/0x17198:  __mac_syscall(0x7FFF96E0FE47, 0x2, 0x7FFF55EBD948)       = 0 0
 6805/0x17198:  stat64("/AppleInternal\0", 0x7FFF55EBD9C8, 0x0)      = -1 Err#2
 6805/0x17198:  audit_session_self(0x7FFF55EBD880, 0x7FFF55EBD6B8, 0x4)      = 3587 0
 6805/0x17198:  geteuid(0x7FFF55EBD880, 0x7FFF55EBD6B8, 0x0)         = 0 0
 6805/0x17198:  getegid(0x7FFF55EBD880, 0x7FFF55EBD6B8, 0x0)         = 0 0
 6805/0x17198:  getaudit_addr(0x7FFF55EBD958, 0x30, 0x0)         = 0 0
 6805/0x17198:  csops(0x1A95, 0x7, 0x7FFF55EBD540)       = 0 0
 6805/0x17198:  sigaction(0x1, 0x7FFF55EBE968, 0x7FFF55EBE990)       = 0 0
 6805/0x17198:  sigaction(0x1, 0x7FFF55EBE968, 0x7FFF55EBE990)       = 0 0
 6805/0x17198:  sigaction(0x2, 0x7FFF55EBE968, 0x7FFF55EBE990)       = 0 0
 6805/0x17198:  sigaction(0x2, 0x7FFF55EBE968, 0x7FFF55EBE990)       = 0 0
 6805/0x17198:  sigaction(0xD, 0x7FFF55EBE968, 0x7FFF55EBE990)       = 0 0
 6805/0x17198:  sigaction(0xD, 0x7FFF55EBE968, 0x7FFF55EBE990)       = 0 0
 6805/0x17198:  sigaction(0xF, 0x7FFF55EBE968, 0x7FFF55EBE990)       = 0 0
 6805/0x17198:  sigaction(0xF, 0x7FFF55EBE968, 0x7FFF55EBE990)       = 0 0
 6805/0x17198:  getrlimit(0x1008, 0x7FFF55EBE720, 0x7FFF8DBC7E7C)        = 0 0
 6805/0x17198:  write_nocancel(0x2, "FATAL:\0", 0x6)         = 6 0
 6805/0x17198:  write_nocancel(0x2, "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!\0", 0x8C)      = 140 0
 6805/0x17198:  write_nocancel(0x2, "\n\0", 0x1)         = 1 0
 6804/0x17197:  wait4(0xFFFFFFFF, 0x7FFF54B72194, 0x0)       = 6805 0
 6801/0x17176:  wait4(0x1A94, 0x101800180, 0x0)      = 6804 0
 6801/0x17176:  stat("test.o\0", 0x7FFF5FBFF9C0, 0x1002046E0)        = -1 Err#2
 6801/0x17176:  stat("/var/tmp//ccZpzOqE.s\0", 0x7FFF5FBFFAB0, 0x1)      = 0 0
 6801/0x17176:  unlink("/var/tmp//ccZpzOqE.s\0", 0x7FFF5FBFFAB0, 0x0)        = 0 0

As you can see it looks for the default toolchain first and can't seem to find the one bundled with it:

 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../libexec/gcc/avr/5.1.0/as\0", 0x7FFF5FBFF7E0, 0x0)        = -1 Err#2
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../libexec/gcc/as\0", 0x7FFF5FBFF7E0, 0x0)      = -1 Err#2
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/avr/5.1.0/as\0", 0x7FFF5FBFF7E0, 0x0)      = -1 Err#2
 6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/as\0", 0x7FFF5FBFF7E0, 0x0)        = -1 Err#2

As far as I can see the line:

6801/0x17176:  stat("/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/as\0", 0x7FFF5FBFF7E0, 0x0)        = -1 Err#2

Should not return an error.

matthijskooijman commented 9 years ago

Weird. If you list the literal, path, does it show up as a file? I.e. what does

$ ls /Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/../lib/gcc/avr/5.1.0/../../../../avr/bin/as

say?

Perhaps there is some symlink involved somewhere that messes up the path?

Lauszus commented 9 years ago

You were right, the symlink were wrong:

$ ls -l as
lrwxr-xr-x@ 1 Lauszus  staff  36 Jul 10 15:34 as -> pkg-x86_64-apple-darwin14/bin/avr-as

So I fixed the Symlink:

$ ls -l as
lrwxr-xr-x  1 Lauszus  staff  16 Jul 15 10:55 as -> ../../bin/avr-as

And now it is compiling :)

Sketch uses 20,192 bytes (7%) of program storage space. Maximum is 253,952 bytes.
Global variables use 958 bytes (11%) of dynamic memory, leaving 7,234 bytes for local variables. Maximum is 8,192 bytes.

However I had to se the path to the plugin path manually using @facchinm approach, as calling avr-gcc-ar did not work:

/Users/Lauszus/Downloads/pkg-x86_64-apple-darwin14/bin/avr-gcc-ar rcs /var/folders/st/ln3d8j1n7x91gq9gk8304gtw0000gn/T/build1697541061525639817.tmp/core/core.a /var/folders/st/ln3d8j1n7x91gq9gk8304gtw0000gn/T/build1697541061525639817.tmp/core/wiring_pulse.S.o 
sorry - this program has been built without plugin support
Error compiling.
Lauszus commented 9 years ago

In fact it seems like all the symlink inside pkg-x86_64-apple-darwin14/avr/bin are all wrong:

$ ls -l
total 72
lrwxr-xr-x@ 1 Lauszus  staff  36 Jul 10 15:34 ar -> pkg-x86_64-apple-darwin14/bin/avr-ar
lrwxr-xr-x  1 Lauszus  staff  16 Jul 15 10:55 as -> ../../bin/avr-as
lrwxr-xr-x@ 1 Lauszus  staff  40 Jul 10 15:34 ld -> pkg-x86_64-apple-darwin14/bin/avr-ld.bfd
lrwxr-xr-x@ 1 Lauszus  staff  40 Jul 10 15:34 ld.bfd -> pkg-x86_64-apple-darwin14/bin/avr-ld.bfd
lrwxr-xr-x@ 1 Lauszus  staff  36 Jul 10 15:34 nm -> pkg-x86_64-apple-darwin14/bin/avr-nm
lrwxr-xr-x@ 1 Lauszus  staff  41 Jul 10 15:34 objcopy -> pkg-x86_64-apple-darwin14/bin/avr-objcopy
lrwxr-xr-x@ 1 Lauszus  staff  41 Jul 10 15:34 objdump -> pkg-x86_64-apple-darwin14/bin/avr-objdump
lrwxr-xr-x@ 1 Lauszus  staff  40 Jul 10 15:34 ranlib -> pkg-x86_64-apple-darwin14/bin/avr-ranlib
lrwxr-xr-x@ 1 Lauszus  staff  39 Jul 10 15:34 strip -> pkg-x86_64-apple-darwin14/bin/avr-strip

Except the one I just fixed of course ;)

Lauszus commented 9 years ago

Fixing the ar symlink solved the problem with using avr-gcc-ar:

$ ls -l ar 
lrwxr-xr-x  1 Lauszus  staff  16 Jul 15 11:16 ar -> ../../bin/avr-ar

In fact all symlink can be fixed by making one symlink to the root of the folder inside avr/bin:

$ ln -s ../../ pkg-x86_64-apple-darwin14

I am wondering why it worked using @facchinm setup?

Btw the three symlink inside bin are wrong as well:

$ ls -l avr-c++ avr-gcc-5.1.0 avr-ld
lrwxr-xr-x@ 1 Lauszus  staff  37 Jul 10 15:47 avr-c++ -> pkg-x86_64-apple-darwin14/bin/avr-g++
lrwxr-xr-x@ 1 Lauszus  staff  37 Jul 10 15:47 avr-gcc-5.1.0 -> pkg-x86_64-apple-darwin14/bin/avr-gcc
lrwxr-xr-x@ 1 Lauszus  staff  40 Jul 10 15:34 avr-ld -> pkg-x86_64-apple-darwin14/bin/avr-ld.bfd
facchinm commented 9 years ago

Great to hear good news @Lauszus . I've just checked the path on the mac where I've run the tests and it appears that every symlink has been replaced by the real file... To extract the archive I've run tar xvf pkg-x86_64-apple-darwin14.tar.xz, maybe other extractors behave differently?

Lauszus commented 9 years ago

@facchinm ahh that seems to be the reason. I just extracted it by doubling clicking the package.

NicoHood commented 9 years ago

We are currently trying to fix the linked issue above. I tried to enable 5.1 in a 1.6.6 nightly build (but without the new compiler, so more 1.6.5 like in this case).

# These can be overridden in platform.local.txt
compiler.c.extra_flags=-Wextra -flto
compiler.c.elf.extra_flags=-w -flto -fuse-linker-plugin
compiler.S.extra_flags=-flto
compiler.cpp.extra_flags=-Wextra -flto
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
compiler.ar.extra_flags=--plugin=~/bin/pkg-x86_64-unknown-linux-gnu/libexec/gcc/avr/5.1.0/liblto_plugin.so

But I get:

sorry - this program has been built without plugin support
Error compiling.

Any ideas? And yes I extracted with tar xvf.

user@pc:~/bin/pkg-x86_64-unknown-linux-gnu/libexec/gcc/avr/5.1.0$ ls
cc1  cc1plus  collect2  install-tools  liblto_plugin.la  liblto_plugin.so  liblto_plugin.so.0  liblto_plugin.so.0.0.0  lto1  lto-wrapper

user@pc:~/bin/pkg-x86_64-unknown-linux-gnu/bin$ ls -l avr-c++ avr-gcc-5.1.0 avr-ld
-rwxr-xr-x 1 user user  841544 Jul 10 15:08 avr-c++
-rwxr-xr-x 1 user user  841544 Jul 10 15:08 avr-gcc-5.1.0
-rwxr-xr-x 1 user user 6663715 Jul 10 14:55 avr-ld

user@pc:~/bin/pkg-x86_64-unknown-linux-gnu/bin$ ls
avr-addr2line  avr-as   avr-c++filt  avr-elfedit  avr-gcc        avr-gcc-ar  avr-gcc-ranlib  avr-gcov-tool  avr-ld      avr-man  avr-objcopy  avr-ranlib   avr-size     avr-strip
avr-ar         avr-c++  avr-cpp      avr-g++      avr-gcc-5.1.0  avr-gcc-nm  avr-gcov        avr-gprof      avr-ld.bfd  avr-nm   avr-objdump  avr-readelf  avr-strings

user@pc:~/bin/pkg-x86_64-unknown-linux-gnu/avr/bin$ ls -l ar 
-rwxr-xr-x 1 user user 3952559 Jul 10 14:55 ar

user@pc:~/bin/pkg-x86_64-unknown-linux-gnu/avr/bin$ ln -s ../../pkg-x86_64-unknown-linux-gnu
user@pc:~/bin/pkg-x86_64-unknown-linux-gnu/avr/bin$ ls
ar  as  ld  ld.bfd  nm  objcopy  objdump  pkg-x86_64-unknown-linux-gnu  ranlib  strip

Edit

After a few try&error this worked (no idea if the flags make sense like that):

compiler.path=/home/user/Downloads/pkg-x86_64-unknown-linux-gnu/bin/
compiler.c.extra_flags=-Wextra -flto
compiler.c.elf.extra_flags=-w -flto -fuse-linker-plugin
compiler.S.extra_flags=-flto
compiler.cpp.extra_flags=-Wextra -flto
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
compiler.ar.extra_flags=--plugin=/home/user/Downloads/pkg-x86_64-unknown-linux-gnu/libexec/gcc/avr/5.1.0/liblto_plugin.so

A sketch I used with multiple libraries (FastLED, PinChangeInterrupt, IRLRemote, HID-Project). Two of them (the middle ones) are compiles with my .a linkage patch/PR. Results: less flash, more ram

// 4.8 normal
// 32u2 14352 636
// 32u4 13388 616

// 5.1 LTO
// 32u2 13008 648
// 32u4 12528 646

The linked issue was NOT fixed with 5.1

matthijskooijman commented 9 years ago

@NicoHood, here's the config I used for the mass testing:

compiler.path=/home/matthijs/avr-gcc-5.1/bin/
compiler.c.extra_flags=-flto -fno-fat-lto-objects
compiler.c.elf.extra_flags=-flto -fuse-linker-plugin
compiler.S.extra_flags=-flto
compiler.cpp.extra_flags=-flto
compiler.ar.cmd=avr-gcc-ar

This uses avr-gcc-ar instead of manually passing the --plugin option, which pretty much has the same effect. The -fno-fat-lto-objecs option is just to speed up compiling, it shouldn't be required or affect the result.

mikaelpatel commented 9 years ago

Great work!

I had to remove usage of LTO from Cosa for the Arduino IDE when the plugin was not correctly delivered with the Windows version of the AVR tool chain. It has been working fine for the Linux delivery since 1.5.7. Below is a link to the latest Cosa platform.txt with LTO enabled, https://github.com/mikaelpatel/Cosa/blob/master/config/platform.txt-flto#L57.

The Linux build support for Cosa is a modified version of Arduino-Makefile. Please see https://github.com/mikaelpatel/Cosa/blob/master/build/Arduino-Makefile/Arduino.mk#L936 for details on the LTO flags.

The above "compiler.c.elf.extra_flags" might need some additional tweaking.

Longer discussion here https://groups.google.com/a/arduino.cc/forum/#!topic/developers/21G5w2HbUOg[26-50].

Cheers!

NicoHood commented 9 years ago

I will try it. But why does it increase the ram usage?

NicoHood commented 8 years ago

Am I allowed to upload a copy of the precompiled linux version to my HoodLoader2.0.5 release? https://github.com/NicoHood/HoodLoader2

A link to this post is placed here: https://github.com/NicoHood/HoodLoader2/wiki/Developer-Information

facchinm commented 8 years ago

@NicoHood , I believe you can do it, the script for generating the toolchain is GPL and also all the components so you only need to preserve the license and the attribution :wink: Feel free to add all the supported platforms and not only Linux

NicoHood commented 8 years ago

I just tried to recompile avr-gcc 5.1 myself. It seems that it does not want to apply the patch. no idea why. I patched it myself, but get the same patch, so I am wondering whats wrong here:

+ tar xf gcc-5.1.0.tar.bz2
+ tar xf isl-0.12.2.tar.bz2
+ tar xf cloog-0.18.1.tar.gz
+ tar xf gmp-5.1.3.tar.bz2
+ tar xf mpfr-3.1.3.tar.bz2
+ tar xf mpc-1.0.3.tar.gz
+ rm -rf gcc-5.1.0/cloog gcc-5.1.0/isl gcc-5.1.0/gmp gcc-5.1.0/mpfr gcc-5.1.0/mpc
+ mv cloog-0.18.1 gcc-5.1.0/cloog
+ mv isl-0.12.2 gcc-5.1.0/isl
+ mv gmp-5.1.3 gcc-5.1.0/gmp
+ mv mpfr-3.1.3 gcc-5.1.0/mpfr
+ mv mpc-1.0.3 gcc-5.1.0/mpc
+ cd gcc-5.1.0/
+ sed -i '/ac_cpp=/s/$CPPFLAGS/$CPPFLAGS -O2/' libiberty/configure gcc/configure
+ patch -p0
patching file gcc/lto-wrapper.c
Hunk #1 FAILED at 934.
/tmp/avrgcc/gcc-5.1.0$ git diff gcc/lto-wrapper.c gcc/lto-wrapper.c.orig 
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c.orig
index 3b3f220..404cb68 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c.orig
@@ -934,7 +934,7 @@ run_gcc (unsigned argc, char *argv[])
          filename[p - argv[i]] = '\0';
          file_offset = (off_t) loffset;
        }
-      fd = open (argv[i], O_RDONLY|O_BINARY);
+      fd = open (argv[i], O_RDONLY);
       if (fd == -1)
        {
          lto_argv[lto_argc++] = argv[i];

No idea whats wrong so far...

Edit: GCC5.3 seems to have this patch applied by default. Compiling avr-gcc5.3 worked without problems (removed the patch).

Was there a reason why you used outdated versions like isl12.2 while there is already 15 available?

NicoHood commented 8 years ago

@facchinm I tried your script with the most up to date source. I also changed a lot of stuff.

What confuses me is the guess config option: https://gist.github.com/NicoHood/58e82f19c6b97463025e#file-avr_gcc_multicross-sh-L108-L112 I get two different outputs here. So shoud I just use one of those, or each source should use its own guess output? Also cant we just leave out the --build option since it then should automatically use the guess? http://airs.com/ian/configure/configure_6.html

You added a lot of parameters for the gcc configuration. Could you explain why you used them? Other scripts dont use them: https://github.com/nerdralph/make-avr-gcc/blob/master/buildavr-gcc.sh http://www.nongnu.org/avr-libc/user-manual/install_tools.html

Also I dont know if the downloaded patches are all essential. I think there must be a reason why to use them, I just can barely find information why are they used. Because I am a bit afraid that just bumping the version number without knowing how to patch and configure the source before compiling is not a good idea.

Could someone please give me a few hints? Latest version: https://gist.github.com/NicoHood/58e82f19c6b97463025e

facchinm commented 8 years ago

Hi Nico, about the guess config option, it's only a way to avoid requiring explicit --build to be passed to the script. The tools are all vanilla except the gcc patch (I don't know if it has been solved upstream, the "original" version couldn't load the lto dll on Win) All the configuration parameters are

Anyway, thanks for updating the script, I'll try it out as soon as I can :smile:

NicoHood commented 8 years ago

@facchinm I updated the script once again and made a repository here: https://github.com/NicoHood/AVR-Development-Environment-Script

facchinm commented 8 years ago

Hi @NicoHood , I tested your script to compile gcc 6.1 and it works GREAT! Thank you very much for sharing, I'll push to use it for compiling next toolchain update

NicoHood commented 8 years ago

6.1 is out?

I noticed that 5.3 produced a lot bigger code for a new bootloader that i was coding (not tested with hoodloader). And with LTO enabled it was even larger (around 500bytes, 4kb total). However I have not tried 6.1 yet. If there are any tweaks we can add to the script, open a PR.

An experimental avr-gcc 6.1 for arduino would be very nice to test. :)

facchinm commented 8 years ago

Here you go http://downloads.arduino.cc/experimental-toolchains/avr-gcc-6.1-linux64.tar.xz :smile: I'll test it soon and report the results here (with and without lto)

facchinm commented 8 years ago

The full changelog is here, the toolchain seems to work good but I only performed some tests. The new error diagnostic is great (check version control conflict marker in file)

Flags used:

compiler.path=/home/martino/avr-gcc-6.1/bin/
compiler.c.extra_flags=-flto -fno-fat-lto-objects
compiler.c.elf.extra_flags=-flto -fuse-linker-plugin
compiler.S.extra_flags=-flto
compiler.cpp.extra_flags=-flto
compiler.ar.cmd=avr-gcc-ar
compiler.ar.extra_flags=""
compiler.objcopy.eep.extra_flags=""
compiler.elf2hex.extra_flags=""
facchinm commented 8 years ago

Small update: lto build on 6.1 segfaults on libraries using virtual inheritance. Hence, adding -fno-devirtualize to c and cpp extra flags solves the segfault. I couldn't find any reference for this bug on GCC/binutils bugtracker

NicoHood commented 8 years ago

I currently tried to rerun this script, but the binutils script from archlinux.org does not work anymore. @facchinm why did you include this?

Is the solution for the segfault a reasonable solution or only a workaround? Can we also include this to the script?

I also tried avr-gcc 4.9.2 from ubuntu 16.04 which also has lto enabled and produces also very small code.

facchinm commented 8 years ago

Hi Nico, the binutils patch was a fix for avr-size reporting incorrect results, instead the lto patch was fixing the segfault with lto plugin. I believe we should include it in the script by default to avoid the archlinux link to break the build

harryboo commented 8 years ago

@facchinm:

Can you provide a windows toolchain also?

Thanx

facchinm commented 8 years ago

@harryboo here you are http://downloads.arduino.cc/experimental-toolchains/avr-gcc-6.1-mingw32.zip The toolchain is totally untested, use at your own risk :smile:

harryboo commented 8 years ago

@facchinm:

Thanx with zip as extension the link is working. But i cannot get this toolchain to work. I have replaced the content of the avr directory under hardware\tools and copied the libwinpthread-1.dll into the bin directory. But i get this error in the arduino ide "exec: "/bin/avr-g++": file does not exist". If i double click the exe i get this error message in a popup "the application was unable to start correctly 0xc00007b".

Do you know how to get the toolchain to work?

Thanx