diff --git a/config/software/gcc.rb b/config/software/gcc.rb index 90de90774..f9d45fef6 100644 --- a/config/software/gcc.rb +++ b/config/software/gcc.rb @@ -17,7 +17,7 @@ # do_not_auto_update name "gcc" -default_version "4.9.2" +default_version "7.5.0" dependency "gmp" dependency "mpfr" @@ -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 diff --git a/config/software/keydb.rb b/config/software/keydb.rb index 5788c46c8..c360b58c5 100644 --- a/config/software/keydb.rb +++ b/config/software/keydb.rb @@ -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 diff --git a/config/software/libatomic.rb b/config/software/libatomic.rb new file mode 100644 index 000000000..f383cb9a8 --- /dev/null +++ b/config/software/libatomic.rb @@ -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 \ No newline at end of file