You are viewing nickclifton

Tired of ads? Upgrade to paid account and never see ads again!

May 2015 GNU Toolchain Update

Hi Guys,

  There are several things to report this month:

    * GCC now supports targets configured to use the MUSL C library:   http://www.musl-libc.org/


    * The Compiler has a new warning option: -Wmisleading-indentation
  
      This generates warnings when the indentation of the code does not reflect the block structure.  For example:

       if (some_condition ())
          foo ();
          bar ();
/* Gotcha: this is not guarded by the "if".  */

      The warning is disabled by default.


    * The Compiler also has a new shift warning: -Wshift-negative-value
    
      This generates warnings when left shifting a negative value.  The warning is enabled by -Wextra in C99 and C++11 modes (and newer).  The warning can be suppressed by an appropriate cast.  For example:
    
       val |= ~0 << loaded;       // Generates warning
       val |= (unsigned) ~0 << loaded;    // Does not warn


    * GCC supports a new option: -fno-plt

      When compiling position independent code this tells the compiler not to use PLT for external function calls.  Instead the address is loaded from the GOT and then branched to directly.  This leads to more efficient code by eliminating PLT stubs and exposing GOT load to optimizations.

      Not all architectures support this option, and some other optimization features, such as lazy binding, may disable it.


    * GCC's sanitizer has a new option: -fsanitize=bounds-strict

      This option enables strict instrumentation of array bounds.  Most out of bounds accesses are detected, including flexible array members and flexible array member-like arrays.


    * The AArch64 backend supports a new option to enable a workaround for the ARM Cortex-A53 erratum number 843419.  The workaround itself is implemented in the linker, but it can be enabled via the compiler option:

        -mfix-cortex-a53-843419
    
      Note, specifying -mcpu=cortex-a53 is not enough to enable this option as not all versions of the A53 need the erratum.


    * The AArch64 backend also supports a new core type of "native".  When used as -mcpu=native or -mtune=native it tells the backend to base its core selection on the host system.  If the compiler cannot recognise the processor of the host system then the option does nothing.


    * The Linker now supports the Intel MCU architecture:  https://groups.google.com/forum/#!topic/ia32-abi/cn7TM6J_TIg


    * GDB 7.9.1 has been released!

      GDB 7.9.1 brings the following fixes and enhancements over GDB 7.9:

     + PR build/18033 (C++ style comment used in gdb/iq2000-tdep.c and gdb/compile/compile-*.c)
     + PR build/18298 ("compile" command cannot find compiler if tools configured with triplet instead of quadruplet)
     + PR tui/18311 (Random SEGV when displaying registers in TUI mode)
     + PR python/18299 (exception when registering a global pretty-printer in verbose mode)
     + PR python/18066 (argument "word" seems broken in Command.complete (text, word))
     + PR pascal/17815 (Fix pascal behavior for class fields with testcase)
     + PR python/18285 (ptype expr-with-xmethod causes SEGV)

Cheers
  Nick

April 2015 GNU Toolchain Update

