Updating the Compiler?

Similar documents
SUSE Linux Enterprise Server 12 Modules

What's New with SUSE Linux Enterprise Server for z Systems

Welcome to SUSE Expert Days 2017 Service Delivery with DevOps

Nios II Embedded Design Suite Release Notes

Patching and Updating your VM SUSE Manager. Donald Vosburg, Sales Engineer, SUSE

GCC and LLVM collaboration

CSE 374 Programming Concepts & Tools

System Administration and Network Security

Introduction to Software Defined Infrastructure SUSE Linux Enterprise 15

The Art of Debugging: How to think like a programmer. Melissa Sulprizio GEOS-Chem Support Team

Intel Parallel Studio XE 2015 Composer Edition for Linux* Installation Guide and Release Notes

GDB Tutorial. A Walkthrough with Examples. CMSC Spring Last modified March 22, GDB Tutorial

lld: A Fast, Simple and Portable Linker Rui Ueyama LLVM Developers' Meeting 2017

Exercise Session 6 Computer Architecture and Systems Programming

How to cross compile with LLVM based tools. Peter Smith, Linaro

Embedded Systems Programming

RED HAT DEVELOPER TOOLSET: Build, Run, & Analyze Applications On Multiple Versions of Red Hat Enterprise Linux

Embest IDE Pro for ARM 2005

CS2141 Software Development using C/C++ Debugging

Compiler Options. Linux/x86 Performance Practical,

Reviewing gcc, make, gdb, and Linux Editors 1

Building opensuse with link-time optimizations. Jan Hubička and Martin Liška SUSElabs

Oracle Developer Studio 12.6

Using Intel VTune Amplifier XE and Inspector XE in.net environment

CS354 gdb Tutorial Written by Chris Feilbach

RED HAT DEVELOPER TOOLSET Build, Run, & Analyze Applications On Multiple Versions of Red Hat Enterprise Linux

Rethinking the core OS in 2015

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 11 gdb and Debugging (Thanks to Hal Perkins)

Using a debugger. Segmentation fault? GDB to the rescue!

Porting Linux to x86-64

Rethinking the core OS in 2015

RELEASE NOTES. BeyondStudio for NXP JN-SW Build NXP Semiconductors

RED HAT SOFTWARE COLLECTIONS RED HAT DEVELOPER TOOLSET Fresh Tools for Developers

Introduction to Linux

Trends in Open Source Security. FOSDEM 2013 Florian Weimer Red Hat Product Security Team

Welcome. HRSK Practical on Debugging, Zellescher Weg 12 Willers-Bau A106 Tel

INSTALLING INSTALLING INSTALLING

Intro to Segmentation Fault Handling in Linux. By Khanh Ngo-Duy

Jackson Marusarz Software Technical Consulting Engineer

Introduction. CS 2210 Compiler Design Wonsun Ahn

Static Analysis in C/C++ code with Polyspace

Using the Go Programming Language in Practice

Concurrency, Thread. Dongkun Shin, SKKU

RISC-V. Palmer Dabbelt, SiFive COPYRIGHT 2018 SIFIVE. ALL RIGHTS RESERVED.

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.

INSTALLING INSTALLING INSTALLING

Eclipse Debug Find Current Instruction Pointer

Intel C++ Compiler Professional Edition 11.1 for Linux* In-Depth

Red Hat Developer Toolset 6.1

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

Understanding Undefined Behavior

Intel C++ Compiler Professional Edition 11.0 for Linux* In-Depth

Testing and Debugging C Programming and Software Tools. N.C. State Department of Computer Science

Using the Command Line

NDK OVERVIEW OF THE ANDROID NATIVE DEVELOPMENT KIT

F28HS2 Hardware-Software Interfaces. Lecture 6: ARM Assembly Language 1

ECE/ME/EMA/CS 759 High Performance Computing for Engineering Applications

Lecture 07 Debugging Programs with GDB

Upgrading XL Fortran Compilers

ECS 153 Discussion Section. April 6, 2015

AMD CodeXL 1.3 GA Release Notes

Intel Parallel Studio XE 2015

Dynamic code analysis tools

Red Hat Developer Toolset 2.x 2.0 Release Notes

Download, Install and Setup the Linux Development Workload Create a New Linux Project Configure a Linux Project Configure a Linux CMake Project

SUSE Linux Entreprise Server for ARM

OpenMP 4.0 implementation in GCC. Jakub Jelínek Consulting Engineer, Platform Tools Engineering, Red Hat

Software Development Using Full System Simulation with Freescale QorIQ Communications Processors

AMD gdebugger 6.2 for Linux

Tools of the Trade The C Language Laboration 04. Outline. 1 Tools of the Trade. 2 The C Language. 3 Laboration 04

The Go Programming Language. Frank Roberts

Malware

Real-World Buffer Overflow Protection in User & Kernel Space

Addressing the Increasing Challenges of Debugging on Accelerated HPC Systems. Ed Hinkel Senior Sales Engineer

