nickclifton (nickclifton) wrote,

August 2014 GNU Toolchain Update

Hi Guys,

  Here are the highlights of this month's changes in the GNU Toolchain:

  * The linker now accepts --push-state and --pop-state command line options.  The --push-state option preserves the current state of the flags which govern the input file handling, such as --as-needed, --whole-archive and so on.  (The full list is in the linker documentation).  The idea is that components of a build system can safely insert options into the linker command line without having to be aware of what options may have previously been added.  So for example a tool could add:

      --pushstate --as-needed -libone -libtwo --pop-state

    at any point in the linker command line and be sure that it will work as expected, even if the rest of the command line was using --no-as-needed.

  * The x86/PE linker supports a new option: --high-entropy-va which marks the binary being generated as being compatible with 64-bit address space layout randomization (ASLR).

  * The compiler driver program (gcc or g++) will now pass:

      -z <foo>

    Directly on to the linker.  This allows slightly easier access to these linker command line options.

  * The compiler now supports some new warning options:


    Which warns about boolean expressions that are compared with an integer value different from true/false.  For example:

      int n = 5;
      if ((n > 1) == 2) { ....


    This warns about features used in the program that are present in the ISO C99 standard but not present in ISO C90 standard.

    Similarly this warns about the use of ISO C11 features that are not present in ISO C99.


    This disables warnings about positional initialization of structs that requiring designated initializers.  (See below).


    This warns about suspicious calls to memset where the third argument is a literal zero and the second is not.  For example:

      memset (buf, sizeof buf, 0)

    where the second and third arguments are the wrong way around.

    This warns about types with virtual methods where code quality would be improved if the type was declared with C++11 final specifier, or, if possible, declared in anonymous namespace.  This allows GCC to devritualize more aggressively the polymorphic calls.  This warning is more effective with link time optimization, where the information about the class hierarchy graph is more complete.


    Similarly this warns about virtual methods where code quality would be improved if the method was declared with C++11 final specifier, or, if possible, its type was declared in the anonymous namespace or with final specifier.
  * The compiler now supports a new type attribute called:
    This attribute may only be applied to structure types.  It indicates that any initialization of an object of this type must use designated initializers:

      struct point { int x; int y };
      struct point p = { .y = 1, .x = 2 };

    Rather than positional initializers:

      struct point p = { 2, 1 };
    The intent of this attribute is to allow the programmer to indicate that a structure's layout may change, and that therefore relying on positional initialization will result in future breakage.

    Attempts to use positional initialization on a structure annotated with this new attribute will generate a compile time warning unless the new -Wno-designated-init command line option is used.

  * The compiler's sanitizer has two new features:


     Which enables AddressSanitizer for Linux kernel.  See
     for more details.


     Which enables checking of alignment of pointers when they are dereferenced, or when a reference is bound to insufficiently aligned target, or when a method or constructor is invoked on insufficiently aligned object.

   * The C and C++ compilers have a new optimization which is enabled automatically at -O2 and above:


     This optimizes various standard C string functions (e.g. strlen, strchr or strcpy) into faster alternatives, where this is possible.


  • October/November GNU Toolchain Update

    Hi Guys, Sorry for the delay beqwteen these updates. My new job is keeping me very busy... Anyway here are the highlights of the changes in the GNU…

  • September 2015 GNU Toolchain Update

    Hi Guys, There are lots of things to report in this month's update... * The G++ ABI has been increased to version 10. This adds mangling of…

  • July/Augist 2015 GNU Toolchain Update

    Hi Guys, Sorry for the delay in bringing you this update; I have been very busy in the last few months. Anyway the highlights of the changes to the…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded