Skip to content

Commit

Permalink
gcc-shared
Browse files Browse the repository at this point in the history
  • Loading branch information
michacassola committed May 4, 2024
1 parent 303cdcc commit 6d8270c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
5 changes: 4 additions & 1 deletion unypkg-base-build-stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ version_details
archiving_source

######################################################################################################################
### GCC
### GCC + GCC-Shared
pkgname="gcc"
pkggit="https://gcc.gnu.org/git/gcc.git refs/tags/releases/gcc*"
gitdepth="--depth=1"
Expand All @@ -171,6 +171,9 @@ latest_commit_id="$(echo "$latest_head" | cut --fields=1)"

repo_clone_version_archive

pkgname="gcc-shared"
version_details

######################################################################################################################
######################################################################################################################
### Exit if Glibc, Binutils or GCC are not newer
Expand Down
25 changes: 18 additions & 7 deletions unypkg-base-build-stage2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ echo -n "/uny/include${cplus_include_base[*]}:/uny/include${cplus_include_base[*
# shellcheck source=/dev/null
source /uny/git/unypkg/fn
######################################################################################################################
### Prepare gcc-shared libs until replaced with gcc's below
gcc_ver="$(echo /uny/sources/gcc-* | grep -Eo "gcc-[^0-9]*(([0-9]+\.)*[0-9]+)" | sort -u | sed "s|gcc-||")"
mkdir -pv /uny/pkg/gcc-shared/"$gcc_ver"/lib
cp -av /usr/lib/libstdc++.so* /uny/pkg/gcc-shared/"$gcc_ver"/lib/
cp -av /usr/lib/libgcc_s.so* /uny/pkg/gcc-shared/"$gcc_ver"/lib/
######################################################################################################################
### Glibc
Expand Down Expand Up @@ -181,9 +189,6 @@ sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
make install
cp -av /usr/lib/libstdc++.so* /uny/pkg/"$pkgname"/"$pkgver"/lib/
cp -av /usr/lib/libgcc_s.so* /uny/pkg/"$pkgname"/"$pkgver"/lib/
#sed "/RTLDLIST=/s@/usr@/uny/pkg/$pkgname/$pkgver@g" -i /uny/pkg/"$pkgname"/"$pkgver"/bin/ldd
sed '/RTLDLIST=/s@/lib64@/lib@g' -i /uny/pkg/"$pkgname"/"$pkgver"/bin/ldd
Expand Down Expand Up @@ -1106,7 +1111,6 @@ mkdir -v build
cd build || exit
../configure --prefix=/uny/pkg/"$pkgname"/"$pkgver" \
--libexecdir=/uny/pkg/"$pkgname"/"$pkgver"/libexec \
LD=ld \
--enable-languages=c,c++ \
--enable-default-pie \
Expand All @@ -1132,15 +1136,22 @@ ln -svr /uny/pkg/"$pkgname"/"$pkgver"/bin/cpp /uny/pkg/"$pkgname"/"$pkgver"/lib
ln -sfv /uny/pkg/"$pkgname"/"$pkgver"/libexec/gcc/"$(gcc -dumpmachine)"/"$pkgver"/liblto_plugin.so \
/uny/pkg/binutils/*/lib/bfd-plugins/
cp -av /uny/pkg/"$pkgname"/"$pkgver"/lib/libstdc++.so* /uny/pkg/glibc/*/lib/
#cp -av /usr/lib/libgcc_s.so* /uny/pkg/glibc/*/lib/
echo -n "/uny/pkg/$pkgname/$pkgver/include:/uny/pkg/$pkgname/$pkgver/include/c++/$pkgver" >/uny/paths/include-cplus
### Move directories to gcc-shared
rm -rv /uny/pkg/gcc-shared/$pkgver/lib
mv -v /uny/pkg/$pkgname/$pkgver/lib /uny/pkg/gcc-shared/$pkgver/lib
mv -v /uny/pkg/$pkgname/$pkgver/share /uny/pkg/gcc-shared/$pkgver/share
####################################################
### End of individual build script
add_to_paths_files
### Also add gcc-shared to paths files
pkgname="gcc-shared"
add_to_paths_files
dependencies_file_and_unset_vars
cleanup_verbose_off_timing_end
Expand Down

0 comments on commit 6d8270c

Please sign in to comment.