1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Fixed missing flag in C library build.

The missing flag resulted in a mismatched binary on 32-bit systems.

Reported by Adrian Vondendriesch.
This commit is contained in:
David Steele 2017-06-22 12:57:10 -04:00
parent f8849d7359
commit d3054d919b
4 changed files with 21 additions and 3 deletions

View File

@ -162,6 +162,16 @@
<release-core-list>
<p><b>IMPORTANT NOTE</b>: Support for <postgres/> 8.3 has been removed in this release as no currently supported systems include it.</p>
<release-bug-list>
<release-item>
<release-item-contributor-list>
<release-item-ideator id="vondendriesch.adrian"/>
</release-item-contributor-list>
<p>Fixed missing flag in C library build that resulted in a mismatched binary on 32-bit systems.</p>
</release-item>
</release-bug-list>
<release-refactor-list>
<release-item>
<p>Harden protocol handshake to handle race conditions.</p>

View File

@ -12,7 +12,7 @@ WriteMakefile
NAME => 'pgBackRest::LibC',
VERSION_FROM => 'lib/pgBackRest/LibC.pm', # finds $VERSION, requires EU::MM from perl >= 5.5
AUTHOR => 'David Steele <david@pgbackrest.org>',
CCFLAGS => '-std=c99 -funroll-loops -ftree-vectorize -ftree-vectorizer-verbose=2 $(CFLAGS)',
CCFLAGS => '-std=c99 -D_FILE_OFFSET_BITS=64 -funroll-loops -ftree-vectorize -ftree-vectorizer-verbose=2 $(CFLAGS)',
LIBS => [''], # e.g., '-lm'
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => '-I.', # e.g., '-I. -I/usr/include/other'

View File

@ -215,7 +215,7 @@ pageChecksumBufferTest(
// If the buffer does not represent an even number of pages then error
if (uiBufferSize % uiPageSize != 0 || uiBufferSize / uiPageSize == 0)
{
croak("buffer size %u, page size %u are not divisible", uiBufferSize, uiPageSize);
croak("buffer size %lu, page size %lu are not divisible", uiBufferSize, uiPageSize);
}
// Loop through all pages in the buffer

View File

@ -9,7 +9,7 @@ use English '-no_match_vars';
use Fcntl qw(O_RDONLY);
# Set number of tests
use Test::More tests => 10;
use Test::More tests => 11;
# Make sure the module loads without errors
BEGIN {use_ok('pgBackRest::LibC')};
@ -88,6 +88,14 @@ sub pageBuild
ok (pageChecksumBufferTest($tBufferMulti, length($tBufferMulti), 0, $iPageSize, 0xFFFF, 0xFFFF), 'pass valid page buffer');
# Make sure that an invalid buffer size throws an exception
eval
{
pageChecksumBufferTest($tBufferMulti, length($tBufferMulti) - 1, 0, $iPageSize, 0xFFFF, 0xFFFF);
};
ok (defined($EVAL_ERROR) && $EVAL_ERROR =~ 'buffer size 65535, page size 8192 are not divisible.*', 'invalid page buffer size');
# Allow page with an invalid checksum because LSN >= ignore LSN
$tBufferMulti =
pageBuild($tBuffer, 0, 0, 0) .