Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
meson: subprojects: replace berkeley-{soft,test}float-3 with wraps
Unlike other subprojects, these require an overlay directory to include
meson rules to build the libraries.  The rules are basically lifted
from tests/fp/meson.build, with a few changes to create platform.h
and publish a dependency.

The build defines are passed through a subproject option, and posted
back to users of the library via the dependency's compile_args.

The only remaining user of GIT_SUBMODULES and GIT_SUBMODULES_ACTION
is roms/SLOF, which is used to build pc-bios/s390-ccw.  All other
roms submodules are only present to satisfy the license on pre-built
firmware blobs.

Best reviewed with --color-moved.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Jun 6, 2023
1 parent bf6903f commit d2dfe0b
Show file tree
Hide file tree
Showing 12 changed files with 590 additions and 581 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Expand Up @@ -28,12 +28,6 @@
[submodule "roms/u-boot-sam460ex"]
path = roms/u-boot-sam460ex
url = https://gitlab.com/qemu-project/u-boot-sam460ex.git
[submodule "tests/fp/berkeley-testfloat-3"]
path = tests/fp/berkeley-testfloat-3
url = https://gitlab.com/qemu-project/berkeley-testfloat-3.git
[submodule "tests/fp/berkeley-softfloat-3"]
path = tests/fp/berkeley-softfloat-3
url = https://gitlab.com/qemu-project/berkeley-softfloat-3.git
[submodule "roms/edk2"]
path = roms/edk2
url = https://gitlab.com/qemu-project/edk2.git
Expand Down
27 changes: 0 additions & 27 deletions configure
Expand Up @@ -805,28 +805,6 @@ case $git_submodules_action in
fi
;;
ignore)
if ! test -f "$source_path/tests/fp/berkeley-testfloat-3/README.md"
then
echo
echo "ERROR: missing GIT submodules"
echo
if test -e "$source_path/.git"; then
echo "--with-git-submodules=ignore specified but submodules were not"
echo "checked out. Please initialize and update submodules."
else
echo "This is not a GIT checkout but module content appears to"
echo "be missing. Do not use 'git archive' or GitHub download links"
echo "to acquire QEMU source archives. Non-GIT builds are only"
echo "supported with source archives linked from:"
echo
echo " https://www.qemu.org/download/#source"
echo
echo "Developers working with GIT can use scripts/archive-source.sh"
echo "if they need to create valid source archives."
fi
echo
exit 1
fi
;;
*)
echo "ERROR: invalid --with-git-submodules= value '$git_submodules_action'"
Expand Down Expand Up @@ -1142,11 +1120,6 @@ if test "$tcg" = "auto"; then
fi
fi

if test "$tcg" = "enabled"; then
git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
fi

##########################################
# big/little endian test
cat > $TMPC << EOF
Expand Down
22 changes: 1 addition & 21 deletions scripts/archive-source.sh
Expand Up @@ -26,8 +26,7 @@ sub_file="${sub_tdir}/submodule.tar"
# independent of what the developer currently has initialized
# in their checkout, because the build environment is completely
# different to the host OS.
subprojects="dtc keycodemapdb libvfio-user"
submodules="tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3"
subprojects="dtc keycodemapdb libvfio-user berkeley-softfloat-3 berkeley-testfloat-3"
sub_deinit=""

function cleanup() {
Expand All @@ -51,25 +50,6 @@ function tree_ish() {

git archive --format tar "$(tree_ish)" > "$tar_file"
test $? -ne 0 && error "failed to archive qemu"
for sm in $submodules; do
status="$(git submodule status "$sm")"
smhash="${status#[ +-]}"
smhash="${smhash%% *}"
case "$status" in
-*)
sub_deinit="$sub_deinit $sm"
git submodule update --init "$sm"
test $? -ne 0 && error "failed to update submodule $sm"
;;
+*)
echo "WARNING: submodule $sm is out of sync"
;;
esac
(cd $sm; git archive --format tar --prefix "$sm/" $(tree_ish)) > "$sub_file"
test $? -ne 0 && error "failed to archive submodule $sm ($smhash)"
tar --concatenate --file "$tar_file" "$sub_file"
test $? -ne 0 && error "failed append submodule $sm to $tar_file"
done

for sp in $subprojects; do
meson subprojects download $sp
Expand Down
2 changes: 1 addition & 1 deletion scripts/make-release
Expand Up @@ -17,7 +17,7 @@ if [ $# -ne 2 ]; then
fi

# Only include wraps that are invoked with subproject()
SUBPROJECTS="dtc libvfio-user keycodemapdb"
SUBPROJECTS="dtc libvfio-user keycodemapdb berkeley-softfloat-3 berkeley-testfloat-3"

src="$1"
version="$2"
Expand Down
2 changes: 2 additions & 0 deletions subprojects/.gitignore
@@ -1,5 +1,7 @@
/packagecache

/berkeley-softfloat-3
/berkeley-testfloat-3
/dtc
/keycodemapdb
/libvfio-user
Expand Down
5 changes: 5 additions & 0 deletions subprojects/berkeley-softfloat-3.wrap
@@ -0,0 +1,5 @@
[wrap-git]
url = https://gitlab.com/qemu-project/berkeley-softfloat-3
revision = b64af41c3276f97f0e181920400ee056b9c88037
patch_directory = berkeley-softfloat-3
depth = 1
5 changes: 5 additions & 0 deletions subprojects/berkeley-testfloat-3.wrap
@@ -0,0 +1,5 @@
[wrap-git]
url = https://gitlab.com/qemu-project/berkeley-testfloat-3
revision = 40619cbb3bf32872df8c53cc457039229428a263
patch_directory = berkeley-testfloat-3
depth = 1

0 comments on commit d2dfe0b

Please sign in to comment.