Hi Guys,

  There are several things to report this month:

  * The GCC version 5 branch has been created.  No releases have been made from this branch yet, but when one happens it will be GCC 5.1.  Meanwhile the mainline development sources have been switched to calling themselves GCC version 6.

  * Support has been added for configuring targets that use the Nuxi CloudABI.  More details of this ABI can be found here:  https://github.com/NuxiNL/cloudlibc

  * The linker and assembler now support an option to control how DWARF debug sections are compressed:  --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi]

    Selecting none disables compression.  This is the default behaviour if this option is not used.  Selecting zlib or zlib-gnu compresses the sections and then renames them to start with a .z.  This is the old method of indicating that a debug section has been compressed.  Selecting zlib-gabi compresses the sections, but rather than renaming them they instead have the new SHF_COMPRESSED bit set in their ELF section header.

    The other binutils tools have been updated to recognise and handle this SHF_COMPRESSED bit.  More information on the new bit can be found here: https://groups.google.com/forum/#!msg/generic-abi/dBOS1H47Q64/PaJvELtaJrsJ

    In another, related change, the binutils will no longer compress a debug section if doing so would actually make it bigger.

    Also the zlib compression/decompression library sources have now been brought in to the binutils git repository and are now a standard part of a binutils release.

    * The linker has a new command line option:  --warn-orphan
      This option tells the linker to generate a warning message whenever it has to guess at the placement of a section in the output file.  This happens when the linker script in use does not specify where the section should go.

    * The compiler has a new option: -fsanitize-sections=sec1,sec2,...
      This tells the address sanitizer to add protection to global variables defined in the named section(s).  By default any globals in sections with user defined names are not sanitized as the compiler does not know what is going to happen to them.  In particular variables in such sections sometimes end up being merged into an array of values, where the presence of address sanitization markers would break the array.

   * The AVR port of the compiler has a new command line option: -nodevicelib
     This tells the compiler not to link against AVR-LibC's device specific library libdev.a.

  * The RX port of GCC has a new command line option to disable the use of RX string instructions (SMOVF, SUNTIL, etc).  This matters because it is unsafe to use these instructions if the program might access the I/O portion of the address space.

  * The RL78 port of GCC now has support the multiply and divide instructions provided by the G14 cpu, and the divide hardware peripheral provided by the G13 core.

  * GDB now honours the content of the file /proc/PID/coredump_filter on GNU/Linux systems.  This file can be used to specify the types of memory mappings that will be include in a corefile.  For more information, please refer to the manual page of "core(5)".  GDB also has a new command: "set use-coredump-filter on|off".  It allows to set whether GDB will read the content of the /proc/PID/coredump_filter file when generating a corefile.

  * GDB's "info os cpus" command on GNU/Linux can now display information on the cpus/cores on the system.

  * GDB has two new commands: "set serial parity odd|even|none" and "show serial parity".  These allows to set or show parity for the remote serial I/O.

Cheers
  Nick

GNU Toolchain Update, March 2015

Hi Guys,

  There are several things to report this month:

  * GDB 7.9 has been released: http://www.gnu.org/software/gdb/

    GDB 7.9 brings new targets, features and improvements, some of which have been reported here already.  The full list is available on the website, but here are a few that I think you might find interesting:

      * Compilation and injection of source code into the inferior (requires GCC 5.0 or higher built with libcc1.so).

      * Hardware watchpoint support on x86 GNU Hurd.

      * New target: MIPS SDE


  * The 2015 GNU Tools Cauldron will be taking place in Prague this year:
  
       http://gcc.gnu.org/wiki/cauldron2015


  * The NEWLIB and CYGWIN projects are now using a joint GIT based repository:

     Read-only:   git clone git://sourceware.org/git/newlib-cygwin.git
     Read/Write:  git clone sourceware.org:/git/newlib-cygwin.git


   * The x86 targets now support pointer bounds checking via the use of the MPX library.  This library uses hardware available on forthcoming Intel processors (and current Intel simulators) to perform the checking, which makes it much faster than software only solutions:

       http://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler

Cheers
  Nick

GNU Toolchain Update, February 2015

Hi Guys,

  There are only a new things to report this month:

  * The GDB code injection project has reached a milestone of being able to compile and insert C code into an execute.  Phase two of the project has just started which aims to be able to compile and insert C++ code.  For more details see:  https://sourceware.org/gdb/wiki/GCCCompileAndExecute#preview

  * The Binutils now have support for the FTDI FT32 architecture.

  * GCC's sanitizer supports a new option: -fsanitize=vptr

    This option enables instrumentation of C++ member function calls, member accesses and some conversions between pointers to base and derived classes, to verify that the referenced object has the correct dynamic type.

   * A new option has been added to disable part of GCC's dead store elimination pass:  -fno-lifetime-dse

     Normally, in C++ the value of an object is only affected by changes within its lifetime, ie from construction to desctruction.  The DSE pass takes advantage of this restriction to eliminate any uses of the value of an object after it has been destroyed.  But some, badly written, code may need to use the value beyond the object's lifetime, and this option will allow that to happen.

Cheers
  Nick

January 2015 GNU Toolchain Update