Pierce Ch. 3, 8, 11, 15. Type Systems

Reproducible Builds. Valerie Young (spectranaut) Linux Conf Australia 2016

Coding Tools. (Lectures on High-performance Computing for Economists VI) Jesús Fernández-Villaverde 1 and Pablo Guerrón 2 March 25, 2018

Implementing the Twelve-Factor App Methodology for Developing Cloud- Native Applications

Short-term Memory for Self-collecting Mutators. Martin Aigner, Andreas Haas, Christoph Kirsch, Ana Sokolova Universität Salzburg

C++ Developer Survey "Lite": C++ and Cloud

Transitioning from uclibc to musl for embedded development. Embedded Linux Conference 2015 Rich Felker, maintainer, musl libc March 24, 2015

Continue: How do I learn C? C Primer Continued (Makefiles, debugging, and more ) Last Time: A Simple(st) C Program 1-hello-world.c!

SoK: Eternal War in Memory

Visual Studio 2008 Load Symbols Manually

SUSE Linux Enterprise 15. #MultimodalOS

PyROOT: Seamless Melting of C++ and Python. Pere MATO, Danilo PIPARO on behalf of the ROOT Team

A program execution is memory safe so long as memory access errors never occur:

Visual Profiler. User Guide

Intel Parallel Studio XE 2017 Composer Edition BETA C++ - Debug Solutions Release Notes

DEBUGGING ON FERMI PREPARING A DEBUGGABLE APPLICATION GDB. GDB on front-end nodes

Integrating Open Source Tools for Developing Embedded Linux Applications

Topic 6: A Quick Intro To C

David R. Mackay, Ph.D. Libraries play an important role in threading software to run faster on Intel multi-core platforms.

Improving Error Checking and Unsafe Optimizations using Software Speculation. Kirk Kelsey and Chen Ding University of Rochester

WHITEPAPER. Embracing Containers & Microservices for future-proof application modernization

Profiling and Debugging OpenCL Applications with ARM Development Tools. October 2014

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

C++ Undefined Behavior What is it, and why should I care?

Programming Studio #9 ECE 190

Application Compatibility Guide

Transcription:

Updating the Compiler? Take Advantage of The New Development Toolchain Andreas Jaeger Product Manager aj@suse.com

Programming Languages C C++ Fortran And Go 2

Why new compiler? Faster applications Support for new CPUs New compiler optimizations Improved compiler optimizations Take advantage of new language features Write better code due to improved diagnostics Easier to spot problems due to improved debugging 3

Toolchain Module for SUSE Linux Enterprise 12 Yearly release Deliver new Compiler and toolchain GCC ( GNU Compiler Collection) development tools via Toolchain Module GCC runtime libraries, binutils, gdb as updates for SLE Core Versions for 2016 update of Toolchain Module for SUSE Linux Enterprise 12: GCC 6.2 with C, C++, Fortran support Binutils 2.26.1 Gdb 7.11.1 Package build compiler (GCC 4.8) stays as default New module is supported (latest version of SW, overlap of 6 months) 4

Package Hub - https://packagehub.suse.com Contains community build software for SUSE Linux Enterprise Including: Google GO compiler and runtime Erlang Glasgow Haskell Compiler ghc R project for statistical computing 5

Compare with SUSE Linux Enterprise 11 Update of toolchain with each Service Pack Deliver GCC new development tool via SDK Deliver GCC runtime libraries, binutils, gdb as part of SLE core No support for newer GCC 6

How to use new tools? Binutils, gdb: No change GCC: Use XXX-6 instead of XXX, for example: gcc-6 g++-6 7

Note: GCC versioning scheme Previously (until GCC 4.9): Major release every year: 4.0, 4.1,... First release: 4.8.0 Minor releases: 4.8.1, 4.8.2 Now: Major release every year: 5, 6, 7 First release: 5.1 Minor release: 5.2, 5.3 8

Advantages of new toolchain 9

Why new compiler? Compiler optimizations Support for CPUs New language features Diagnostics and debugging 10

Diagnostics and debugging Better display of wrong code 11

Diagnostics and debugging Fix-it hints 12

Diagnostics and debugging Suggestions for wrong field names 13

Diagnostics and debugging Check indentation -Wmisleading-indentation (in -Wall) would have avoided CVE-2014-1266: 14

Diagnostics and debugging New warnings -fsanitze=thread UndefinedBehaviorSanitizer (-fsanitize=undefined) enhanced: -fsanitize=bounds-strict: Strict checking of array bounds New warning options: -Wshift-negative-value: Left shifting a negative value. -Wshift-overflow: Left shift overflows (default). -Wtautological-compare: Self-comparison always evaluates to true or false (in -Wall). -Wnull-dereference: Compiler detects paths that trigger erroneous or undefined behavior due to dereferencing a null pointer. -Wduplicated-cond: Duplicated conditions in an if-else-if chain. 15

