Files
chromebrew/packages/libssp.rb
Satadru Pramanik 7e60e42b04 gcc -> 12.1, update mold as per upstream issue fix (#7040)
* gcc -> 12.1, update mold as per upstream issue fix

* Update postinstall logic for gcc12
2022-05-09 09:03:09 -05:00

108 lines
3.4 KiB
Ruby

require 'package'
class Libssp < Package
description 'Libssp is a part of the GCC toolkit.'
homepage 'https://gcc.gnu.org/'
version '12.1'
license 'GPL-3, LGPL-3, libgcc, FDL-1.2'
compatibility 'all'
source_url 'https://gcc.gnu.org/pub/gcc/releases/gcc-12.1.0/gcc-12.1.0.tar.xz'
source_sha256 '62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/libssp/12.1_armv7l/libssp-12.1-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/libssp/12.1_armv7l/libssp-12.1-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/libssp/12.1_i686/libssp-12.1-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/libssp/12.1_x86_64/libssp-12.1-chromeos-x86_64.tar.zst'
})
binary_sha256({
aarch64: '065f8dd669e4caef511f947239c045a2c95a3fecf445deb7d96eda51d3386aa0',
armv7l: '065f8dd669e4caef511f947239c045a2c95a3fecf445deb7d96eda51d3386aa0',
i686: '50e28f45d8f31bedc6b39696135e25e50200bf706ce6d63598ddfc60b5b764cb',
x86_64: '86846d918f1bfb80b414c3e0074aed9316930b924ea3e6e278d35c8d1b160081'
})
depends_on 'ccache' => :build
depends_on 'dejagnu' => :build # for test
depends_on 'glibc' # R
patchelf
@gcc_name = 'libssp'
@gcc_global_opts = '--disable-libmpx \
--disable-install-libiberty \
--disable-libssp \
--disable-multilib \
--disable-werror \
--enable-cet=auto \
--enable-checking=release \
--enable-clocale=gnu \
--enable-default-pie \
--enable-default-ssp \
--enable-gnu-indirect-function \
--enable-gnu-unique-object \
--enable-host-shared \
--enable-lto \
--enable-plugin \
--enable-shared \
--enable-symvers \
--enable-static \
--enable-threads=posix \
--with-gcc-major-version-only \
--with-gmp \
--with-isl \
--with-mpc \
--with-mpfr \
--with-pic \
--with-system-libunwind \
--with-system-zlib'
@cflags = '-fPIC -pipe'
@cxxflags = '-fPIC -pipe'
@languages = 'c,c++,jit,objc,fortran,go'
case ARCH
when 'armv7l', 'aarch64'
@archflags = '--with-arch=armv7-a+fp --with-float=hard --with-fpu=neon --with-tune=cortex-a15'
when 'x86_64'
@archflags = '--with-arch-64=x86-64'
when 'i686'
@archflags = '--with-arch-32=i686'
end
def self.build
# Set ccache sloppiness as per
# https://wiki.archlinux.org/index.php/Ccache#Sloppiness
system 'ccache --set-config=sloppiness=file_macro,locale,time_macros'
# Prefix ccache to path.
@path = "#{CREW_LIB_PREFIX}/ccache/bin:#{CREW_PREFIX}/bin:/usr/bin:/bin"
gcc_version = version.split('-')[0]
Dir.mkdir "#{@gcc_name}-builddir"
Dir.chdir "#{@gcc_name}-builddir" do
system "env NM=gcc-nm AR=gcc-ar RANLIB=gcc-ranlib \
CFLAGS='#{@cflags}' CXXFLAGS='#{@cxxflags}' \
PATH=#{@path} \
../#{@gcc_name}/configure #{CREW_OPTIONS} \
#{@gcc_global_opts} \
--enable-languages=#{@languages} \
--program-suffix=-#{gcc_version} \
#{@archflags}"
system "env PATH=#{@path} \
make"
end
end
def self.check
Dir.chdir "#{@gcc_name}-builddir" do
system 'make check'
end
end
def self.install
Dir.chdir "#{@gcc_name}-builddir" do
system "make DESTDIR=#{CREW_DEST_DIR} install"
end
end
end