Hi Guys,

  There have been three toolchain component releases this month:

  * GDB 7.8.2 has been released.

    This is mainly a bug-fix release.  A branch for GDB 7.9 has been created, so a new major release can be expected soon.


  * BINUTILS 2.25 has been released.

    Important changes in this release include:

    * The strings program now defaults to displaying text from any part of the executable, not just its data sections.  This means that, by default, strings does not need to use the BFD library to scan the binary, and so it is not exposed to bug that might be present in that library.  The old behaviour - of only showing strings from inside non-code sections, can be enabled via the --data command line option.

      The strings program also now has a --include-all-whitespace command line option, so that newlines carriage returns are also considered to be part of a string.

    * The objcopy program gains a --dump-section <name>=<file> command line option to place a raw copy of the contents of the specified section into the specified file.

    * Support has been added for the Andes NDS32 and AVR Tiny microcontrollers.  In addition the openrisc and or32 targets have been replaced by the or1k target.

     * The ARM port to gas can now accept the assembler output from the CodeComposer Studio tool.

     * PE binaries now once again contain real timestamps by default, although this can be disabled via the --no-insert-timestamps.  Timestamps are needed because some other (non-GNU) tools cannot handle PE binaries without them.

     * COFF based targets now have support for the --build-id command line option to add a unique signature to a binary.


  * NEWLIB 2.2.0 has been released.

    Changes in this version include:
  
    * Multiple functional/performance enhancements for arm/aarch64.

    * New nano formatted I/O support for small memory targets.

    * Adds a reentrant safe sorting routine: qsort_r.

    * Additional long double math routines.

    * Adds the itoa/utoa/ltoa integer to string conversion routines.
  
    * Restructuring of gmtime/localtime so tz functions are only linked by localtime.

    * Unlocked I/O functions.

  
  In the development versions of the tools there has also been a lot  of changes too:

  * The --compress-debug-sections is now turned on for Linux/x86 by default in the binutils.

  * GCC has a new command line option: -fopenacc

    This enables handling of the OpenACC #pragma acc.  This makes the compiler generate accelerated code according to the OpenACC Application Programming Interface v2.0 (http://www.openacc.org/).  This is an experimental feature, incomplete, and subject to change in future versions of GCC. See https://gcc.gnu.org/wiki/OpenACC for more information.

  * The GCC command line option -Warray-bounds can now take a numeric argument, as in -Warray-bounds=[1,2].  The default value is 1, which matches the old behaviour.  If a value of 2 is used then warnings will also be generated for out of bounds access for arrays at the end of a struct and for arrays accessed through pointers.  This warning level may give a larger number of false positives which is why it is not enabled by default.
 
  * The GCC stack protection feature (-fstack-protector) can now be enabled only for specifically attributed functions via the use of the -fstack-protector-explicit command line option and the stack_protect function attribute.

  * G++ has a new command line option: -fsized-deallocation

    This is part of the C++14 specification.  It enables the built-in declaration of the global functions:

     void operator delete (void *, std::size_t) noexcept;
      void operator delete[] (void *, std::size_t) noexcept;


    which provides for faster deallocation of fixed size objects.  The new command line option: -Wsized-deallocation can be enabled to warn about places that might want to make use of this feature.

  * G++ also has a new warning option: -Wc++14-compat

    This warns about C++ constructs whose meaning differs between ISO C++ 2011 and ISO C++ 2014.  This warning is enabled by -Wall.

  * The ARM port now supports the XGene 1 core.

Cheers
  Nick

December 2014 GNU Toolchain Update

Hi Guys,

  There are only a few things to report for this month:

* GDB now supports the compilation and injection of source code into the inferior.  GDB will use GCC 5.0 or higher built with libcc1.so to compile the source code to object code, and if successful, inject and execute that code within the current context of the inferior.  Currently the C language is supported.  The commands used to interface with this new feature are:

    compile code [-raw|-r] [--] [source code]
     compile file [-raw|-r] filename


 * The binutils now supports Controls and Data Services VISIUMcore processor.

 * GCC's LTO optimizer can now perform aggressive devirtualizations, finding more places where virtual functions can be replaced with real ones.  Controlled by the new command line option: -fdevirtualize-at-ltrans, this feature is disabled by default because it significantly increases the size of object files.
 
  * The PowerPC port supports three new options to control the use of the vector/scalar floating point register set that was add in version 2.06 and 2.07 of the PowerPC ISA.

    -mupper-regs-df

        Generates code that uses the scalar double precision instructions.

    -mupper-regs-sf

        Generates code that uses the scalar single precision instructions.

    -mno-upper-regs

        Do not generate code that uses any of the registers.

Cheers
  Nick

November 2014 GNU Toolchain Update

Hi Guys,

  There is lots to report this month...

  * GCC now has experimental support for offloading.
    Offloading is the ability for the compiler to separate out portions of the program to be compiled by a second, different compiler.  Normally this second compiler would target a different architecture which can be accessed from the primary architecture.  Like a CPU offloading work onto a GPU in a graphics card.

    Currently only the Intel MIC architecture is supported.  See here for more information:  https://gcc.gnu.org/wiki/Offloading
  

  * The strings program from the binutils package now defaults to using the --all option to scan the entire file.  Before the default used to be --data, which would only scan data sections in the file.

    The reason for the change is that the --data option uses the BFD library to locate data sections within the binary, which exposes the strings program to any flaws in that library.  Since security researchers often use strings to examine potential viruses this meant that these flaws could affect them.


  * GCC now has built-in pointer boundary checking: -fcheck-pointer-bounds
    This adds pointer bounds checking instrumentation to the generated code.  Warning messages about memmory access errors may also be produced at compile time unless disabled by -Wno-chkp.  Additional options can be used to disable bounds checking in certain situations, eg on reads or writes etc.  It is also possible to use attributes to disable bounds checking on specific functions and structures.


  * GCC now has some built-in functions to perform integer arithmetic with overflow checking.  For example:

       bool __builtin_sadd_overflow (int a, int b, int *res)
        bool __builtin_ssubl_overflow (long int a, long int b, long int *res)
       bool __builtin_umul_overflow (unsigned int a, unsigned int b, unsigned int *res)

  
    These built-in functions promote the first two operands into infinite precision signed type and perform addition (or subtraction or multiplication) on those promoted operands.  The result is then cast to the type the third pointer argument points to and stored there.  If the stored result is equal to the infinite precision result, the built-in functions return false, otherwise they return true.


  * GCC now has experimental support for NVidia's NVPTX architecure. Currently only compilation is supported.  Assembly and linking are not yet available.


  * Two new options to disable warnings have been introduced to GCC:

     -Wno-shift-count-negative
    Stops warnings about shifts by a negative amount.
  
      -Wno-shift-count-overflow
    Stops warnings when the shift amount being more than the width of the type being shifted.


  * A new optimization has been added to GCC: -flra-remat   
    This enables "rematerialization" during the register assignment pass (lra).  What happens is that instead of storing a value in a register the optimizations chooses to recaclulate the value when needed.  Thus freeing up the register for other purposes.  Obviously this is only done when the optimization calculates that it will be worth it.  This new optimization is enabled automatically at -O2, -O3 and -Os.


  * A new profling option has been added to GCC: -fauto-profile[=<file>]
    This enables sampling based feedback directed optimizations, and optimizations generally profitable only with profile feedback available.  If <file> is specified, GCC looks in <file> to find the profile feedback data files.

    In order to collect the profile data you need to have:

    1. A linux system with linux perf support.

    2. (optional) An Intel processor with last branch record (LBR) support. This is to guarantee accurate instruction level profile, which is important for AutoFDO performance.

    To collect the profile, first use linux perf to collect raw profile.  (See https://perf.wiki.kernel.org/).  For example:
  
     perf record -e br_inst_retired:near_taken -b -o perf.data -- <your_program>

    Then use create_gcov tool, which takes raw profile and unstripped binary to generate AutoFDO profile that can be used by GCC.  (See https://github.com/google/autofdo).

      create_gcov --binary=your_program.unstripped --profile=perf.data --gcov=profile.afdo


  * New optimization has been added to GCC: -fschedule-fusion
    This performs a target dependent pass over the instruction stream to schedule instructions of same type together because target machine can execute them more efficiently if they are adjacent to each other in the instruction flow.

    Enabled by default at levels -O2, -O3, -Os.


  * The ARM backend to GCC now supports a new option: -masm-syntax-unified
    This tells the backend that it should assume that any inline assembler is using unified asm syntax.  This matters for targets which only support Thumb1 as be defaul they assume that divided syntax is being used.

  
  * The MIPS backend to GCC now supports two additional variants of the o32 ABI.  These are intended to enable a transition from 32-bit to 64-bit registers.  These are FPXX (-mfpxx) and FP64A  (-mfp64 -mno-odd-spreg).
  
    The FPXX extension mandates that all code must execute correctly when run using 32-bit or 64-bit registers.  The code can be interlinked with either FP32 or FP64, but not both.

    The FP64A extension is similar to the FP64 extension but forbids the use of odd-numbered single-precision registers.  This can be used in conjunction with the FRE mode of FPUs in MIPS32R5 processors and allows both FP32 and FP64A code to interlink and run in the same process without changing FPU modes.

  
  * The linker supports a new command line option: --fix-cortex-a53-835769
    This enables a link-time workaround for erratum 835769 present on certain early revisions of Cortex-A53 processors.  The workaround is disabled by default.

  
  * The linker supports a new command line option: --print-sysroot

    This will display the sysroot that was configured into the linker when it was built.  If the linker was configured without sysroot support nothing will be printed.


Cheers
  Nick

October 2014 GNU Toolchain Update

  In this month's news we have:
  
  * GDB now supports hardware watchpoints on x86 GNU Hurd.

  * GDB has a new command:

       queue-signal <signal-name-or-number>

    This queues a signal to be delivered to the thread when it is resumed.

  * GCC supports a new variable attribute:

     __attribute__((io (<addr>)))

    This specifies that the variable is used to address a memory mapped peripheral.  If an address is specified the variable is always assigned to that address.  For example:

     volatile int porta __attribute__((io (0x22)));

    Even without an address assigned to it, a variable with this attribute will always be accessed using in/out instructions if supported by the target hardware.

    There are two variations on this attribute:

      __attribute__((io_low <addr>)
      __attribute__((address <addr>)


    These are like the "io" attribute except that they additionally inform the compiler that the variable falls within the lower half of the I/O area (for "io_low") or outside the I/O area (for "address"), which may make a difference to the instructions generated to access the variable.

  
  * GCC's sanitizer has a couple of new options:

     -fsanitize=object-size

    This option enables instrumentation of memory references using the __builtin_object_size function.  Various out of bounds pointer accesses can be detected in this way.

     -fsanitize=bool

    This option enables instrumentation of loads from bool.  If a value other than 0/1 is loaded, a run-time error is issued.

      -fsanitize=enum

    This option enables instrumentation of loads from an enum type.  If a value outside the range of values for the enum type is loaded, a run-time error is issued.


  * The inter-procedural analysis pass now supports a new optimization:
  
     -fipa-icf
      -fipa-icf-functions
      -fipa-icf-variables

    
    This performs identical code folding for functions and/or read-only variables.  The optimization reduces code size, but it may disturb unwind stacks by replacing a function by an equivalent one with a different name.

    The optimization works more effectively with link time optimization enabled.  The optimization is similar to the ICF optimization performed by the GOLD linker, but it works at a different level and it may find equivalences that GOLD misses.


  * The AArch64 target now supports a workaround for ARM Cortex-A53 erratum number 835769:

      -mfix-cortex-a53-835769

    When enabled it inserts a NOP instruction between memory instructions and 64-bit integer multiply-accumulate instructions.

Cheers
  Nick

September 2014 GNU Toolchain Update

Hi Guys,

  In this month's news we have:
  
  * The GDB project is removing support for the following platforms:
    - MIPS IRIX (mips*-sgi-irix5*, mips*-sgi-irix6*)
    - Alpha Tru64 (alpha*-*-osf*)

    This only affect code maintained by GDB project (not binutils or GCC).  Also, support for any other target on MIPS (including embedded ones) will be maintained as is.

  * GCC now supports the MIPS R6 and ARM CORTEX-A17 architecture variants.

  * The is a new gcc attribute called no_reorder.  This tells GCC not to change the order of the marked functions and variables, relative to each other.  (Unmarked functions and variables can still be reordered).  This attribute is similar to the -fno-topleve-reorder option, except that it only applies to the marked symbols.

  * There is a new GCC command line optionn: -freport-bug

    This tells GCC to collect and dump debug information into temporary file if an internal compiler error occurs.  This information can be helpful to whomever has to fix the bug.

Cheers
  Nick

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:

     -Wbool-compare

    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) { ....


     -Wc90-c99-compat

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

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

     -Wno-designated-init

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

      -Wmemset-transposed-args

    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.
    
      -Wsuggest-final-types

    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.

      -Wsuggest-final-methods

    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:
  
      designated_init
    
    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:

    -fsanitize=kernel-address

     Which enables AddressSanitizer for Linux kernel.  See
     http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel
     for more details.

     -fsanitize=alignment

     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:

      -foptimize-strlen

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

Cheers
  Nick