Compiler optimizations in GCC 6 Value Range propagation Cave-at! Value Range propagation: This pointer of C++ member function is considered non-null This breaks non-conforming code like Chromium, KDevelop, Qt-5. Use -fno-delete-null-pointer-checks To identify wrong code: -fsanitize=undefined 16

Compiler optimizations in GCC 6 Link Time Optimization Robustness fixes C and Fortran compatibility Smaller LTO objects (11 %) Interprocedural Optimization Function cloning more aggressive Improved heuristics Thread improvements: OpenMP 4.5 OpenACC 2.0a 17

Support for newer CPUs X86-64: AVX-512 extensions for Skylake AMD family 17h processors (Zen core) Segment register AArch64: LTO support Processor support: ARM Cortex-A35, ARM Cortex-A53, ARM Cortex-A57, Qualcomm QDF24xx, Samsung Exynos M1 Power: Power9 support Vector support z Systems IBM z13 support 18

New language features GNU C 11 is default (ISO C 11 plus GNU extensions)[since GCC 5] GNU C++ 14 is default (ISO C++ 14 plus GNU extensions) 19

New libstdc++ Libstdc++ contains Dual ABI: New ABI is C++11 conforming Old ABI for compatibility with previous compilers C++11 conforming std::list with O(1) size() function std::string uses small string optimization instead of copy-on-write reference counting SUSE Linux Enterprise Server 12 uses Old ABI by default, since system libraries are compiled using the Old ABI 20

Optimization Tips To optimize for current machine: -march=native To optimize for pool of machines: Use -march=x and select lowest common dominator or don't set it at all Optimization flags: -O2 -O3 -Ofast: includes -O3, -ffast-math, unsafe optimizations Speed optimizations: 1) Use FDO 2) Use FDO+LTO 21

Feedback Driven Optimization Use information about common paths from run-time to optimize the common case, including value profiling Usage: Build binary for profiling: $ gcc -Ofast program.c -o program -fprofile-generate Execute binary and create profile data Recompile binary using profile: $ gcc -Ofast program.c -o program -fprofile-use=program.gcda Note: Profiling collection not thread-safe 22

Link Time Optimization Whole-program optimization instead of single source file optimization Files get compiled into.o: streaming presentation of internal data Optimization happens at link time for the whole program Allows interprocedural analysis across files 23

Link Time Optimization: Usage Build binaries using: $ gcc -Ofast -flto -c file1.c $ gcc -Ofast -flto -c file2.c Link using: $ gcc -flto -o program file1.o file2.o 24

Vectorized Math Routines Vectorizer now can use glibc s math vector routines for vector sine etc. Note: Needs Glibc from SLE 12 SP2, supported on x86-64 only 25

References https://gcc.gnu.org/gcc-6/changes.html https://gcc.gnu.org/gcc-6/porting.html 26

Outlook GCC 7 Note: GCC 7 will come out in Q2 2017 and is under development Further fix-its LTO debugging Experimental C++17 support 27

Why new toolchain? GDB: Understand new debug information by compiler Binutils: Support for new toolchain Support for new CPUs 28

GDB 7.11.1 and Binutils 2.26 GDB: Thread signal handling improved, user gets informed about which thread triggers event More explicit syntax for breakpoints ( break -s main.c -li 3 ) Bug fixes Binutils: Support for compressed DWARF debug format, currently gas, ld IBM z13 support Bug fixes 29

Distributing Self-Compiled Software Software build with new Toolchain Module will run on updated SLE 12 systems Need updates for runtime libraries installed 30

Support Support via the usual channel Our GCC team needs self-contained code to reproduce issues Concentrate on -g/-g0, -O[0123], -ffast-math, -Ofast 31

The Go Programming Language 32

Go Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Created 2007 at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Designed for writing servers. Compiled, statically typed, with garbage collection, memory safety, concurrent features. 33

Why developers use Go? Docker and docker eco-system uses Go as main language. Faster than shell scripts More powerful than C Shines: Netowork and Webserver Stand-alone command line programs and scripts Not so good for: Desktop or GUI based apps System level programming 34

Where does SUSE use Go? Development of Docker Machinery 35

Go 1.7 Release Support now for all our architectures AARCH64, PowerPC64, x86-64, and z Systems. (New: z Systems) New compiler back end. 36

PackageHub Go packages are available on the PackageHub Compiler package is named go Add PackageHub to your system via YaST Also, available for opensuse in devel:languages:go project 37

Installation 38

Modules - Overview Module Name Content (examples) Lifecycle Advanced Systems The configuration management tools cfengine, Continuous Management Module puppet, salt and the new "machinery" tool Integration Container Module Docker and container related functionality such as ECS integration Continuous Integration Legacy Module Sendmail, old IMAP stack, old Java etc. 3 years Public Cloud Module Instance initialization code, command line tools for management Continuous Integration Toolchain Module GCC Yearly delivery Web and Scripting PHP, Python 3 years, 18 months Module overlap 39

Module Software Install 40