1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Amazon Linux 1のGCCとG++を7.2にアップデートする

Last updated at Posted at 2020-04-16

結論

もちろんAmazon Linux 2にOSを入れ替えるのが最良だが、とりあえずはこれでしのげる。

sudo yum install gcc72 gcc72-c++

どうしてそんなことしたの?

Rubyのunicornサーバー(Webサーバー)としてAmazon Linux 1のサーバーを使っていたが、ここにsassc-2.1.0というgemをインストールしようとしてg++が古いためにlibsassのビルドで失敗したため。

...
......
compiling ./libsass/src/ast_sel_unify.cpp
compiling ./libsass/src/extend.cpp
linking shared-object sassc/libsass.so
lto1: fatal error: LTO_tags out of range: Range is 0 to 365, value is 2566
compilation terminated.
lto-wrapper: g++ returned 1 exit status
......
...

g++をアップデートしようとしたが、AmazonLinux1で、下記のコマンドで入手できる最新のg++は4.8.3だった。

sudo yum install gcc gcc-c++

探し方

# 検索
yum search "gcc"


# 結果
57 packages excluded due to repository priority protections
============== N/S matched: gcc================
gcc-c++.noarch : C++ support for GCC
gcc-gnat.noarch : Ada 95 support for GCC
gcc44-c++.x86_64 : C++ support for GCC
gcc44-gnat.x86_64 : Ada 95 support for GCC
gcc44-objc.x86_64 : Objective-C support for GCC
gcc44-objc++.x86_64 : Objective-C++ support for GCC
gcc48-c++.x86_64 : C++ support for GCC
gcc48-gnat.x86_64 : Ada 95 support for GCC
gcc48-plugin-devel.x86_64 : Support for compiling GCC plugins
gcc64-c++.x86_64 : C++ support for GCC
gcc64-gdb-plugin.i686 : GCC plugin for GDB
gcc64-gdb-plugin.x86_64 : GCC plugin for GDB
gcc64-plugin-devel.x86_64 : Support for compiling GCC plugins
gcc72-c++.x86_64 : C++ support for GCC
gcc72-gdb-plugin.x86_64 : GCC plugin for GDB
gcc72-plugin-devel.x86_64 : Support for compiling GCC plugins
libgcc44.i686 : GCC version 4.4 shared support library
libgcc44.x86_64 : GCC version 4.4 shared support library
libgcc48.i686 : GCC version 4.8 shared support library
libgcc48.x86_64 : GCC version 4.8 shared support library
libgcc64.i686 : GCC version 6 shared support library
libgcc64.x86_64 : GCC version 6 shared support library
libgcc72.x86_64 : GCC version 7 shared support library
libgccjit.i686 : Library for embedding GCC inside programs and libraries
libgccjit.x86_64 : Library for embedding GCC inside programs and libraries
libgccjit-devel.x86_64 : Support for embedding GCC inside programs and libraries
gcc.noarch : Various compilers (C, C++, Objective-C, ...)
gcc-gfortran.noarch : Fortran support
gcc44.x86_64 : Various compilers (C, C++, Objective-C, ...)
gcc44-gfortran.x86_64 : Fortran support
gcc48.x86_64 : Various compilers (C, C++, Objective-C, Java, ...)
gcc48-gfortran.x86_64 : Fortran support
gcc64.x86_64 : Various compilers (C, C++, Objective-C, Java, ...)
gcc64-gfortran.x86_64 : Fortran support
gcc72.x86_64 : Various compilers (C, C++, Objective-C, Java, ...)
libgomp.i686 : GCC OpenMP v3.0 shared support library
libgomp.x86_64 : GCC OpenMP v4.5 shared support library
libmudflap.i686 : GCC mudflap shared support library
libmudflap.x86_64 : GCC mudflap shared support library
libmudflap44-devel.x86_64 : GCC mudflap support
libquadmath.i686 : GCC __float128 shared support library
libquadmath.x86_64 : GCC __float128 shared support library

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?