Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (4)
Ignore test failures on sh4.
· 80329d46
Bas Couwenberg
authored
Jul 23, 2018
80329d46
Don't ignore test failures on architectures arm*/mips*/ppc*/sparc*.
· 463f6583
Bas Couwenberg
authored
Jul 23, 2018
463f6583
Add upstream patch to fix test failure on big endian architectures.
· 6832a7f7
Bas Couwenberg
authored
Jul 23, 2018
6832a7f7
Set distribution to unstable.
· 4795bc0c
Bas Couwenberg
authored
Jul 23, 2018
4795bc0c
Show whitespace changes
Inline
Side-by-side
debian/changelog
View file @
4795bc0c
libosmium (2.14.1-2) unstable; urgency=medium
* Ignore test failures on sh4.
* Don't ignore test failures on architectures arm*/mips*/ppc*/sparc*.
* Add upstream patch to fix test failure on big endian architectures.
-- Bas Couwenberg <sebastic@debian.org> Mon, 23 Jul 2018 16:40:14 +0200
libosmium (2.14.1-1) unstable; urgency=medium
* New upstream release.
...
...
debian/patches/0001-Rewrite-code-to-be-byte-order-independent.patch
0 → 100644
View file @
4795bc0c
Description: Rewrite code to be byte-order independent.
Author: Jochen Topf <jochen@topf.org>
Origin: https://github.com/osmcode/libosmium/commit/ff16782fb7421d1af8120d5f519bc1b4e6453e71
Bug: https://github.com/osmcode/libosmium/issues/263
--- a/include/osmium/io/detail/pbf_input_format.hpp
+++ b/include/osmium/io/detail/pbf_input_format.hpp
@@ -44,7 +44,6 @@
DEALINGS IN THE SOFTWARE.
#include <osmium/thread/util.hpp>
#include <osmium/util/config.hpp>
-#include <protozero/byteswap.hpp>
#include <protozero/pbf_message.hpp>
#include <protozero/types.hpp>
@@ -97,18 +96,20 @@
namespace osmium {
* the length of the following BlobHeader.
*/
uint32_t read_blob_header_size_from_file() {
- uint32_t size_in_network_byte_order;
+ uint32_t size;
try {
- const std::string input_data{read_from_input_queue(sizeof(size_in_network_byte_order))};
- size_in_network_byte_order = *reinterpret_cast<const uint32_t*>(input_data.data());
+ // size is encoded in network byte order
+ const std::string input_data{read_from_input_queue(sizeof(size))};
+ const char* d = input_data.data();
+ size = (static_cast<uint32_t>(d[3])) |
+ (static_cast<uint32_t>(d[2]) << 8u) |
+ (static_cast<uint32_t>(d[1]) << 16u) |
+ (static_cast<uint32_t>(d[0]) << 24u);
} catch (const osmium::pbf_error&) {
return 0; // EOF
}
- uint32_t size = size_in_network_byte_order;
- ::protozero::byteswap_inplace(&size);
-
if (size > static_cast<uint32_t>(max_blob_header_size)) {
throw osmium::pbf_error{"invalid BlobHeader size (> max_blob_header_size)"};
}
--- a/include/osmium/io/detail/pbf_output_format.hpp
+++ b/include/osmium/io/detail/pbf_output_format.hpp
@@ -62,7 +62,6 @@
DEALINGS IN THE SOFTWARE.
#include <osmium/util/misc.hpp>
#include <osmium/visitor.hpp>
-#include <protozero/byteswap.hpp>
#include <protozero/pbf_builder.hpp>
#include <protozero/pbf_writer.hpp>
#include <protozero/types.hpp>
@@ -193,13 +192,16 @@
namespace osmium {
// data plus a few header bytes (https://zlib.net/zlib_tech.html).
pbf_blob_header.add_int32(FileFormat::BlobHeader::required_int32_datasize, static_cast<int32_t>(blob_data.size()));
- auto sz = static_cast<uint32_t>(blob_header_data.size());
- ::protozero::byteswap_inplace(&sz);
+ const auto size = static_cast<uint32_t>(blob_header_data.size());
- // write to output: the 4-byte BlobHeader-Size followed by the BlobHeader followed by the Blob
+ // write to output: the 4-byte BlobHeader size in network
+ // byte order followed by the BlobHeader followed by the Blob
std::string output;
- output.reserve(sizeof(sz) + blob_header_data.size() + blob_data.size());
- output.append(reinterpret_cast<const char*>(&sz), sizeof(sz));
+ output.reserve(4 + blob_header_data.size() + blob_data.size());
+ output += static_cast<char>((size >> 24u) & 0xffu);
+ output += static_cast<char>((size >> 16u) & 0xffu);
+ output += static_cast<char>((size >> 8u) & 0xffu);
+ output += static_cast<char>( size & 0xffu);
output.append(blob_header_data);
output.append(blob_data);
debian/patches/series
0 → 100644
View file @
4795bc0c
0001-Rewrite-code-to-be-byte-order-independent.patch
debian/rules
View file @
4795bc0c
...
...
@@ -21,7 +21,7 @@ override_dh_auto_build-indep:
override_dh_auto_test-arch:
# Ignore test failures on problematic architectures only
ifneq (,$(filter $(DEB_BUILD_ARCH),
arm64 mips mipsel ppc64 ppc64el sparc6
4))
ifneq (,$(filter $(DEB_BUILD_ARCH),
sh
4))
(cd build && ctest -V || echo "Ignoring test failures")
else
(cd build && ctest -V)
...
...