Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add libatomic as dependency to fix keydb buils issue #1935

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config/software/gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# do_not_auto_update
name "gcc"
default_version "4.9.2"
default_version "7.5.0"

dependency "gmp"
dependency "mpfr"
Expand Down Expand Up @@ -55,6 +55,9 @@
# on any other platforms we may use this with)
# gcc also has issues on a lot of platforms when running a multithreaded job,
# so unfortunately we have to build with 1 worker :(
if version.satisfies?(">= 7.5.0")
command "cd #{install_dir}/embedded/lib && ln -s libatomic.so.1.2.0 libatomic.so", env: env
end
make env: env, timeout: 14400
make "install", env: env
end
2 changes: 2 additions & 0 deletions config/software/keydb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@

make "-j #{workers}", env: env
make "install", env: env
copy "#{install_dir}/embedded/lib/libatomic.so.1", "#{install_dir}/lib/libatomic.so.1"
command "cd #{install_dir}/embedded/lib && ln -s libatomic.so.1.2.0 libatomic.so", env: env
end
43 changes: 43 additions & 0 deletions config/software/libatomic.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name "libatomic"
default_version "7.5.0"
dependency "gmp"
dependency "mpfr"
dependency "mpc"

# Version list: url=https://ftp.gnu.org/gnu/gcc/ filter=*.tar.gz
version("7.5.0") { source sha256: "4f518f18cfb694ad7975064e99e200fe98af13603b47e67e801ba9580e50a07f" }
source url: "https://mirrors.kernel.org/gnu/gcc/gcc-#{version}/gcc-#{version}.tar.gz"

relative_path "gcc-#{version}"

build do
env = with_standard_compiler_flags(with_embedded_path)
# Install texinfo if on a Red Hat-based system
# Check the OS and install texinfo if on a Red Hat-based system
if File.exist?("/usr/bin/yum")
command "yum install -y texinfo", env: env
elsif File.exist?("/usr/bin/apt-get")
command "apt-get update && apt-get install -y texinfo", env: env
else
puts "Warning: No package manager found. Texinfo installation skipped."
end

env["CFLAGS"] << " -fno-lto"
env["CXXFLAGS"] << " -fno-lto"
#export LDFLAGS="-L/path/to/libmpc -L/path/to/libmpfr -L/path/to/libgmp"
# Set the library paths
mpc_path = "/usr/lib/x86_64-linux-gnu"
mpfr_path = "/usr/lib/x86_64-linux-gnu"
gmp_path = "/usr/lib/x86_64-linux-gnu"

# Configure GCC with explicit library paths
command "./configure --prefix=#{install_dir}/embedded --enable-shared --disable-nls --disable-multilib --with-mpc=#{mpc_path} --with-mpfr=#{mpfr_path} --with-gmp=#{gmp_path}", env: env
# Build the entire GCC, which includes libatomic
command "make -j #{workers}", env: env

# Install only libatomic
command "make install-libatomic", env: env

# Create a symlink for libatomic.so.1
command "cd #{install_dir}/embedded/lib && ln -s libatomic.so.1 libatomic.so", env: env
end