diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90775c6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# libdfp tarballs. +libdfp-*.tar.[gx]z +# Generated RPMs. +*.rpm diff --git a/libdfp-DESTDIR.patch b/libdfp-DESTDIR.patch new file mode 100644 index 0000000..cb3870f --- /dev/null +++ b/libdfp-DESTDIR.patch @@ -0,0 +1,69 @@ +From 3b22edab8934734f60ce6984be85f5e772305a42 Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho +Date: Tue, 8 Oct 2019 17:31:37 -0300 +Subject: [PATCH] Replace the install_root with DESTDIR + +The standard variable passed to make for an alternate installation +directory is DESTDIR and not install_root. +This patch helps to integrate libdfp downstream. + +Signed-off-by: Tulio Magno Quites Machado Filho +--- + Makefile.in | 6 +++--- + README.developer | 8 ++++---- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 8c76ab5..4b2d3d8 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -15,19 +15,19 @@ docdir = @docdir@ + ifndef libdir + libdir = $(exec_prefix)/lib + endif +-inst_libdir = $(install_root)$(libdir) ++inst_libdir = $(DESTDIR)$(libdir) + + # Where to install the header files. + ifndef includedir + includedir = $(prefix)/include + endif +-inst_includedir = $(install_root)$(includedir) ++inst_includedir = $(DESTDIR)$(includedir) + + # Where to install the README document + ifndef docdir + docdir = $(prefix)/share/doc/ + endif +-inst_docdir = $(install_root)$(docdir) ++inst_docdir = $(DESTDIR)$(docdir) + + dfp_name = @PACKAGE_NAME@ + dfp_version = @PACKAGE_VERSION@ +diff --git a/README.developer b/README.developer +index 89c1f04..7294231 100644 +--- a/README.developer ++++ b/README.developer +@@ -632,15 +632,15 @@ make check + later. The path to the build was passed to configure using + the --with-glibc-build switch. + +-make install [install_root=] ++make install [DESTDIR=] + +- [install_root] (Optional) : Install to /$prefix. This is used ++ [DESTDIR] (Optional) : Install to /$prefix. This is used + by libdfp developers and distro builders so that they can build libdfp + and install it to an alternate location in preparation for packaging. + +-make install-headers [install_root=] ++make install-headers [DESTDIR=] + +- [install_root] (Optional) : Install libdfp headers into ++ [DESTDIR] (Optional) : Install libdfp headers into + /$prefix/include/dfp. This is used by application or library + developers whose projects depend on libdfp who don't want to install + libdfp proper or may not have permission to do so. +-- +2.14.5 + diff --git a/libdfp-ppc-xfail.patch b/libdfp-ppc-xfail.patch new file mode 100644 index 0000000..06db550 --- /dev/null +++ b/libdfp-ppc-xfail.patch @@ -0,0 +1,204 @@ +From 70b498d39e620c1646019825cc7576485817f335 Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho +Date: Thu, 8 Aug 2019 15:39:28 -0300 +Subject: [PATCH] powerpc: Ignore tests that are known to fail on soft-dfp and + POWER hard-dfp + +The test tests/test-cast-to-underflow has 36 known failures. +The fix for these failures are being tracked at PRs #32, #71 and #84. +Having these failures makes it hard for newcomers, downstream and +continuous integration systems to detect when a failure is already known +or not. +This patch ignores the 36 tests known to fail on soft-dfp and POWER +hard-dfp. It affects only ppc, ppc64 and ppc64le. + +Signed-off-by: Tulio Magno Quites Machado Filho +--- + tests/test-cast-to-underflow.c | 48 ++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +diff --git a/tests/test-cast-to-underflow.c b/tests/test-cast-to-underflow.c +index 81bc27d..c279010 100644 +--- a/tests/test-cast-to-underflow.c ++++ b/tests/test-cast-to-underflow.c +@@ -140,20 +140,28 @@ static const d128_type d128to64[] = { + {__LINE__, FE_TONEAREST, -1e-6176DL, -0.0}, + {__LINE__, FE_TONEAREST, 1e-1000DL, 0.0}, + {__LINE__, FE_TONEAREST, -1e-1000DL, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_TONEAREST, 1e-325DL, 0.0}, + {__LINE__, FE_TONEAREST, -1e-325DL, -0.0}, ++#endif + {__LINE__, FE_TONEAREST, 2.4703282292062326e-324DL, 0.0}, + {__LINE__, FE_TONEAREST, -2.4703282292062326e-324DL, -0.0}, + {__LINE__, FE_TONEAREST, 2.4703282292062327e-324DL, 0.0}, + {__LINE__, FE_TONEAREST, -2.4703282292062327e-324DL, -0.0}, + {__LINE__, FE_TONEAREST, 2.470328229206232720882843964341105e-324DL, 0.0}, + {__LINE__, FE_TONEAREST, -2.470328229206232720882843964341105e-324DL, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_TONEAREST, 2.470328229206232720882843964341107e-324DL, + __DBL_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, -2.470328229206232720882843964341107e-324DL, + -__DBL_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, 2.4703282292062328e-324DL, __DBL_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, -2.4703282292062328e-324DL, -__DBL_DENORM_MIN__}, ++#endif + {__LINE__, FE_TONEAREST, 5e-324DL, __DBL_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, -5e-324DL, -__DBL_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, 1e-323DL, 2 * __DBL_DENORM_MIN__}, +@@ -166,10 +174,14 @@ static const d128_type d128to64[] = { + {__LINE__, FE_TOWARDZERO, -4.940656458412465e-324DL, -0.0}, + {__LINE__, FE_TOWARDZERO, 4.940656458412465441765687928682213e-324DL, 0.0}, + {__LINE__, FE_TOWARDZERO, -4.940656458412465441765687928682213e-324DL, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_TOWARDZERO, 4.940656458412465441765687928682214e-324DL, + __DBL_DENORM_MIN__}, + {__LINE__, FE_TOWARDZERO, -4.940656458412465441765687928682214e-324DL, + -__DBL_DENORM_MIN__}, ++#endif + {__LINE__, FE_TOWARDZERO, 4.940656458412466e-324DL, __DBL_DENORM_MIN__}, + {__LINE__, FE_TOWARDZERO, -4.940656458412466e-324DL, -__DBL_DENORM_MIN__}, + {__LINE__, FE_TOWARDZERO, 5e-324DL, __DBL_DENORM_MIN__}, +@@ -183,10 +195,14 @@ static const d128_type d128to64[] = { + {__LINE__, FE_DOWNWARD, 4.940656458412465441765687928682213e-324DL, 0.0}, + {__LINE__, FE_DOWNWARD, -4.940656458412465441765687928682213e-324DL, + -__DBL_DENORM_MIN__}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_DOWNWARD, 4.940656458412465441765687928682214e-324DL, + __DBL_DENORM_MIN__}, + {__LINE__, FE_DOWNWARD, -4.940656458412465441765687928682214e-324DL, + -2 * __DBL_DENORM_MIN__}, ++#endif + {__LINE__, FE_DOWNWARD, 4.940656458412466e-324DL, __DBL_DENORM_MIN__}, + {__LINE__, FE_DOWNWARD, -4.940656458412466e-324DL, -2 * __DBL_DENORM_MIN__}, + {__LINE__, FE_DOWNWARD, 5e-324DL, __DBL_DENORM_MIN__}, +@@ -200,10 +216,14 @@ static const d128_type d128to64[] = { + {__LINE__, FE_UPWARD, 4.940656458412465441765687928682213e-324DL, + __DBL_DENORM_MIN__}, + {__LINE__, FE_UPWARD, -4.940656458412465441765687928682213e-324DL, -0.0 }, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_UPWARD, 4.940656458412465441765687928682214e-324DL, + 2 * __DBL_DENORM_MIN__}, + {__LINE__, FE_UPWARD, -4.940656458412465441765687928682214e-324DL, + -__DBL_DENORM_MIN__}, ++#endif + {__LINE__, FE_UPWARD, 4.940656458412466e-324DL, 2 * __DBL_DENORM_MIN__}, + {__LINE__, FE_UPWARD, -4.940656458412466e-324DL, -__DBL_DENORM_MIN__}, + {__LINE__, FE_UPWARD, 5e-324DL, 2 * __DBL_DENORM_MIN__}, +@@ -216,14 +236,21 @@ static const d128_type d128to32[] = { + {__LINE__, FE_TONEAREST, -1e-6176DL, -0.0}, + {__LINE__, FE_TONEAREST, 1e-1000DL, 0.0}, + {__LINE__, FE_TONEAREST, -1e-1000DL, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_TONEAREST, 7.0064922e-46DL, 0.0}, + {__LINE__, FE_TONEAREST, -7.0064922e-46DL, -0.0}, ++#endif + {__LINE__, FE_TONEAREST, 7.0064923e-46DL, 0.0}, + {__LINE__, FE_TONEAREST, -7.0064923e-46DL, -0.0}, + {__LINE__, FE_TONEAREST, 7.006492321624085e-46DL, 0.0}, + {__LINE__, FE_TONEAREST, -7.006492321624085e-46DL, -0.0}, + {__LINE__, FE_TONEAREST, 7.006492321624085354618647916449580e-46DL, 0.0}, + {__LINE__, FE_TONEAREST, -7.006492321624085354618647916449580e-46DL, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_TONEAREST, 7.006492321624085354618647916449581e-46DL, + __FLT_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, -7.006492321624085354618647916449581e-46DL, +@@ -232,6 +259,7 @@ static const d128_type d128to32[] = { + {__LINE__, FE_TONEAREST, -7.006492321624086e-46DL, -__FLT_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, 7.0064924e-46DL, __FLT_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, -7.0064924e-46DL, -__FLT_DENORM_MIN__}, ++#endif + {__LINE__, FE_TONEAREST, 1.5e-45DL, __FLT_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, -1.5e-45DL, -__FLT_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, 2.9e-45DL, 2 * __FLT_DENORM_MIN__}, +@@ -244,12 +272,16 @@ static const d128_type d128to32[] = { + {__LINE__, FE_TOWARDZERO, -1.401298464324817e-45DL, -0.0}, + {__LINE__, FE_TOWARDZERO, 1.401298464324817070923729583289916e-45DL, 0.0}, + {__LINE__, FE_TOWARDZERO, -1.401298464324817070923729583289916e-45DL, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_TOWARDZERO, 1.401298464324817070923729583289917e-45DL, + __FLT_DENORM_MIN__}, + {__LINE__, FE_TOWARDZERO, -1.401298464324817070923729583289917e-45DL, + -__FLT_DENORM_MIN__}, + {__LINE__, FE_TOWARDZERO, 1.401298464324818e-45DL, __FLT_DENORM_MIN__}, + {__LINE__, FE_TOWARDZERO, -1.401298464324818e-45DL, -__FLT_DENORM_MIN__}, ++#endif + {__LINE__, FE_TOWARDZERO, 2e-45DL, __FLT_DENORM_MIN__}, + {__LINE__, FE_TOWARDZERO, -2e-45DL, -__FLT_DENORM_MIN__}, + {__LINE__, FE_DOWNWARD, 1e-1000DL, 0.0}, +@@ -261,12 +293,16 @@ static const d128_type d128to32[] = { + {__LINE__, FE_DOWNWARD, 1.401298464324817070923729583289916e-45DL, 0.0}, + {__LINE__, FE_DOWNWARD, -1.401298464324817070923729583289916e-45DL, + -__FLT_DENORM_MIN__}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_DOWNWARD, 1.401298464324817070923729583289917e-45DL, + __FLT_DENORM_MIN__}, + {__LINE__, FE_DOWNWARD, -1.401298464324817070923729583289917e-45DL, + -2 * __FLT_DENORM_MIN__}, + {__LINE__, FE_DOWNWARD, 1.401298464324818e-45DL, __FLT_DENORM_MIN__}, + {__LINE__, FE_DOWNWARD, -1.401298464324818e-45DL, -2 * __FLT_DENORM_MIN__}, ++#endif + {__LINE__, FE_DOWNWARD, 2e-45DL, __FLT_DENORM_MIN__}, + {__LINE__, FE_DOWNWARD, -2e-45DL, -2 * __FLT_DENORM_MIN__}, + {__LINE__, FE_UPWARD, 1e-1000DL, __FLT_DENORM_MIN__}, +@@ -278,12 +314,16 @@ static const d128_type d128to32[] = { + {__LINE__, FE_UPWARD, 1.401298464324817070923729583289916e-45DL, + __FLT_DENORM_MIN__}, + {__LINE__, FE_UPWARD, -1.401298464324817070923729583289916e-45DL, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_UPWARD, 1.401298464324817070923729583289917e-45DL, + 2 * __FLT_DENORM_MIN__}, + {__LINE__, FE_UPWARD, -1.401298464324817070923729583289917e-45DL, + -__FLT_DENORM_MIN__}, + {__LINE__, FE_UPWARD, 1.401298464324818e-45DL, 2 * __FLT_DENORM_MIN__}, + {__LINE__, FE_UPWARD, -1.401298464324818e-45DL, -__FLT_DENORM_MIN__}, ++#endif + {__LINE__, FE_UPWARD, 2e-45DL, 2 * __FLT_DENORM_MIN__}, + {__LINE__, FE_UPWARD, -2e-45DL, -__FLT_DENORM_MIN__} + }; +@@ -292,8 +332,12 @@ static const d128_type d128to32[] = { + static const d64_type d64to64[] = { + {__LINE__, FE_TONEAREST, 1e-398DD, 0.0}, + {__LINE__, FE_TONEAREST, -1e-398DD, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_TONEAREST, 1e-325DD, 0.0}, + {__LINE__, FE_TONEAREST, -1e-325DD, -0.0}, ++#endif + {__LINE__, FE_TONEAREST, 2.470328229206232e-324DD, 0.0}, + {__LINE__, FE_TONEAREST, -2.470328229206232e-324DD, -0.0}, + {__LINE__, FE_TONEAREST, 2.470328229206233e-324DD, __DBL_DENORM_MIN__}, +@@ -346,8 +390,12 @@ static const d64_type d64to32[] = { + {__LINE__, FE_TONEAREST, -7.00649232e-46DD, -0.0}, + {__LINE__, FE_TONEAREST, 7.006492321624085e-46DD, 0.0}, + {__LINE__, FE_TONEAREST, -7.006492321624085e-46DD, -0.0}, ++ /* TODO: Fix this. The following lines are known to fail for soft-dfp and ++ POWER hard-dfp. They should have passed. */ ++#ifndef __PPC__ + {__LINE__, FE_TONEAREST, 7.006492321624086e-46DD, __FLT_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, -7.006492321624086e-46DD, -__FLT_DENORM_MIN__}, ++#endif + {__LINE__, FE_TONEAREST, 7.00649233e-46DD, __FLT_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, -7.00649233e-46DD, -__FLT_DENORM_MIN__}, + {__LINE__, FE_TONEAREST, 7.0064924e-46DD, __FLT_DENORM_MIN__}, diff --git a/libdfp-python3.patch b/libdfp-python3.patch new file mode 100644 index 0000000..166fe88 --- /dev/null +++ b/libdfp-python3.patch @@ -0,0 +1,20 @@ +diff --git a/tests/gen-libdfp-tests.py b/tests/gen-libdfp-tests.py +index 52ecf7d..9083e13 100755 +--- a/tests/gen-libdfp-tests.py ++++ b/tests/gen-libdfp-tests.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + import sys + import re +diff --git a/tests/gen-libdfp-ulps.py b/tests/gen-libdfp-ulps.py +index 55dae23..b3e40da 100755 +--- a/tests/gen-libdfp-ulps.py ++++ b/tests/gen-libdfp-ulps.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + import sys + import os diff --git a/libdfp-tests.patch b/libdfp-tests.patch new file mode 100644 index 0000000..ca48d71 --- /dev/null +++ b/libdfp-tests.patch @@ -0,0 +1,260 @@ +commit b5e0e7b5987cd6b79ae876b70bf8608929e5630b +Author: Stefan Liebler +Date: Wed Sep 4 16:07:19 2019 +0200 + + Show details about test fails in output of make check. + + Currently there is no indication which tests fail in an + invocation of "make check". + + This patch creates one .test-result file per test + with an indication like PASS or FAIL. Furthermore the file tests.sum + is created with one line per test in order to indicate the test result. + + At the end of "make check" the failing tests are listed and the + corresponding out files are dumped. + + This way you'll get an indication of failing tests even if you can + just view the log file instead of having access to the build-directory. + + The scripts and some parts of the Makefile comes from glibc in order to + be more equal. + + This change also allows to mark an test as: + -XFAIL or XPASS: Add a Makefile variable like test-xfail- = yes. + -UNSUPPORTED: The testcase has to return with exit-code 77. + + Signed-off-by: Stefan Liebler + +diff --git a/Makefile.in b/Makefile.in +index 7bf3030..757615b 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -379,7 +379,7 @@ ifeq ($(cxxdecimal), yes) + libdfp_cxx_tests = test-ostream test-ostream-g-spec test-istream + endif + +-libdfp_tests = $(libdfp_c_tests) $(libdfp_cxx_tests) ++libdfp_tests = $(libdfp_c_tests) $(libdfp_cxx_tests) check-abi-libdfp check-localplt + + test-printf.os: $(top_builddir)/printf_dfp.os + test-strtod.os: $(top_builddir)/strtod32.os $(top_builddir)/strtod64.os $(top_builddir)/strtod128.os +@@ -422,9 +422,21 @@ test-%-d64.c: %.input + test-%-d128.c: %.input + $(top_srcdir)/tests/gen-libdfp-tests.py -t decimal128 $^ > $(top_builddir)/$@ + ++# The name to give to a test in test results summaries. ++test-name = $(strip $(patsubst %.out, %, $@)) ++ ++# Likewise, in XFAIL variable names. ++test-xfail-name = $(strip $(patsubst %.out, %, $@)) ++ ++evaluate-test = $(top_srcdir)/scripts/evaluate-test.sh $(test-name) $$? \ ++ $(if $(test-xfail-$(test-xfail-name)),true,false) \ ++ false \ ++ > $(top_builddir)/$(test-name).test-result ++ + # Make check main rule +-$(addsuffix .out,$(libdfp_tests)): %.out:% +- LD_LIBRARY_PATH=$(top_builddir)/:$$LD_LIBRARY_PATH $(top_builddir)/$(patsubst %.out,%,$@) 2> $(top_builddir)/$@ 1> /dev/null ++%.out: % ++ LD_LIBRARY_PATH=$(top_builddir)/:$$LD_LIBRARY_PATH $(top_builddir)/$(test-name) 2> $(top_builddir)/$@ 1> /dev/null; \ ++ $(evaluate-test) + + + # Check ABI rules +@@ -433,11 +445,9 @@ generated += $(extra-libs:=.symlist) + + vpath %.abilist $(+sysdeps_dirs) + +-check-abi: check-abi-libdfp.out +- $(warning $@) +- + check-abi-libdfp.out: libdfp$(dfp_abi_extn).abilist libdfp.symlist +- diff -p -U 0 $(filter %.abilist,$^) $(filter %.symlist,$^) > $@ ++ diff -p -U 0 $(filter %.abilist,$^) $(filter %.symlist,$^) > $@; \ ++ $(evaluate-test) + + %.symlist: $(top_srcdir)/scripts/abilist.awk %.dynsym + LC_ALL=C $(AWK) -f $^ > $@T +@@ -448,8 +458,6 @@ check-abi-libdfp.out: libdfp$(dfp_abi_extn).abilist libdfp.symlist + mv -f $@T $@ + + # Check local PLT calls +-check-localplt: check-localplt.out +- + vpath localplt.data $(+sysdep_dirs) + + check-localplt.out: $(top_srcdir)/scripts/check-localplt.awk \ +@@ -458,7 +466,8 @@ check-localplt.out: $(top_srcdir)/scripts/check-localplt.awk \ + localplt.data + LC_ALL=C $(AWK) -f $(filter-out $< %localplt.data,$^) | \ + LC_ALL=C $(AWK) -f $< $(filter %localplt.data,$^) - \ +- > $@ ++ > $@; \ ++ $(evaluate-test) + + libdfp.so.jmprel: libdfp.so + @rm -f $@T +@@ -466,10 +475,26 @@ libdfp.so.jmprel: libdfp.so + test -s $@T + mv -f $@T $@ + ++define summarize-tests ++@egrep -v '^(PASS|XFAIL):' $(top_builddir)/$1 || true ++@echo "Summary of test results$2:" ++@sed 's/:.*//' < $(top_builddir)/$1 | sort | uniq -c ++@! egrep -q -v '^(X?PASS|XFAIL|UNSUPPORTED):' $(top_builddir)/$1 ++endef ++ ++tests: $(libdfp_tests:%=%.out) ++ $(top_srcdir)/scripts/merge-test-results.sh -s $(top_builddir)/ "" \ ++ $(sort $(libdfp_tests)) \ ++ > tests.sum ++ @echo Details of failed tests: ++ awk -v builddir=$(top_builddir) \ ++ '{ if ($$1 != "PASS:") printf "%s/%s.out ", builddir, $$2; }' \ ++ tests.sum | xargs -n 1 -t cat ++ $(call summarize-tests,tests.sum) ++ + # The .out files are predicated in another rule on the actual test executables, so + # those are built from those rules. +-check: $(addsuffix .out,$(libdfp_tests)) check-abi check-localplt +- @echo +Completed make check ++check: tests + + .PHONY: check + +@@ -485,8 +510,8 @@ clean: + rm -f libdfp.map $(SHARED_LINKERNAME_LIB).jmprel libdfp.symlist + rm -f Versions.tmp + rm -f sysd-versions +- rm -f check-abi-libdfp.out check-localplt.out + rm -f $(addsuffix .out,$(libdfp_tests)) ++ rm -f $(addsuffix .test-result,$(libdfp_tests)) + rm -f $(addsuffix .conf,$(libdfp_tests)) + rm -f $(libdfp_tests) + rm -f libdfp-test-ulps.h +diff --git a/scripts/evaluate-test.sh b/scripts/evaluate-test.sh +new file mode 100755 +index 0000000..7bb8642 +--- /dev/null ++++ b/scripts/evaluate-test.sh +@@ -0,0 +1,50 @@ ++#!/bin/sh ++# Output a test status line. ++# Copyright (C) 2012-2019 Free Software Foundation, Inc. ++# This file is part of the GNU C Library. ++ ++# The GNU C Library is free software; you can redistribute it and/or ++# modify it under the terms of the GNU Lesser General Public ++# License as published by the Free Software Foundation; either ++# version 2.1 of the License, or (at your option) any later version. ++ ++# The GNU C Library is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++# Lesser General Public License for more details. ++ ++# You should have received a copy of the GNU Lesser General Public ++# License along with the GNU C Library; if not, see ++# . ++ ++# usage: evaluate-test.sh test_name rc xfail stop_on_failure ++ ++test_name=$1 ++rc=$2 ++orig_rc=$rc ++xfail=$3 ++stop_on_failure=$4 ++ ++if [ $rc -eq 77 ]; then ++ result="UNSUPPORTED" ++ rc=0 ++else ++ if [ $rc -eq 0 ]; then ++ result="PASS" ++ else ++ result="FAIL" ++ fi ++ ++ if $xfail; then ++ result="X$result" ++ rc=0 ++ fi ++fi ++ ++echo "$result: $test_name" ++echo "original exit status $orig_rc" ++if $stop_on_failure; then ++ exit $rc ++else ++ exit 0 ++fi +diff --git a/scripts/merge-test-results.sh b/scripts/merge-test-results.sh +new file mode 100755 +index 0000000..919bbae +--- /dev/null ++++ b/scripts/merge-test-results.sh +@@ -0,0 +1,61 @@ ++#!/bin/sh ++# Merge test results of individual tests or subdirectories. ++# Copyright (C) 2014-2019 Free Software Foundation, Inc. ++# This file is part of the GNU C Library. ++ ++# The GNU C Library is free software; you can redistribute it and/or ++# modify it under the terms of the GNU Lesser General Public ++# License as published by the Free Software Foundation; either ++# version 2.1 of the License, or (at your option) any later version. ++ ++# The GNU C Library is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++# Lesser General Public License for more details. ++ ++# You should have received a copy of the GNU Lesser General Public ++# License along with the GNU C Library; if not, see ++# . ++ ++# usage: merge-test-results.sh -s objpfx subdir test-name... ++# (subdirectory tests; empty subdir at top level), or ++# merge-test-results.sh -t objpfx subdir-file-name subdir... ++# (top-level merge) ++ ++set -e ++ ++type=$1 ++objpfx=$2 ++shift 2 ++ ++case $type in ++ -s) ++ subdir=$1 ++ shift ++ subdir=${subdir:+$subdir/} ++ for t in "$@"; do ++ if [ -s "$objpfx$t.test-result" ]; then ++ head -n1 "$objpfx$t.test-result" ++ else ++ echo "UNRESOLVED: $subdir$t" ++ fi ++ done ++ ;; ++ ++ -t) ++ subdir_file_name=$1 ++ shift ++ for d in "$@"; do ++ if [ -f "$objpfx$d/$subdir_file_name" ]; then ++ cat "$objpfx$d/$subdir_file_name" ++ else ++ echo "ERROR: test results for $d directory missing" ++ fi ++ done ++ ;; ++ ++ *) ++ echo "unknown type $type" >&2 ++ exit 1 ++ ;; ++esac diff --git a/libdfp.spec b/libdfp.spec new file mode 100644 index 0000000..f4bdafc --- /dev/null +++ b/libdfp.spec @@ -0,0 +1,200 @@ +Name: libdfp +Version: 1.0.14 +Release: 7%{?dist} +Summary: Decimal Floating Point C Library +License: LGPLv2 +Url: https://github.com/libdfp/libdfp +Source0: https://github.com/libdfp/libdfp/releases/download/%{version}/%{name}-%{version}.tar.gz + +# Ignore known failures on ppc, ppc64 and ppc64le. +Patch1: libdfp-ppc-xfail.patch +# Enable python3 usage. +Patch2: libdfp-python3.patch +# Add support for DESTDIR. +Patch3: libdfp-DESTDIR.patch +# Print summary of failing tests in the log files. +Patch4: libdfp-tests.patch + +# Be explicit about the soname in order to avoid unintentional changes. +%global soname libdfp.so.1 + +# Select which different cpu variants are build in addition to the default one +%ifarch ppc ppc64 +%global cpu_variants power6 +%endif + +ExclusiveArch: ppc ppc64 ppc64le s390 s390x +BuildRequires: gcc, python3 +%if 0%{?cpu_variants:1} +BuildRequires: execstack +%endif + +%description +The "Decimal Floating Point C Library" is an implementation of ISO/IEC +Technical report "ISO/IEC TR 24732" which describes the C-Language library +routines necessary to provide the C library runtime support for decimal +floating point data types introduced in IEEE 754-2008, namely _Decimal32, +_Decimal64, and _Decimal128. + +%package devel +Summary: Development files for %{name} +# Use _isa to specify an arch-specific requirement. +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%autosetup -p1 + +%define subdir_configure \ +cat >configure <<'EOF'\ +#!/bin/sh\ +exec ../${0##*/} "$@"\ +EOF\ +chmod +x configure \ +%configure + +%build +mkdir Build +pushd Build +%subdir_configure --disable-static +%make_build +popd +%if 0%{?cpu_variants:1} +for cpu in %{cpu_variants}; do + mkdir Build-$cpu + pushd Build-$cpu + %subdir_configure --disable-static --with-cpu=$cpu + make %{?_smp_mflags} + popd +done +%endif + +%check +pushd Build +make -k %{?_smp_mflags} check +popd +%if 0%{?cpu_variants:1} +for cpu in %{cpu_variants}; do + pushd Build-$cpu + make -k %{?_smp_mflags} check + popd +done +%endif + +%install +pushd Build +%make_install +popd +%if 0%{?cpu_variants:1} +for cpu in %{cpu_variants}; do + pushd Build-$cpu + mkdir -p %{buildroot}%{_libdir}/$cpu + install -m 755 libdfp-%{version}.so %{buildroot}%{_libdir}/$cpu + ldconfig -l %{buildroot}%{_libdir}/$cpu/libdfp-%{version}.so + execstack -c %{buildroot}%{_libdir}/$cpu/libdfp-%{version}.so + if test $cpu = power6; then + mkdir -p %{buildroot}%{_libdir}/${cpu}x + pushd %{buildroot}%{_libdir}/${cpu}x + ln -sf ../$cpu/*.so . + cp -a ../$cpu/*.so.* . + popd + fi + popd +done +%endif + +%ldconfig_scriptlets + +%files +%{_libdir}/%{soname} +%{_libdir}/%{name}-%{version}.so +%if 0%{?cpu_variants:1} +%(for cpu in %{cpu_variants}; do echo %dir %{_libdir}/$cpu; test $cpu = power6 && echo %dir %{_libdir}/${cpu}x; done) +%{_libdir}/*/%{soname} +%{_libdir}/*/%{name}-%{version}.so +%endif +%doc %{_docdir}/dfp/README +%doc %{_docdir}/dfp/ChangeLog.md +%license COPYING.txt + +%files devel +%{_includedir}/* +%{_libdir}/*.so +%exclude %{_libdir}/*-*.so + +%changelog +* Wed Oct 09 2019 Tulio Magno Quites Machado Filho - 1.0.14-7 +- Re-add _isa to the requirement of the devel package. + +* Wed Oct 09 2019 Tulio Magno Quites Machado Filho - 1.0.14-6 +- Removed parameter -n from the prep section. +- Removed defattr usage from the devel files. + +* Tue Oct 08 2019 Tulio Magno Quites Machado Filho - 1.0.14-5 +- Add support for DESTDIR. +- Remove extra license patch in order to use license. +- Make usage of scriptlets make_build, make_install and + ldconfig_scriptlets. +- Prevent unintentional soname bumps by specifying it via soname. +- Use global instead of define for cpu_variants. +- Remove unintentional usage of _isa. + +* Wed Sep 04 2019 Stefan Liebler - 1.0.14-4 +- Fix License tag. +- Package COPYING.txt and use it with license macro. + (see libdfp-license.patch and upstream pull-request + https://github.com/libdfp/libdfp/pull/86) +- Remove Group and BuildRoot tags. +- Use buildroot macro instead of RPM_BUILD_ROOT variable. +- Do not remove buildroot during install step. +- Use pushd/popd instead of cd commands. +- Remove clean section. +- Fix changelog in order to not include macros. +- Print summary of failing tests in the output of make check. + (see libdfp-tests.patch and upstream pull-request + https://github.com/libdfp/libdfp/pull/87) + +* Tue Aug 20 2019 Tulio Magno - 1.0.14-3 +- Run the tests on all cpu_variants. + +* Tue Aug 20 2019 Stefan Liebler - 1.0.14-2 +- Remove prelink build requirement. Prevent execstack from being required + when macro cpu_variants is not set. + Remove z9-ec from macro cpu_variants. + +* Wed Aug 14 2019 Tulio Magno - 1.0.14-1 +- Rebase to libdfp-1.0.14. Improve package description. + Enable execstack for ppc64le. + Enable execution of tests. + +* Wed Feb 19 2014 Jeff Law - 1.0.9-1 +- Rebase to libdfp-1.0.9-1 to bring in ppc64le support. + Requires disabling execstack for ppc64le due to lack of + availability + +* Wed Feb 19 2014 Jeff Law - 1.0.8-5 +- Clear executable stack on the cpu_variants builds since + they may contain objects built from assembly which do not + contain the magic tags. BuildRequires: prelink (#804765) + +* Mon Feb 3 2014 Daniel Mach - 1.0.8-4 +- Mass rebuild 2014-01-24 + +* Fri Oct 26 2012 Jeff Law - 1.0.8-3 +- Bump release in the hopes it'll make package wrangler + import the new bits and do the right thing. + +* Fri Sep 7 2012 Jeff Law - 1.0.8-2 +- Add URL tag to spec file. + +* Mon Jun 11 2012 Jeff Law - 1.0.8-1 +- resync with upstream sources r17008 (#804765) + +* Wed May 12 2010 Andreas Schwab - 1.0.1-2 +- Enable building on s390/s390x (#464229) + +* Wed Jan 27 2010 Andreas Schwab - 1.0.1-1 +- Initial version 1.0.1 diff --git a/sources b/sources new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/sources