From 663d280d9f4d61c9ca87839723ba10441097c4dd Mon Sep 17 00:00:00 2001 From: "Satadru Pramanik, DO, MPH, MEng" Date: Fri, 27 Jun 2025 13:37:44 -0400 Subject: [PATCH] Add postinstall to glibc to add symlinks. (#12116) * Add postinstall to glibc to add symlinks. Signed-off-by: Satadru Pramanik * Update packages/glibc.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update packages/glibc.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update packages/glibc.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update glibc version Signed-off-by: Satadru Pramanik --------- Signed-off-by: Satadru Pramanik Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- packages/glibc.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/glibc.rb b/packages/glibc.rb index 4fddd8b02..081bdbef3 100644 --- a/packages/glibc.rb +++ b/packages/glibc.rb @@ -7,7 +7,7 @@ unless CREW_PRE_GLIBC_STANDALONE class Glibc < Package description 'The GNU C Library project provides the core libraries for GNU/Linux systems.' homepage 'https://www.gnu.org/software/libc/' - version '2.41-5' + version '2.41-6' license 'LGPL-2.1+, BSD, HPND, ISC, inner-net, rc, and PCRE' compatibility 'all' source_url 'https://sourceware.org/git/glibc.git' @@ -171,6 +171,25 @@ unless CREW_PRE_GLIBC_STANDALONE end def self.postinstall + glibc_libraries = %w[ld libBrokenLocale libSegFault libanl libc libcrypt + libdl libm libmemusage libmvec libnsl libnss_compat libnss_db + libnss_dns libnss_files libnss_hesiod libpcprofile libpthread + libthread_db libresolv librlv librt libthread_db-1.0 libutil] + glibc_libraries.each do |lib| + # Reject entries which aren't libraries ending in .so, and which aren't files. + # Reject text files such as libc.so because they points to files like + # libc_nonshared.a, which are not provided by ChromeOS + Dir["#{CREW_GLIBC_PREFIX}/#{lib}.so*"].compact.reject { |f| File.directory?(f) }.each do |f| + glibc_filetype = `file #{f}`.chomp + puts "f: #{glibc_filetype}" if @opt_verbose + if ['shared object', 'symbolic link'].any? { |type| glibc_filetype.include?(type) } + g = File.basename(f) + FileUtils.ln_sf f.to_s, "#{CREW_LIB_PREFIX}/#{g}" + elsif @opt_verbose + puts "#{f} excluded because #{glibc_filetype}" + end + end + end # update search cache for ld.so system "#{CREW_PREFIX}/bin/ldconfig", %i[out err] => File::NULL puts "Please run 'crew update' immediately to finish the install.".lightblue