Join the community today
Register Now

CentOS 7.x Beta Branch Testing GCC 7.1/7.2 & Clang 4.0.1 SCL Yum Packages

Discussion in 'Beta release code' started by eva2000, Sep 9, 2017.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    55,223
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    2:40 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Been testing Centmin Mod 123.09beta01 compatibility with Clang 4 and Clang 5 via source compiled versions. Centmin Mod 123.09beta01 already supports Nginx and PHP compiles via GCC 4.4-4.8, 5.3, 6.2 and Clang 3.4. And was waiting on GCC 7 for testing via devtoolset-7.

    But source compiles can take hours to compile i.e. E3-1270v1 @3.5-3.8Ghz took ~67 minutes to compile both Clang 4 + 5 and i7 4790K @4.0-4.4Ghz took ~47 minutes for both. However, it looks like CentOS/RHEL SCL collections are working on building SCL for llvm-toolset YUM repo for Clang/LLVM 4.0.1 final release as well as devtoolset-7's GCC 7.1 which llvm-toolset requires for Clang 4.0.1. Great news as it means I can start working on Nginx and PHP-FPM compiles against both Clang 4.0.1 and GCC 7.1 provided via respective llvm-toolset SCL and devtoolset-7 packages :D


    More info at Summer 2017 GNU Toolchain Update

    On test server running Centmin Mod 123.09beta01 + CentOS 7.3 64bit.

    GCC 7.1
    Code (Text):
    /opt/rh/devtoolset-7/root/usr/bin/gcc --version
    gcc (GCC) 7.1.1 20170526 (Red Hat 7.1.1-2)
    Copyright (C) 2017 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    

    Clang 4.0.1 built against devtoolset-7's GCC 7.1
    Code (Text):
    /opt/rh/llvm-toolset-7/root/usr/bin/clang -v
    clang version 4.0.1 (tags/RELEASE_401/final)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/rh/llvm-toolset-7/root/usr/bin
    Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Found candidate GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Found candidate GCC installation: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    yum history info 44
    Loaded plugins: fastestmirror, priorities, versionlock
    Transaction ID : 44
    Begin time     : Sat Sep  9 08:07:52 2017
    Begin rpmdb    : 622:72f5791d1ace56ec1c7fc0585b53eed17c87a710
    End time       :            08:08:12 2017 (20 seconds)
    End rpmdb      : 634:04f6af77654d07b5033a7378c47e53625bf7cce2
    User           : root <root>
    Return-Code    : Success
    Command Line   : localinstall devtoolset-7-binutils-2.28-7.el7.x86_64.rpm devtoolset-7-libstdc++-devel-7.1.1-2.1.el7.x86_64.rpm devtoolset-7-gcc-7.1.1-2.1.el7.x86_64.rpm devtoolset-7-gcc-c++-7.1.1-2.1.el7.x86_64.rpm llvm-toolset-7-clang-4.0.1-1.el7.x86_64.rpm llvm-toolset-7-llvm-libs-4.0.1-3.el7.x86_64.rpm llvm-toolset-7-llvm-static-4.0.1-3.el7.x86_64.rpm llvm-toolset-7-compiler-rt-4.0.1-1.el7.x86_64.rpm llvm-toolset-7-libomp-4.0.1-1.el7.x86_64.rpm llvm-toolset-7-clang-libs-4.0.1-1.el7.x86_64.rpm
    Transaction performed with:
       Installed     rpm-4.11.3-21.el7.x86_64                      @base
       Installed     yum-3.4.3-150.el7.centos.noarch               @base
       Installed     yum-metadata-parser-1.1.4-10.el7.x86_64       installed
       Installed     yum-plugin-fastestmirror-1.1.31-40.el7.noarch @base
       Installed     yum-plugin-versionlock-1.1.31-40.el7.noarch   @base
    Packages Altered:
       Install     devtoolset-7-binutils-2.28-7.el7.x86_64           @/devtoolset-7-binutils-2.28-7.el7.x86_64
       Install     devtoolset-7-gcc-7.1.1-2.1.el7.x86_64             @/devtoolset-7-gcc-7.1.1-2.1.el7.x86_64
       Install     devtoolset-7-gcc-c++-7.1.1-2.1.el7.x86_64         @/devtoolset-7-gcc-c++-7.1.1-2.1.el7.x86_64
       Install     devtoolset-7-libstdc++-devel-7.1.1-2.1.el7.x86_64 @/devtoolset-7-libstdc++-devel-7.1.1-2.1.el7.x86_64
       Dep-Install devtoolset-7-runtime-7.0-5.el7.x86_64             @centos-sclo-rh
       Install     llvm-toolset-7-clang-4.0.1-1.el7.x86_64           @/llvm-toolset-7-clang-4.0.1-1.el7.x86_64
       Install     llvm-toolset-7-clang-libs-4.0.1-1.el7.x86_64      @/llvm-toolset-7-clang-libs-4.0.1-1.el7.x86_64
       Install     llvm-toolset-7-compiler-rt-4.0.1-1.el7.x86_64     @/llvm-toolset-7-compiler-rt-4.0.1-1.el7.x86_64
       Install     llvm-toolset-7-libomp-4.0.1-1.el7.x86_64          @/llvm-toolset-7-libomp-4.0.1-1.el7.x86_64
       Install     llvm-toolset-7-llvm-libs-4.0.1-3.el7.x86_64       @/llvm-toolset-7-llvm-libs-4.0.1-3.el7.x86_64
       Install     llvm-toolset-7-llvm-static-4.0.1-3.el7.x86_64     @/llvm-toolset-7-llvm-static-4.0.1-3.el7.x86_64
       Dep-Install llvm-toolset-7-runtime-4.0.1-1.el7.x86_64         @centos-sclo-rh
    Scriptlet output:
       1 libsemanage.semanage_read_policydb: Could not open kernel policy /etc/selinux/targeted/active/policy.kern for reading. (No such file or directory).
       2 OSError: No such file or directory
    history info
    


     
  2. eva2000

    eva2000 Administrator Staff Member

    55,223
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    2:40 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+

    Nginx Compiled Clang 4.0.1



    Testing 123.09beta01's Nginx 1.13.5 compile against llvm-toolset-7's Clang 4.0.1

    Compared with source installed Clang 5.0 final release tests here.
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,223
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    2:40 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+

    Nginx Compiled GCC 7.1



    Testing 123.09beta01's Nginx 1.13.5 compile against devtoolset-7's GCC 7.1.1 however seems it failed at set-misc-nginx-module compile section.
    Code (Text):
    nginx configure options (alternate ordering):
    ./configure --with-ld-opt="-ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib" --with-cc-opt="-m64 -march=native -g -O3 -fstack-protector-strong -flto -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-deprecated-declarations -gsplit-dwarf" --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-compat --with-http_stub_status_module --with-http_secure_link_module --with-libatomic --with-http_gzip_static_module --add-dynamic-module=../ngx_brotli --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-stream_geoip_module --with-stream_realip_module --with-stream_ssl_preread_module --with-threads --with-stream=dynamic --with-stream_ssl_module --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.4.0 --add-module=../ngx_cache_purge-2.3 --add-module=../ngx_devel_kit-0.3.0 --add-dynamic-module=../set-misc-nginx-module-0.31 --add-dynamic-module=../echo-nginx-module-0.61 --add-dynamic-module=../redis2-nginx-module-0.14 --add-module=../ngx_http_redis-0.3.7 --add-dynamic-module=../memc-nginx-module-0.18 --add-dynamic-module=../srcache-nginx-module-0.31 --add-dynamic-module=../headers-more-nginx-module-0.32 --with-pcre=../pcre-8.41 --with-pcre-jit --with-zlib=../zlib-1.2.11 --with-http_ssl_module --with-http_v2_module --with-openssl=../openssl-1.1.0f --with-openssl-opt='enable-ec_nistp_64_gcc_128'
    checking for OS
     + Linux 2.6.32-042stab120.19 x86_64
    checking for C compiler ... found
     + using GNU C compiler
     + gcc version: 7.1.1 20170526 (Red Hat 7.1.1-2) (GCC)
    checking for gcc -pipe switch ... found
    checking for --with-ld-opt="-ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib" ... found
    checking for -Wl,-E switch ... found
    checking for gcc builtin atomic operations ... found
    checking for C99 variadic macros ... found
    checking for gcc variadic macros ... found
    checking for gcc builtin 64 bit byteswap ... found
    checking for unistd.h ... found
    checking for inttypes.h ... found
    checking for limits.h ... found
    checking for sys/filio.h ... not found
    checking for sys/param.h ... found
    checking for sys/mount.h ... found
    checking for sys/statvfs.h ... found
    checking for crypt.h ... found
    checking for Linux specific features
    checking for epoll ... found
    checking for EPOLLRDHUP ... found
    checking for EPOLLEXCLUSIVE ... not found
    checking for O_PATH ... found
    checking for sendfile() ... found
    checking for sendfile64() ... found
    checking for sys/prctl.h ... found
    checking for prctl(PR_SET_DUMPABLE) ... found
    checking for crypt_r() ... found
    checking for sys/vfs.h ... found
    checking for nobody group ... found
    checking for poll() ... found
    checking for /dev/poll ... not found
    checking for kqueue ... not found
    checking for crypt() ... not found
    checking for crypt() in libcrypt ... found
    checking for F_READAHEAD ... not found
    checking for posix_fadvise() ... found
    checking for O_DIRECT ... found
    checking for F_NOCACHE ... not found
    checking for directio() ... not found
    checking for statfs() ... found
    checking for statvfs() ... found
    checking for dlopen() ... not found
    checking for dlopen() in libdl ... found
    checking for sched_yield() ... found
    checking for sched_setaffinity() ... found
    checking for SO_SETFIB ... not found
    checking for SO_REUSEPORT ... found
    checking for SO_ACCEPTFILTER ... not found
    checking for SO_BINDANY ... not found
    checking for IP_BIND_ADDRESS_NO_PORT ... not found
    checking for IP_TRANSPARENT ... found
    checking for IP_BINDANY ... not found
    checking for IP_RECVDSTADDR ... not found
    checking for IP_SENDSRCADDR ... not found
    checking for IP_PKTINFO ... found
    checking for IPV6_RECVPKTINFO ... found
    checking for TCP_DEFER_ACCEPT ... found
    checking for TCP_KEEPIDLE ... found
    checking for TCP_FASTOPEN ... found
    checking for TCP_INFO ... found
    checking for accept4() ... found
    checking for eventfd() ... found
    checking for int size ... 4 bytes
    checking for long size ... 8 bytes
    checking for long long size ... 8 bytes
    checking for void * size ... 8 bytes
    checking for uint32_t ... found
    checking for uint64_t ... found
    checking for sig_atomic_t ... found
    checking for sig_atomic_t size ... 4 bytes
    checking for socklen_t ... found
    checking for in_addr_t ... found
    checking for in_port_t ... found
    checking for rlim_t ... found
    checking for uintptr_t ... uintptr_t found
    checking for system byte ordering ... little endian
    checking for size_t size ... 8 bytes
    checking for off_t size ... 8 bytes
    checking for time_t size ... 8 bytes
    checking for AF_INET6 ... found
    checking for setproctitle() ... not found
    checking for pread() ... found
    checking for pwrite() ... found
    checking for pwritev() ... found
    checking for sys_nerr ... found
    checking for localtime_r() ... found
    checking for posix_memalign() ... found
    checking for memalign() ... found
    checking for mmap(MAP_ANON|MAP_SHARED) ... found
    checking for mmap("/dev/zero", MAP_SHARED) ... found
    checking for System V shared memory ... found
    checking for POSIX semaphores ... not found
    checking for POSIX semaphores in libpthread ... found
    checking for struct msghdr.msg_control ... found
    checking for ioctl(FIONBIO) ... found
    checking for struct tm.tm_gmtoff ... found
    checking for struct dirent.d_namlen ... not found
    checking for struct dirent.d_type ... found
    checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
    checking for openat(), fstatat() ... found
    checking for getaddrinfo() ... found
    configuring additional modules
    adding module in ../ngx_cache_purge-2.3
     + ngx_http_cache_purge_module was configured
    adding module in ../ngx_devel_kit-0.3.0
     + ngx_devel_kit was configured
    adding module in ../ngx_http_redis-0.3.7
     + ngx_http_redis_module was configured
    configuring additional dynamic modules
    adding module in ../ngx_brotli
     + ngx_brotli was configured
    adding module in ../ngx-fancyindex-0.4.0
     + ngx_http_fancyindex_module was configured
    adding module in ../set-misc-nginx-module-0.31
    found ngx_devel_kit for ngx_set_misc; looks good.
     + ngx_http_set_misc_module was configured
    adding module in ../echo-nginx-module-0.61
     + ngx_http_echo_module was configured
    adding module in ../redis2-nginx-module-0.14
     + ngx_http_redis2_module was configured
    adding module in ../memc-nginx-module-0.18
     + ngx_http_memc_module was configured
    adding module in ../srcache-nginx-module-0.31
     + ngx_http_srcache_filter_module was configured
    adding module in ../headers-more-nginx-module-0.32
     + ngx_http_headers_more_filter_module was configured
    checking for GD library ... found
    checking for GD WebP support ... not found
    checking for GeoIP library ... found
    checking for GeoIP IPv6 support ... found
    checking for atomic_ops library ... found
    creating objs/Makefile
    
    Configuration summary
      + using threads
      + using PCRE library: ../pcre-8.41
      + using OpenSSL library: ../openssl-1.1.0f
      + using zlib library: ../zlib-1.2.11
      + using system libatomic_ops library
    
      nginx path prefix: "/usr/local/nginx"
      nginx binary file: "/usr/local/sbin/nginx"
      nginx modules path: "/usr/local/nginx/modules"
      nginx configuration prefix: "/usr/local/nginx/conf"
      nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
      nginx pid file: "/usr/local/nginx/logs/nginx.pid"
      nginx error log file: "/usr/local/nginx/logs/error.log"
      nginx http access log file: "/usr/local/nginx/logs/access.log"
      nginx http client request body temporary files: "client_body_temp"
      nginx http proxy temporary files: "proxy_temp"
      nginx http fastcgi temporary files: "fastcgi_temp"
      nginx http uwsgi temporary files: "uwsgi_temp"
      nginx http scgi temporary files: "scgi_temp"
    
    Sat Sep  9 08:50:47 UTC 2017
    Success: Nginx configure ok
    

    errors
    Code (Text):
    ccache gcc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -m64 -march=native -g -O3 -fstack-protector-strong -flto -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-deprecated-declarations -gsplit-dwarf -Wno-deprecated-declarations -DNDK_SET_VAR -DNDK_UPSTREAM_LIST -I src/core -I src/event -I src/event/modules -I src/os/unix -I ../ngx_devel_kit-0.3.0/objs -I objs/addon/ndk -I ../ngx_brotli/deps/brotli/include -I ../pcre-8.41 -I ../openssl-1.1.0f/.openssl/include -I ../zlib-1.2.11 -I objs -I src/http -I src/http/modules -I src/http/v2 -I ../ngx_devel_kit-0.3.0/src -I ../ngx_devel_kit-0.3.0/src -I ../ngx_devel_kit-0.3.0/objs -I objs/addon/ndk -I src/stream \
            -o objs/addon/src/ngx_http_set_misc_module.o \
            ../set-misc-nginx-module-0.31/src/ngx_http_set_misc_module.c
    ../set-misc-nginx-module-0.31/src/ngx_http_set_quote_sql.c: In function 'ngx_http_pg_utf_islegal':
    ../set-misc-nginx-module-0.31/src/ngx_http_set_quote_sql.c:98:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
                     if (a < 0x80 || a > 0xBF)
                        ^
    ../set-misc-nginx-module-0.31/src/ngx_http_set_quote_sql.c:100:13: note: here
                 case 3:
                 ^~~~
    ../set-misc-nginx-module-0.31/src/ngx_http_set_quote_sql.c:102:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
                     if (a < 0x80 || a > 0xBF)
                        ^
    ../set-misc-nginx-module-0.31/src/ngx_http_set_quote_sql.c:104:13: note: here
                 case 2:
                 ^~~~
    cc1: all warnings being treated as errors
    make[1]: *** [objs/addon/src/ngx_http_set_quote_sql.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory `/svr-setup/nginx-1.13.5'
    make: *** [build] Error 2
    

    related to GCC 7's -Werror=implicit-fallthrough -Wimplicit-fallthrough in GCC 7

    Retested with fixed workaround for GCC 7.1 results in Nginx 1.13.5 compiling successfully :D

     
  4. eva2000

    eva2000 Administrator Staff Member

    55,223
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    2:40 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+

    Compiler Benchmark Reviews



    Just to highlight how the pairing of particular cpu and GCC or Clang compilers can change and improve performance for software (i.e. for Centmin Mod Nginx and PHP-FPM), here's some reviews and benchmarks
    Comparisons
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,223
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    2:40 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+

    GCC 7.2.1 Test



    Testing Centmin Mod 123.09beta01 and Nginx compiled with updated GCC 7.2.1
    Code (Text):
    /opt/rh/devtoolset-7/root/usr/bin/gcc --version
    gcc (GCC) 7.2.1 20170829 (Red Hat 7.2.1-1)
    Copyright (C) 2017 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


    with LibreSSL 2.5.5
    with OpenSSL 1.1.0g
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,223
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    2:40 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. eva2000

    eva2000 Administrator Staff Member

    55,223
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    2:40 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
Thread Status:
Not open for further replies.