Files
chromebrew/packages/libssp.rb
Satadru Pramanik, DO, MPH, MEng e91463ec30 compiler rework (#8391)
* initial llvm16 rework

* update openmp

* start i686 builds

* fix getrealdeps grep with multiple exclusions

* fix crew conflicts handling _build packages, fix getrealdeps handling _build packages

* add more libs to gcc_lib

* update libssp

* add armv7 builds

* add builds

* suggested changes

* update rubocop
2023-06-15 10:22:41 -05:00

110 lines
3.5 KiB
Ruby

require 'package'
require_relative 'gcc_build'
class Libssp < Package
description 'Libssp is a part of the GCC toolkit.'
homepage 'https://gcc.gnu.org/'
version '13.1.0'
license 'GPL-3, LGPL-3, libgcc, FDL-1.2'
# When upgrading gcc_build, be sure to upgrade gcc_lib, gcc_dev, and libssp in tandem.
puts "#{self} version differs from gcc version #{Gcc_build.version}".orange if version.to_s.gsub(/-.*/, '') != Gcc_build.version.to_s
compatibility 'all'
source_url 'https://github.com/gcc-mirror/gcc.git'
git_hashtag "releases/gcc-#{version}"
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/libssp/13.1.0_armv7l/libssp-13.1.0-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/libssp/13.1.0_armv7l/libssp-13.1.0-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/libssp/13.1.0_i686/libssp-13.1.0-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/libssp/13.1.0_x86_64/libssp-13.1.0-chromeos-x86_64.tar.zst'
})
binary_sha256({
aarch64: '1bbf7715c57c0ea0fd357d5828c1f57b913d824365aafba078536b4ed004b802',
armv7l: '1bbf7715c57c0ea0fd357d5828c1f57b913d824365aafba078536b4ed004b802',
i686: 'aef99be4baeaa602293b09c54c40931c9b4008a9caec991a0186c87ba2c80b40',
x86_64: 'ded94b3dbb3489531f46c01abe2e5a0c70a85dad9171e8e5155e5277cb6ad960'
})
depends_on 'ccache' => :build
depends_on 'dejagnu' => :build # for test
depends_on 'glibc' # R
@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-tune=cortex-a15 --with-fpu=vfpv3-d16'
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