Commit 9f5a4380 authored by Matthijs Mekking's avatar Matthijs Mekking 🏡

Fix linking problem for #1612

When a library is examined, an object file within it can be left out
of the link if it does not provide symbols that the symbol table
needs.  Introducing `isc_stdtime_tostring` caused a build failure for
`update_test` because it now requires `libisc.a(stdtime.o)` and that
also exports the `isc_stdtime_get` symbol, meaning we have a
multiple definition error.

Add a local version of `isc_stdtime_tostring`, so that the linker
will not search for it in available object files.
parent 2d9b282d
Pipeline #45714 passed with stages
in 19 minutes and 43 seconds
......@@ -75,11 +75,34 @@ set_mystdtime(int year, int month, int day) {
mystdtime = timegm(&tm);
}
/*
* Override isc_stdtime_get() from lib/isc/[unix/win32]/stdtime.c
* with our own for testing purposes.
*/
void
isc_stdtime_get(isc_stdtime_t *now) {
*now = mystdtime;
}
/*
* Because update_test.o requires dns_update_*() symbols, the linker is able
* to resolve them using libdns.a(update.o). That object has other symbol
* dependencies (dst_key_*()), so it pulls libdns.a(dst_api.o).
* That object file requires the isc_stdtime_tostring() symbol.
*
* Define a local version here so that we don't have to depend on
* libisc.a(stdtime.o). If isc_stdtime_tostring() would be left undefined,
* the linker has to get the required object file, and that will result in a
* multiple definition error because the isc_stdtime_get() symbol exported
* there is already in the exported list.
*/
void
isc_stdtime_tostring(isc_stdtime_t t, char *out, size_t outlen) {
UNUSED(t);
UNUSED(out);
UNUSED(outlen);
}
/* simple increment by 1 */
static void
increment_test(void **state) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment