Skip to content

Instantly share code, notes, and snippets.

@avinash-palleti
Last active September 18, 2018 05:15
Show Gist options
  • Select an option

  • Save avinash-palleti/162bced731dcbbcd6c3efa68c75edac9 to your computer and use it in GitHub Desktop.

Select an option

Save avinash-palleti/162bced731dcbbcd6c3efa68c75edac9 to your computer and use it in GitHub Desktop.
Inside docker
%define keepstatic 1
%define gcc_target x86_64-pc-linux-gnu
%define libstdcxx_maj 6
%define libstdcxx_full 6.0.25
%define isl_version 0.16.1
%define gccver 8.2.0
%define gccpath gcc-8.2.0
%global _missing_build_ids_terminate_build 0
#
# debug_package must be set to %{nil} for functional reasons
# removing this breaks the crt* files for correctness
#
%define debug_package %{nil}
Name : ogcc
Version : 8.2.0
Release : 119
URL : http://www.gnu.org/software/gcc/
Source0 : https://mirrors.kernel.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.gz
Source1 : https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.16.1.tar.bz2
Summary : GNU cc and gcc C compilers
Group : Development/Tools
License : BSD-3-Clause BSL-1.0 GFDL-1.2 GFDL-1.3 GPL-2.0 GPL-3.0 LGPL-2.1 LGPL-3.0 MIT
AutoProv : No
%description
GNU cc and gcc C compilers.
%prep
%setup -q -n %{gccpath}
%build
# Live in the gcc source tree
tar xf %{SOURCE1} && ln -sf isl-%{isl_version} isl
rm -rf gcc-build
mkdir gcc-build
cd gcc-build
../configure \
--prefix=%{buildroot}/opt/gcc \
--with-pkgversion='FuSa Clear Linux OS for Intel Architecture'\
--libdir=%{buildroot}/opt/gcc/lib64 \
--libexecdir=%{buildroot}/opt/gcc/lib64 \
--enable-multilib\
--enable-languages="c"
make %{?_smp_mflags}
#%check
#pushd ../gcc-build
#export CHECK_TEST_FRAMEWORK=1
#make -k %{?_smp_mflags} check || :
#popd
%install
cd gcc-build
export CPATH=%{buildroot}/opt/gcc/include
export LIBRARY_PATH=%{buildroot}/opt/gcc/lib64
#%make_install
make install
cd -
cd %{buildroot}/opt/gcc/bin
ln -sf %{gcc_target}-g++ g++
ln -sf %{gcc_target}-gcc gcc
install -d %{buildroot}/opt/gcc/lib
ln -sf cpp %{buildroot}/opt/gcc/lib/cpp
ln -sf g++ c++
ln -sf gcc cc
cd -
chmod 0755 %{buildroot}/opt/gcc/lib64/libgcc_s.so.1
chmod 0755 %{buildroot}/opt/gcc/lib32/libgcc_s.so.1
chmod a+x %{buildroot}/opt/gcc/bin
chmod a+x %{buildroot}/opt/gcc/lib64
chmod -R a+x %{buildroot}/opt/gcc/lib*/gcc/
%files
/opt/gcc/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment