Merge pull request #162 from doraskayo/libtool-archive-order

Fix libtool archive reproducibility
This commit is contained in:
fosslinux 2022-05-15 13:48:15 +10:00 committed by GitHub
commit fba7ecf96a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 144 additions and 27 deletions

View File

@ -99,14 +99,14 @@ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 gcc-4.0.4_0.li
b6134fabf6f8eb98c63f0218281cc5fe0140094f0dc92415653b0de28e877ba0 gcc-4.0.4_0.tar.bz2
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 gcc-4.0.4_1.links
c975e5ad2edd4a4133a7c99d351276b21b8cda0823620b28273f748179849f48 gcc-4.0.4_1.tar.bz2
a3249c7bf3f0bd8f8da5653c382f4bc9e29383d6836e0e66e9c469d4c35962c0 gcc-4.7.4_0.x86.xbps
a27a062aa94cc8ff9b4f8bc0a609e3e401139217cac19516872521c5aa399c83 gcc-4.7.4_0.x86.xbps
b5f6fe07a696751d2fc1d9cc3d96f09d89d6a637e1d8d0b250105b650e831600 gettext-0.21_0.x86.xbps
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 gmp-6.2.1_0.links
ed8b1b36fa558f594b3e4b5a958f1c31d97990abf84788f67ce5be7a593c4b9d gmp-6.2.1_0.tar.bz2
11940cfe5ea1c11f427932faecf054e1463f8b674a3dd99ef1569b245a370035 gperf-3.1_0.x86.xbps
ae0b200220b4a6d40571764d065ddf35d9535e94582c6bdb2c95316d937c4dce grep-2.4_0.links
60f8b585dfbea490467baefa6445e79cbf691b6e88886baa433894fa001e000b grep-2.4_0.tar.bz2
1a73c3d7a8a4faa2df9294ce24fa68ca77e5ac6f35c43680fcf9387edabeea26 guile-3.0.7_0.x86.xbps
4c5ac95c3ca934d5cac5e05e13473a16ee1a616190217795438019f1e4fcc254 guile-3.0.7_0.x86.xbps
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 help2man-1.36.4_0.links
566d93b2c41ba4d61b3f34baa8a0e2af6ea568d15ca1be0ac483b74fcdbfe911 help2man-1.36.4_0.tar.bz2
7eeeb832b400a11419e4ef14bf778b8177bbc6a77f5a37c0c0f2965f66ab4d51 kbd-1.15_0.links
@ -118,9 +118,9 @@ a4aa859bdb70b5c0c9b726fe8f1a34c08b5afc1fe1bc8d0d2be136c7f8b36d85 libarchive-3.5
a80d0ff829ab285e92d966b3664e390ce60b420eb22b1288211432fed880b4fe libatomic_ops-7.6.10_0.x86.xbps
b70fe8d9479ca4a3ad6fdbafbaf52a172c6a4a47ae8cf080beb9d25b97a7b205 libffi-3.3_0.x86.xbps
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 libtool-1.4_0.links
c772b9ebd1f51b5b90cc820ad8fb28a3f816acedccaa632641495355f9b23b9b libtool-1.4_0.tar.bz2
9b016f9550beb2a59a457c2b77de00f6d2fb7782068fe98993f3e24056f5c6a4 libtool-1.4_0.tar.bz2
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 libtool-2.2.4_0.links
d5a622df5eb4bf80a2e697262158e46c4b9cc95122b3f2ebf8df0a650643e8fb libtool-2.2.4_0.tar.bz2
0a692e83e69484a4152e98fc4781493ea126399e8cdd9306e6b6e6c7b1e8c170 libtool-2.2.4_0.tar.bz2
9bf0aea34d1413640667645ef06947ec2c24d3fa4e4e10825a7560c6d2e3343b libunistring-0.9.10_0.x86.xbps
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 linux-4.9.10_0.links
a575a37f05006915c532698500bcc6476c0d2e09ac447cb1b7aa9679e7b593c5 linux-4.9.10_0.tar.bz2
@ -175,7 +175,7 @@ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 tcc-0.9.27_2.l
733df9aae85fbf422aac26fe0354c48d035f7a5fb4f79b00e666e0763914aeca tcc-0.9.27_2.tar.bz2
96dc08f4d01eddc04af107ffd313617af3fc455af38a82b850c4aca08cbd7e84 texinfo-6.7_0.x86.xbps
970cc84444fecc225becb0db24671a186888a8a8d37daf3f40d827a907181a12 util-linux-2.19.1_0.links
6a08b60c548898630a65a2e133d8119fc1c9dbd373e75bbceda7435df08b7105 util-linux-2.19.1_0.tar.bz2
8c3fcbac2d2a5cee4449dc2283a78f43abc0805caaeda9212501a050d86dceec util-linux-2.19.1_0.tar.bz2
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 xbps-0.59.1_0.links
3f044d2aaa838c9df153d662f8e259c2393774d3d3a5e71e26b5d867dbb08107 xbps-0.59.1_0.tar.bz2
ac8c7b186195ad29d86c2d1608b0c4ba37eeb12daff8f155d69d568239cae237 xz-5.0.5_0.links

View File

@ -0,0 +1,65 @@
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
SPDX-FileCopyrightText: 2010 Chris Demetriou <cgd@google.com>
SPDX-License-Identifier: GPL-2.0-or-later
Backported from upstream commit 74c8993c178a1386ea5e2363a01d919738402f30
--- ltmain.in 2001-04-25 02:10:46.000000000 +0300
+++ ltmain.in 2022-05-14 14:49:02.079789885 +0300
@@ -2839,7 +2839,7 @@
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
- libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | sort | $NL2SP`
done
fi
fi
@@ -2978,7 +2978,7 @@
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
- reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | sort | $NL2SP`
done
fi
fi
@@ -3762,7 +3762,7 @@
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
- oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | sort | $NL2SP`
done
fi
--- ltmain.sh 2001-04-25 02:35:10.000000000 +0300
+++ ltmain.sh 2022-05-14 14:46:49.170994957 +0300
@@ -2839,7 +2839,7 @@
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
- libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | sort | $NL2SP`
done
fi
fi
@@ -2978,7 +2978,7 @@
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
- reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | sort | $NL2SP`
done
fi
fi
@@ -3762,7 +3762,7 @@
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
- oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | sort | $NL2SP`
done
fi

View File

@ -0,0 +1,74 @@
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
SPDX-FileCopyrightText: 2010 Chris Demetriou <cgd@google.com>
SPDX-License-Identifier: GPL-2.0-or-later
Backported from upstream commit 74c8993c178a1386ea5e2363a01d919738402f30
--- libltdl/config/ltmain.m4sh 2008-05-04 22:09:52.000000000 +0300
+++ libltdl/config/ltmain.m4sh 2022-05-14 14:24:15.506913405 +0300
@@ -2226,7 +2226,7 @@
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
$LIPO -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
$RM -rf unfat-$$
@@ -2241,7 +2241,7 @@
func_extract_an_archive "$my_xdir" "$my_xabs"
;;
esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
done
func_extract_archives_result="$my_oldobjs"
--- libltdl/config/ltmain.sh 2008-05-04 22:23:13.000000000 +0300
+++ libltdl/config/ltmain.sh 2022-05-14 14:25:15.314266819 +0300
@@ -2668,7 +2668,7 @@
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
$LIPO -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
$RM -rf unfat-$$
@@ -2683,7 +2683,7 @@
func_extract_an_archive "$my_xdir" "$my_xabs"
;;
esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
done
func_extract_archives_result="$my_oldobjs"
--- libltdl/m4/libtool.m4 2008-05-04 19:34:02.000000000 +0300
+++ libltdl/m4/libtool.m4 2022-05-14 14:24:15.507913411 +0300
@@ -5864,20 +5864,20 @@
_LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
_LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
$RANLIB $oldlib'
_LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
*) # Version 6 will use weak symbols
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'

View File

@ -119,16 +119,6 @@ src_compile() {
make -C build/libstdc++-v3 PATH="${PATH}:${PWD}/build/gcc" \
CXXFLAGS="-I${PWD}/build/gcc/include -I ${PREFIX}/include"
# Fix ordering of libstdc++.a
pushd build/libstdc++-v3/src
mkdir order-a
pushd order-a
ar x ../.libs/libstdc++.a
rm ../.libs/libstdc++.a
ar cru ../.libs/libstdc++.a ./*.o
popd
popd
}
src_install() {

View File

@ -61,16 +61,4 @@ src_compile() {
# Now proceed with the build
default
# Ordering of libguile.a is messed up
mkdir libguile/.libs/order
pushd libguile/.libs/order
ar x ../libguile-3.0.a
rm ../libguile-3.0.a
ar cr ../libguile-3.0.a ./*.o
popd
# Recompile guile with fixed libguile
rm libguile/guile
make
}