mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 23:18:10 -05:00
New musl toolchain w/ static git, curl, lzip (and gcc11 rebuilds to fix brokenness on i686) (#6431)
* Musl revamp * Cleanup Musl Packages * fixup musl_libnghttp2 * fixup musl_libucontext
This commit is contained in:
@@ -17,57 +17,34 @@ class Musl_libunwind < Package
|
||||
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_libunwind/1.5.0_x86_64/musl_libunwind-1.5.0-chromeos-x86_64.tpxz'
|
||||
})
|
||||
binary_sha256({
|
||||
aarch64: '8325ff524aa0259dfd76a96fe43a12d16f8cc7e7c0d1a69f2db5bd68eb0f5879',
|
||||
armv7l: '8325ff524aa0259dfd76a96fe43a12d16f8cc7e7c0d1a69f2db5bd68eb0f5879',
|
||||
i686: 'c87940a7e9ea4963fce675445c4276cf8baae2506fb4260adbb1b8baf78cc9d2',
|
||||
x86_64: '77172a1ee1ee561db6c95c1dffd8553b094214afbd8860a5dcdf00b0d288ec23'
|
||||
aarch64: '6c8cd877134f2b8b79ae166aff8d08fa782fecac5dbbb70a937d3a0f6cd65588',
|
||||
armv7l: '6c8cd877134f2b8b79ae166aff8d08fa782fecac5dbbb70a937d3a0f6cd65588',
|
||||
i686: 'b350166133b7d657c2316740f8a3e236ff4653c9ce7b9842b473f6bf153d8465',
|
||||
x86_64: '52eb28cf1ae245e52084699cdc1bc18e604f3a9d2b1ac2c5a4fd82b2548a2d8c'
|
||||
})
|
||||
|
||||
depends_on 'musl_native_toolchain' => :build
|
||||
depends_on 'musl_libbacktrace' => :build
|
||||
depends_on 'musl_libucontext' => :build
|
||||
|
||||
@abi = ''
|
||||
@arch_c_flags = ''
|
||||
@arch_cxx_flags = ''
|
||||
case ARCH
|
||||
when 'aarch64', 'armv7l'
|
||||
@abi = 'eabihf'
|
||||
@arch = 'arm'
|
||||
when 'i686'
|
||||
@arch = 'x86'
|
||||
when 'x86_64'
|
||||
@arch = 'x86_64'
|
||||
end
|
||||
|
||||
@cflags = "-B#{CREW_PREFIX}/musl/include -flto -pipe -O3 -ffat-lto-objects -fipa-pta -fno-semantic-interposition -fdevirtualize-at-ltrans #{@arch_c_flags} -fcommon"
|
||||
@cxxflags = "-B#{CREW_PREFIX}/musl/include -flto -pipe -O3 -ffat-lto-objects -fipa-pta -fno-semantic-interposition -fdevirtualize-at-ltrans #{@arch_cxx_flags} -fcommon -static"
|
||||
@ldflags = "-L#{CREW_PREFIX}/musl/lib -flto -static"
|
||||
@cmake_ldflags = '-flto'
|
||||
|
||||
@musldep_env_options = "PATH=#{CREW_PREFIX}/musl/bin:#{ENV['PATH']} \
|
||||
LIBRARY_PATH='#{CREW_PREFIX}/musl/lib:$LIBRARY_PATH' \
|
||||
CC='#{CREW_PREFIX}/musl/bin/#{ARCH}-linux-musl#{@abi}-gcc' \
|
||||
CXX='#{CREW_PREFIX}/musl/bin/#{ARCH}-linux-musl#{@abi}-g++' \
|
||||
LD=#{CREW_PREFIX}/musl/bin/#{ARCH}-linux-musl#{@abi}-ld.gold \
|
||||
LIBDIR=#{CREW_PREFIX}/musl/lib \
|
||||
INCLUDEDIR=#{CREW_PREFIX}/musl/include \
|
||||
PKG_CONFIG_LIBDIR=#{CREW_PREFIX}/musl/lib/pkgconfig \
|
||||
PKGCONFIGDIR=#{CREW_PREFIX}/musl/lib/pkgconfig \
|
||||
CFLAGS='#{@cflags}' \
|
||||
CXXFLAGS='#{@cxxflags}' \
|
||||
CPPFLAGS='-I#{CREW_PREFIX}/musl/include -fcommon' \
|
||||
LDFLAGS='#{@ldflags}'"
|
||||
|
||||
def self.patch
|
||||
# As per https://www.linuxquestions.org/questions/linux-software-2/building-libunwind-on-x86-musl-libc-against-libucontext-4175692781/#post6235105
|
||||
# https://archive.md/gaEbN
|
||||
case ARCH
|
||||
when 'aarch64', 'armv7l'
|
||||
@arch = 'arm'
|
||||
when 'i686'
|
||||
@arch = 'x86'
|
||||
when 'x86_64'
|
||||
@arch = 'x86_64'
|
||||
end
|
||||
system "sed -i '1i#include <ucontext.h>\' src/#{@arch}/Gos-linux.c"
|
||||
system 'filefix'
|
||||
end
|
||||
|
||||
def self.build
|
||||
system "#{@musldep_env_options} ./configure --prefix=#{CREW_PREFIX}/musl \
|
||||
load "#{CREW_LIB_PATH}lib/musl.rb"
|
||||
system "#{MUSL_ENV_OPTIONS} ./configure --prefix=#{CREW_MUSL_PREFIX} \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--enable-ptrace \
|
||||
@@ -76,11 +53,6 @@ class Musl_libunwind < Package
|
||||
end
|
||||
|
||||
def self.install
|
||||
ENV['CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY'] = '1'
|
||||
warn_level = $VERBOSE
|
||||
$VERBOSE = nil
|
||||
load "#{CREW_LIB_PATH}lib/const.rb"
|
||||
$VERBOSE = warn_level
|
||||
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user