Project

General

Profile

Bug #50291

Updated by Kefu Chai almost 3 years ago

Fedora 35 and Fedora ELN (enterprise linux next, a.k.a. rhel9) have updated to from librabbitmq-0.10.0 to -0.11.0 and builds are now failing. See, e.g., https://kojipkgs.fedoraproject.org//work/tasks/4144/65634144/build.log

librabbitmq's amqp_simple_wait_frame_noblock() changed the 'struct timeval *' to 'const struct timeval *'

(Note: extern "C" { ... } may not be necessary. I just found it strange that libamqp_mock's amqp_simple_wait_frame_noblock() symbol currently has a C++ mangled symbol name while the one in /usr/lib64/librabbitmq.so.4 is obviously not mangled.

FWIW, I did not dig very hard or far to figure out whether before now libamqp_mock's amqp_simple_wait_frame_noblock() was also mangled, or how the test programs which have an unmangled reference to amqp_simple_wait_frame_noblock() could have linked with it then, but not now.)

I fixed it with with the following change:
<pre><code class="diff">
--- a/src/test/rgw/amqp_mock.cc
+++ b/src/test/rgw/amqp_mock.cc
@@ -291,7 +291,11 @@ amqp_confirm_select_ok_t* amqp_confirm_select(amqp_connection_state_t state, amq
return state->confirm;
}

-int amqp_simple_wait_frame_noblock(amqp_connection_state_t state, amqp_frame_t *decoded_frame, struct timeval* tv) {
+extern "C" {
+
+int amqp_simple_wait_frame_noblock(amqp_connection_state_t state,
+ amqp_frame_t *decoded_frame,
+ const struct timeval* tv) {
if (state->socket && state->socket->open_called &&
state->login_called && state->channel1 && state->channel2 && state->exchange &&
state->queue && state->consume && state->confirm && !FAIL_NEXT_READ) {
@@ -345,6 +349,7 @@ int amqp_simple_wait_frame_noblock(amqp_connection_state_t state, amqp_frame_t *
}
return AMQP_STATUS_CONNECTION_CLOSED;
}
+} // extern "C"

amqp_basic_consume_ok_t* amqp_basic_consume(
amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue,
</code></pre>

Back