Support for -march=native arguments

29 views
Skip to first unread message

Andrew Savchenko

unread,
Jun 16, 2013, 10:39:00 PM6/16/13
to distcc-...@googlegroups.com
Hello,

at this moment distcc fallbacks to local compilation if -march=native
or -mtune=native arguments are found.

However, it is possible to expand these arguments (as well as
-mcpu=native) from gcc verbose output and use them to replace
-m<arg>=native flags. The following patch implements this.

In short, "native" flags are replaced by data taken from
gcc -E -v - -m<arg>=native
output. They are cached and cache depends on both compiler and
"native" flags provided.

Compiler is identified by its size and mtime. If full name search
fails, basename based search is performed (the same way as when
running compilation process).

Cache depends on flags, because on some architectures different
combinations may provide different results.

Most of the new code is placed at arg_native.c, other places have
as-needed modifications.

Patch is tested on x86 and amd64 architectures with distcc-3.2rc1.

Best regards,
Andrew Savchenko
distcc-3.2_rc1-native.patch

Andrew Savchenko

unread,
Jun 17, 2013, 7:07:27 PM6/17/13
to distcc-...@googlegroups.com
Hello,
Here is updated patch. Changes:
- get rid of strdup() and free() operations where operations on
pointers may be used instead. This saves some CPU cycles;
- make GCC output parser more reliable.

Best regards,
Andrew Savchenko
distcc-3.2_rc1-native.patch
Reply all
Reply to author
Forward
0 new messages