mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
* crew: Add a LD_PRELOAD library for hijacking linker/library path Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Add `glibc_{build,dev.lib}` to deprecated package list Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Bump version Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Minor changes Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Move static libraries to CREW_LIB_PREFIX Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Remove glibc_build from const.rb Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Make rubocop happy Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Fix arm build and add binaries. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * cleanup Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust x86_64 unit tests to use the Nocturne M90 container image and armv7l unit tests to use the fievel M91 container image since we are using the same glibc for everything now. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust build containers to use the oldest glibc based containers. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add i686 builds. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add x86_64 build. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Set LD_PRELOAD before running any command Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Use File.join Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Use File.join Signed-off-by: SupeChicken666 <me@supechicken666.dev> * adjust unit tests. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Fix arm CREW_GLIBC_INTERPRETER Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update Rhythmbox Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update Rhythmbox Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Do not install crew_sudo in container. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Bump version Signed-off-by: SupeChicken666 <me@supechicken666.dev> --------- Signed-off-by: SupeChicken666 <me@supechicken666.dev> Signed-off-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: Satadru Pramanik <satadru@gmail.com>
122 lines
3.7 KiB
Ruby
122 lines
3.7 KiB
Ruby
require 'package'
|
|
Package.load_package("#{__dir__}/gcc_build.rb")
|
|
|
|
class Libssp < Package
|
|
description 'Libssp is a part of the GCC toolkit.'
|
|
homepage 'https://gcc.gnu.org/'
|
|
@gcc_libc_version = ARCH.eql?('i686') ? '2.23' : '2.27'
|
|
version "14.2.0-glibc#{@gcc_libc_version}" # Do not use @_ver here, it will break the installer.
|
|
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 (#{version}) differs from gcc version #{Gcc_build.version}".orange if version.to_s != Gcc_build.version
|
|
compatibility 'all'
|
|
source_url 'https://github.com/gcc-mirror/gcc.git'
|
|
git_hashtag "releases/gcc-#{version.split('-').first}"
|
|
binary_compression 'tar.zst'
|
|
|
|
case @gcc_libc_version
|
|
when '2.23'
|
|
|
|
binary_sha256({
|
|
i686: '482ada83ade66f12de9370a91e3b48bde523248fa870d4729d4644b2115c8e04'
|
|
})
|
|
when '2.27', '2.32', '2.33', '2.35'
|
|
|
|
binary_sha256({
|
|
aarch64: 'ed9b5e88ce0beb9862ee9ed4d75751ee7bf198bd5cb1916aa4508e57dd760b41',
|
|
armv7l: 'ed9b5e88ce0beb9862ee9ed4d75751ee7bf198bd5cb1916aa4508e57dd760b41',
|
|
x86_64: 'd10e99018633679a1503175da5e3b1aaab83f3da9e845d95ffa5450dbb191f9b'
|
|
})
|
|
when '2.37'
|
|
binary_sha256({
|
|
aarch64: '80428580f3ff02c0b8aa0b65ec64626e906b59d754851f289210360686bdb8d1',
|
|
armv7l: '80428580f3ff02c0b8aa0b65ec64626e906b59d754851f289210360686bdb8d1',
|
|
x86_64: '69114b1e6bcd208d14305e39de47e32aa8781af96f2ad3cced8333fb2d602ec3'
|
|
})
|
|
end
|
|
|
|
depends_on 'ccache' => :build
|
|
depends_on 'dejagnu' => :build # for test
|
|
depends_on 'glibc' # R
|
|
|
|
@gcc_name = 'libssp'
|
|
|
|
@gcc_global_opts = "--build=#{CREW_TARGET} \
|
|
--host=#{CREW_TARGET} \
|
|
--target=#{CREW_TARGET} \
|
|
--disable-libmpx \
|
|
--disable-install-libiberty \
|
|
--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_CONFIGURE_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
|